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

tests: cover latest block for test_getStorageAt #786

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tests/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,15 @@ async fn test_getStorageAt() -> Result<(), Error> {
"0x0341c1bdfd89f69748aa00b5742b03adbffd79b8e80cab5c50d91cd8c2a79be1",
)?;

const EXPECTED: &str = "0x47616d65206f66204c69666520546f6b656e";

let block_id_number =
BlockId::BlockNumber { block_number: BlockNumber::try_new(600612)? };
let ret = ctx
.client
.getStorageAt(contract_address.clone(), key.clone(), block_id_number)
.await?;
assert_eq!(ret.as_ref(), "0x47616d65206f66204c69666520546f6b656e");
assert_eq!(ret.as_ref(), EXPECTED);

let block_id_hash = BlockId::BlockHash {
block_hash: BlockHash(Felt::try_new(
Expand All @@ -270,7 +272,14 @@ async fn test_getStorageAt() -> Result<(), Error> {
.client
.getStorageAt(contract_address.clone(), key.clone(), block_id_hash)
.await?;
assert_eq!(ret.as_ref(), "0x47616d65206f66204c69666520546f6b656e");
assert_eq!(ret.as_ref(), EXPECTED);

let block_id_tag = BlockId::BlockTag(BlockTag::Latest);
let ret = ctx
.client
.getStorageAt(contract_address.clone(), key.clone(), block_id_tag)
.await?;
assert_eq!(ret.as_ref(), EXPECTED);

let block_id_tag = BlockId::BlockTag(BlockTag::Pending);
let ret =
Expand Down
Loading