Skip to content

Commit

Permalink
Expand predeclared account class assertion test
Browse files Browse the repository at this point in the history
  • Loading branch information
FabijanC committed Dec 6, 2024
1 parent 0a2b5aa commit 31e935a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions crates/starknet-devnet-core/src/starknet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1429,9 +1429,11 @@ mod tests {
use crate::account::{Account, FeeToken};
use crate::blocks::StarknetBlock;
use crate::constants::{
ARGENT_CONTRACT_CLASS_HASH, ARGENT_MULTISIG_CONTRACT_CLASS_HASH, DEVNET_DEFAULT_CHAIN_ID,
DEVNET_DEFAULT_INITIAL_BALANCE, DEVNET_DEFAULT_STARTING_BLOCK_NUMBER,
ETH_ERC20_CONTRACT_ADDRESS, STRK_ERC20_CONTRACT_ADDRESS,
ARGENT_CONTRACT_CLASS_HASH, ARGENT_MULTISIG_CONTRACT_CLASS_HASH,
CAIRO_0_ACCOUNT_CONTRACT_HASH, CAIRO_1_ACCOUNT_CONTRACT_SIERRA_HASH,
DEVNET_DEFAULT_CHAIN_ID, DEVNET_DEFAULT_INITIAL_BALANCE,
DEVNET_DEFAULT_STARTING_BLOCK_NUMBER, ETH_ERC20_CONTRACT_ADDRESS,
STRK_ERC20_CONTRACT_ADDRESS,
};
use crate::error::{DevnetResult, Error};
use crate::stack_trace::{ErrorStack, Frame};
Expand Down Expand Up @@ -1699,7 +1701,12 @@ mod tests {
fn assert_expected_predeclared_account_classes() {
let config = StarknetConfig { predeclare_argent: true, ..Default::default() };
let starknet = Starknet::new(&config).unwrap();
for class_hash in [ARGENT_CONTRACT_CLASS_HASH, ARGENT_MULTISIG_CONTRACT_CLASS_HASH] {
for class_hash in [
ARGENT_CONTRACT_CLASS_HASH,
ARGENT_MULTISIG_CONTRACT_CLASS_HASH,
Felt::from_hex_unchecked(CAIRO_0_ACCOUNT_CONTRACT_HASH),
Felt::from_hex_unchecked(CAIRO_1_ACCOUNT_CONTRACT_SIERRA_HASH),
] {
let contract = starknet.get_class(&BlockId::Tag(BlockTag::Latest), class_hash).unwrap();
assert_eq!(contract.generate_hash().unwrap(), class_hash);
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/predeployed.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Alternatively, provide a path to the [Sierra artifact](https://github.com/starkw

## Predeclared account classes

Both Cairo 0 and Cairo 1 versions of OpenZeppelin account are always predeclared, regardless of the chosen predeployment variant. If you specify the `--predeclare-argent` flag on startup, the latest regular and multistig variants of Argent accounts will also be predeclared.
Both Cairo 0 and Cairo 1 versions of OpenZeppelin account are always predeclared, regardless of the chosen predeployment variant. If you specify the `--predeclare-argent` flag on startup, the latest regular and multistig variants of Argent account will also be predeclared.

## Deploying an undeclared account

Expand Down

0 comments on commit 31e935a

Please sign in to comment.