Skip to content

Commit

Permalink
Bump blockifier to fix DeployAccount tx not respecting disable fe…
Browse files Browse the repository at this point in the history
…e flag (#2478)
  • Loading branch information
kariy authored Sep 25, 2024
1 parent 1e8ad6f commit ae41d8c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/katana/cairo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cairo-lang-starknet = "2.7.0"
cairo-lang-starknet-classes = "2.7.0"
cairo-lang-utils = "2.7.0"
cairo-vm = "1.0.1"
starknet_api = { git = "https://github.com/dojoengine/sequencer", tag = "v0.8.0-rc3" }
starknet_api = { git = "https://github.com/dojoengine/sequencer", tag = "v0.8.0-rc3.1" }
2 changes: 1 addition & 1 deletion crates/katana/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ starknet = { workspace = true, optional = true }
thiserror.workspace = true
tracing.workspace = true

blockifier = { git = "https://github.com/dojoengine/sequencer", tag = "v0.8.0-rc3", features = [ "testing" ], optional = true }
blockifier = { git = "https://github.com/dojoengine/sequencer", tag = "v0.8.0-rc3.1", features = [ "testing" ], optional = true }
katana-cairo = { workspace = true, optional = true }

[dev-dependencies]
Expand Down
32 changes: 32 additions & 0 deletions crates/katana/rpc/rpc/tests/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,38 @@ async fn deploy_account(
let res = provider.get_class_hash_at(BlockId::Tag(BlockTag::Pending), computed_address).await?;
assert_eq!(res, class_hash);

// deploy from empty balance,
// need to test this case because of how blockifier's StatefulValidator works.
// TODO: add more descriptive reason
if disable_fee {
let salt = felt!("0x456");

// starknet-rs's utility for deploying an OpenZeppelin account
let factory =
OpenZeppelinAccountFactory::new(class_hash, chain_id, &signer, &provider).await?;
let res = factory.deploy_v1(salt).send().await?;
let ctor_args = [signer.get_public_key().await?.scalar()];
let computed_address = get_contract_address(salt, class_hash, &ctor_args, Felt::ZERO);

// the contract address in the send tx result must be the same as the computed one
assert_eq!(res.contract_address, computed_address);

let receipt = dojo_utils::TransactionWaiter::new(res.transaction_hash, &provider).await?;
assert_matches!(
receipt.receipt,
TransactionReceipt::DeployAccount(DeployAccountTransactionReceipt { contract_address, .. }) => {
// the contract address in the receipt must be the same as the computed one
assert_eq!(contract_address, computed_address)
}
);

// Verify the `getClassHashAt` returns the same class hash that we use for the account
// deployment
let res =
provider.get_class_hash_at(BlockId::Tag(BlockTag::Pending), computed_address).await?;
assert_eq!(res, class_hash);
}

Ok(())
}

Expand Down

0 comments on commit ae41d8c

Please sign in to comment.