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

Bump blockifier to fix DeployAccount tx not respecting disable fee flag #2478

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
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
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
Loading