diff --git a/Cargo.lock b/Cargo.lock index 3311c04f7b..d45d055ac8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1998,7 +1998,7 @@ dependencies = [ [[package]] name = "blockifier" version = "0.8.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3#290338edf2930e2d9ee0767685cb8c180ba1119a" +source = "git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.1#dd69217cdec340f9b5267b781be38eef972ac401" dependencies = [ "anyhow", "ark-ec", @@ -13895,7 +13895,7 @@ dependencies = [ [[package]] name = "starknet_api" version = "0.13.0-rc.1" -source = "git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3#290338edf2930e2d9ee0767685cb8c180ba1119a" +source = "git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.1#dd69217cdec340f9b5267b781be38eef972ac401" dependencies = [ "bitvec", "cairo-lang-starknet-classes", diff --git a/crates/katana/cairo/Cargo.toml b/crates/katana/cairo/Cargo.toml index 95f5dad570..09faeab388 100644 --- a/crates/katana/cairo/Cargo.toml +++ b/crates/katana/cairo/Cargo.toml @@ -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" } diff --git a/crates/katana/executor/Cargo.toml b/crates/katana/executor/Cargo.toml index d98bb8ffeb..677e044024 100644 --- a/crates/katana/executor/Cargo.toml +++ b/crates/katana/executor/Cargo.toml @@ -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] diff --git a/crates/katana/rpc/rpc/tests/starknet.rs b/crates/katana/rpc/rpc/tests/starknet.rs index 9f795e7d1f..281cadde81 100644 --- a/crates/katana/rpc/rpc/tests/starknet.rs +++ b/crates/katana/rpc/rpc/tests/starknet.rs @@ -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(()) }