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 2 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

let resp = tokio::try_join!(balance, nonce, code).map_err(Into::into);
(resp, address)
match mode.load(Ordering::Relaxed) {
ACCOUNT_FETCH_UNCHECKED | ACCOUNT_FETCH_SUPPORTS_ACC_INFO => {
Copy link
Member

Choose a reason for hiding this comment

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

we need to treat the initial unchecked case a bit differently, because we want to fetch as fast as possible so for this we should also request the regular acc request triple

Comment on lines +302 to +303
if mode.load(Ordering::Relaxed) == ACCOUNT_FETCH_UNCHECKED {
mode.store(ACCOUNT_FETCH_SUPPORTS_ACC_INFO, Ordering::Relaxed);
Copy link
Member

Choose a reason for hiding this comment

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

these checks can be a bit optimized if we store the initial load in a tmp var

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