Skip to content
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: use U256 for eth_getStorageAt #133

Merged
merged 1 commit into from
Jan 19, 2024
Merged

fix: use U256 for eth_getStorageAt #133

merged 1 commit into from
Jan 19, 2024

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Jan 19, 2024

Motivation

fix (maybe) foundry-rs/foundry#6855

See links in comments

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

.await
// Key is a QUANTITY according to the [spec](https://eth.wiki/json-rpc/API#eth_getstorageat).
// See: https://github.com/gakonst/ethers-rs/blob/b60c7fe1fea41a902e3b62dc716d45b326520fd0/ethers-providers/src/rpc/provider.rs#L674
let key = U256::from_be_bytes(key.into());
Copy link
Member Author

Choose a reason for hiding this comment

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

Should this be changed in the parameter?

Copy link
Member

Choose a reason for hiding this comment

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

I think so, the user should do that, the storageKey type is intended for the server so the off spec format is also supported

we should use spec compliance here

.await
// Key is a QUANTITY according to the [spec](https://eth.wiki/json-rpc/API#eth_getstorageat).
// See: https://github.com/gakonst/ethers-rs/blob/b60c7fe1fea41a902e3b62dc716d45b326520fd0/ethers-providers/src/rpc/provider.rs#L674
let key = U256::from_be_bytes(key.into());
Copy link
Member

Choose a reason for hiding this comment

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

I think so, the user should do that, the storageKey type is intended for the server so the off spec format is also supported

we should use spec compliance here

@DaniPopes DaniPopes merged commit e4092e2 into main Jan 19, 2024
16 of 17 checks passed
@DaniPopes DaniPopes deleted the dani/fix-getstorageat branch January 19, 2024 16:02
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.

2 participants