-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: getAccount #10402
fix: getAccount #10402
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.
nice, smol nits
let nonce = account.nonce; | ||
let code_hash = account.bytecode_hash.unwrap_or(KECCAK_EMPTY); | ||
let account = state.basic_account(address).map_err(Self::Error::from_eth_err)?; | ||
if let Some(account) = 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.
styl nit:
let use let Some() else {return Ok(None)}
here to get rid of the scope
|
||
let account = eth_api.get_account(address, Default::default()).await.unwrap(); | ||
let expected_account = | ||
alloy_consensus::Account { code_hash: KECCAK_EMPTY, ..Default::default() }; |
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 believe this is available from the reth-rpc-types crate so we don't need the alloy-consensus dep here
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 test case can also be added as an additional call here
reth/crates/rpc/rpc-builder/tests/it/http.rs
Line 177 in 72ed7a9
EthApiClient::accounts(client).await.unwrap(); |
d0b7007
to
7ca7e78
Compare
After checking out the implementation of the endpoint by Geth and Nethermind, I believe we should be returning an
None
value if the account if not found in the state.Example:
Returns
null
.