diff --git a/contracts/Scarb.toml b/contracts/Scarb.toml index 8db444ee..c9dc2747 100644 --- a/contracts/Scarb.toml +++ b/contracts/Scarb.toml @@ -20,7 +20,7 @@ alexandria_encoding = { git = "https://github.com/keep-starknet-strange/alexandr snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.28.0" } [dev-dependencies] -alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria.git", rev = "bcdca70afdf59c9976148e95cebad5cf63d75a7f" } +alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria.git", rev = "e1b080577aaa6889116fc8be5dde72b2fd21e397" } [lib] diff --git a/contracts/src/tests/test_mcms/test_set_config.cairo b/contracts/src/tests/test_mcms/test_set_config.cairo index 9d68415d..253ce7d1 100644 --- a/contracts/src/tests/test_mcms/test_set_config.cairo +++ b/contracts/src/tests/test_mcms/test_set_config.cairo @@ -1,15 +1,12 @@ use core::array::{SpanTrait, ArrayTrait}; +use core::starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess}; use starknet::{ ContractAddress, EthAddress, Felt252TryIntoEthAddress, EthAddressIntoFelt252, EthAddressZeroable, contract_address_const }; use chainlink::mcms::{ ExpiringRootAndOpCount, RootMetadata, Config, Signer, ManyChainMultiSig, - ManyChainMultiSig::{ - InternalFunctionsTrait, contract_state_for_testing, s_signersContractMemberStateTrait, - s_expiring_root_and_op_countContractMemberStateTrait, - s_root_metadataContractMemberStateTrait - }, + ManyChainMultiSig::{NewRoot, InternalFunctionsTrait, contract_state_for_testing}, IManyChainMultiSigDispatcher, IManyChainMultiSigDispatcherTrait, IManyChainMultiSigSafeDispatcher, IManyChainMultiSigSafeDispatcherTrait, IManyChainMultiSig, ManyChainMultiSig::{MAX_NUM_SIGNERS}, diff --git a/contracts/src/tests/test_mcms/test_set_root.cairo b/contracts/src/tests/test_mcms/test_set_root.cairo index d8d893a9..203c8726 100644 --- a/contracts/src/tests/test_mcms/test_set_root.cairo +++ b/contracts/src/tests/test_mcms/test_set_root.cairo @@ -15,11 +15,7 @@ use starknet::{ use chainlink::mcms::{ recover_eth_ecdsa, hash_pair, hash_op, hash_metadata, ExpiringRootAndOpCount, RootMetadata, Config, Signer, eip_191_message_hash, ManyChainMultiSig, Op, - ManyChainMultiSig::{ - NewRoot, InternalFunctionsTrait, contract_state_for_testing, - s_signersContractMemberStateTrait, s_expiring_root_and_op_countContractMemberStateTrait, - s_root_metadataContractMemberStateTrait - }, + ManyChainMultiSig::{NewRoot, InternalFunctionsTrait, contract_state_for_testing}, IManyChainMultiSigDispatcher, IManyChainMultiSigDispatcherTrait, IManyChainMultiSigSafeDispatcher, IManyChainMultiSigSafeDispatcherTrait, IManyChainMultiSig, ManyChainMultiSig::{MAX_NUM_SIGNERS}, @@ -30,9 +26,10 @@ use chainlink::tests::test_mcms::utils::{ }; use snforge_std::{ - declare, ContractClassTrait, start_cheat_caller_address_global, start_cheat_caller_address, - stop_cheat_caller_address, stop_cheat_caller_address_global, start_cheat_chain_id_global, - spy_events, EventSpyAssertionsTrait, // Add for assertions on the EventSpy + declare, ContractClassTrait, DeclareResultTrait, start_cheat_caller_address_global, + start_cheat_caller_address, stop_cheat_caller_address, stop_cheat_caller_address_global, + start_cheat_chain_id_global, spy_events, + EventSpyAssertionsTrait, // Add for assertions on the EventSpy test_address, // the contract being tested, start_cheat_chain_id, cheatcodes::{events::{EventSpy}}, start_cheat_block_timestamp_global, @@ -80,7 +77,7 @@ fn setup_mcms_deploy_set_config_and_set_root_WRONG_MULTISIG() -> ( ); let calldata = ArrayTrait::new(); - let mock_target_contract = declare("MockMultisigTarget").unwrap(); + let mock_target_contract = declare("MockMultisigTarget").unwrap().contract_class(); let (target_address, _) = mock_target_contract.deploy(@calldata).unwrap(); // mock chain id & timestamp diff --git a/contracts/src/tests/test_mcms/utils.cairo b/contracts/src/tests/test_mcms/utils.cairo index bbb1195a..f749d973 100644 --- a/contracts/src/tests/test_mcms/utils.cairo +++ b/contracts/src/tests/test_mcms/utils.cairo @@ -5,6 +5,7 @@ use alexandria_encoding::sol_abi::encode::SolAbiEncodeTrait; use alexandria_math::u512_arithmetics; use core::math::{u256_mul_mod_n, u256_div_mod_n}; use core::zeroable::{IsZeroResult, NonZero, zero_based}; +use core::starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess}; use alexandria_math::u512_arithmetics::{u512_add, u512_sub, U512Intou256X2,}; use starknet::{ @@ -19,19 +20,15 @@ use starknet::{ use chainlink::mcms::{ recover_eth_ecdsa, hash_pair, hash_op, hash_metadata, ExpiringRootAndOpCount, RootMetadata, Config, Signer, eip_191_message_hash, ManyChainMultiSig, Op, - ManyChainMultiSig::{ - NewRoot, InternalFunctionsTrait, contract_state_for_testing, - s_signersContractMemberStateTrait, s_expiring_root_and_op_countContractMemberStateTrait, - s_root_metadataContractMemberStateTrait - }, + ManyChainMultiSig::{NewRoot, InternalFunctionsTrait, contract_state_for_testing}, IManyChainMultiSigDispatcher, IManyChainMultiSigDispatcherTrait, IManyChainMultiSigSafeDispatcher, IManyChainMultiSigSafeDispatcherTrait, IManyChainMultiSig, ManyChainMultiSig::{MAX_NUM_SIGNERS}, }; use snforge_std::{ - declare, ContractClassTrait, start_cheat_caller_address_global, start_cheat_caller_address, - stop_cheat_caller_address, stop_cheat_caller_address_global, spy_events, - EventSpyAssertionsTrait, // Add for assertions on the EventSpy + declare, ContractClassTrait, DeclareResultTrait, start_cheat_caller_address_global, + start_cheat_caller_address, stop_cheat_caller_address, stop_cheat_caller_address_global, + spy_events, EventSpyAssertionsTrait, // Add for assertions on the EventSpy test_address, // the contract being tested, start_cheat_chain_id, start_cheat_chain_id_global, start_cheat_block_timestamp_global, cheatcodes::{events::{EventSpy}} @@ -300,7 +297,11 @@ fn setup_mcms_deploy() -> ( ) { let calldata = array![]; - let (mcms_address, _) = declare("ManyChainMultiSig").unwrap().deploy(@calldata).unwrap(); + let (mcms_address, _) = declare("ManyChainMultiSig") + .unwrap() + .contract_class() + .deploy(@calldata) + .unwrap(); ( mcms_address, @@ -399,7 +400,7 @@ fn setup_mcms_deploy_set_config_and_set_root() -> ( ); let calldata = ArrayTrait::new(); - let mock_target_contract = declare("MockMultisigTarget").unwrap(); + let mock_target_contract = declare("MockMultisigTarget").unwrap().contract_class(); let (target_address, _) = mock_target_contract.deploy(@calldata).unwrap(); let (root, valid_until, metadata, metadata_proof, signatures, ops, ops_proof) = set_root_args(