-
Notifications
You must be signed in to change notification settings - Fork 17
feat: support getAccount mode #48
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
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.
great start
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, the only thing missing is some simplifications to make this super nice to read
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.
almost forgot about this,
last style nits
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.
okay, thanks for sticking around, and sorry for the delay...
last suggestion, hope it makes sense, maybe we need to use pin_mut! here for the triple, but i think we can just await it if the acc_info_fut succeeds first
} | ||
Err(_) => { | ||
mode.store(ACCOUNT_FETCH_SEPARATE_REQUESTS, Ordering::Relaxed); | ||
tokio::try_join!(balance_fut, nonce_fut, code_fut).map_err(Into::into) |
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.
this is a bit wasteful, because now, we're cancelling the already in progress other arm, what we could do here is drive the already in progress triple
future to completion instead, if we first store it in a temp var instead of assigning it in the select macro like we do rn in L322
provider.get_transaction_count(address).block_id(block_id).into_future(); | ||
let code_fut = provider.get_code_at(address).block_id(block_id).into_future(); | ||
|
||
tokio::select! { |
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.
the select is good here, becuase if this does support ethgetinfo, then this is the most efficient impl.
fixes #47