Skip to content

Commit

Permalink
fix: fetch class (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcaron authored Nov 25, 2024
1 parent faeeea8 commit 830e95e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- fix(fgw): fetch class
- feat: possibility of starting madara & kakarot-rpc in docker
- feat(debug): service cancelling and profiling build
- feat(endpoint): added extra admin rpc endpoint for sensitive rpc calls
Expand Down
35 changes: 30 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,5 @@ tracing-opentelemetry = "0.26.0"
[patch.crates-io]
# wait for PR https://github.com/starknet-io/types-rs/pull/76 to be merged
starknet-types-core = { git = "https://github.com/kasarlabs/types-rs.git", branch = "feat-deserialize-v0.1.7" }

starknet-core = { git = "https://github.com/kasarlabs/starknet-rs.git", branch = "fork" }
11 changes: 11 additions & 0 deletions crates/client/gateway/client/src/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ mod tests {

const CLASS_BLOCK_0: &str = "0x010455c752b86932ce552f2b0fe81a880746649b9aee7e0d842bf3f52378f9f8";

const CLASS_NO_ABI: &str = "0x371b5f7c5517d84205365a87f02dcef230efa7b4dd91a9e4ba7e04c5b69d69b";

const CLASS_ACCOUNT: &str = "0x07595b4f7d50010ceb00230d8b5656e3c3dd201b6df35d805d3f2988c69a1432";
const CLASS_ACCOUNT_BLOCK: u64 = 1342;

Expand Down Expand Up @@ -408,6 +410,15 @@ mod tests {
assert_eq!(class, class_compressed_reference.into());
}

#[rstest]
#[tokio::test]
async fn get_class_by_hash_legacy_without_abi(client_mainnet_fixture: GatewayProvider) {
let _ = client_mainnet_fixture
.get_class_by_hash(Felt::from_hex_unchecked(CLASS_NO_ABI), BlockId::Number(20734))
.await
.unwrap_or_else(|_| panic!("Getting class {CLASS_NO_ABI} at block number 0"));
}

#[rstest]
#[tokio::test]
async fn get_class_by_hash_account(client_mainnet_fixture: GatewayProvider) {
Expand Down

0 comments on commit 830e95e

Please sign in to comment.