-
Notifications
You must be signed in to change notification settings - Fork 23
chore(rpc): optimize wallet_getAssets balance fetching
#1504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
mattsse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
I find this section a bit harder to read now, because we have a few nested levels
any idea how to structure this a bit @joshieDo ?
src/rpc/relay.rs
Outdated
| let mut multicall = chain_provider.multicall().dynamic(); | ||
| for address in &erc20_addresses { | ||
| let erc20 = IERC20::new(address.address(), &chain_provider); | ||
| multicall = multicall.add_dynamic(erc20.balanceOf(request.account)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is basically
chain_provider.multicall().dynamic().extend(...);
then we can shorten this entire section a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just applied the change.
This is more idiomatic, but not significantly shorter.😅
Closes #1498
Batching
balanceOfcall for erc20 assets