-
Notifications
You must be signed in to change notification settings - Fork 18
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
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 => { |
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.
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
if mode.load(Ordering::Relaxed) == ACCOUNT_FETCH_UNCHECKED { | ||
mode.store(ACCOUNT_FETCH_SUPPORTS_ACC_INFO, Ordering::Relaxed); |
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.
these checks can be a bit optimized if we store the initial load in a tmp var
fixes #47