Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Rimeeeeee
Copy link

fixes #47

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great start

Copy link
Member

@mattsse mattsse left a 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

@Rimeeeeee Rimeeeeee requested a review from mattsse May 23, 2025 14:38
Copy link
Member

@mattsse mattsse left a 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

@Rimeeeeee Rimeeeeee requested a review from mattsse June 5, 2025 08:56
Copy link
Member

@mattsse mattsse left a 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)
Copy link
Member

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! {
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support getAccount mode
2 participants