diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bcc456eb..b86f9f432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ERC2981 (NFT Royalty Standard) component (#1091) +### Changed + +- Bump snforge to v0.27.0 (#1107) + ### Changed (Breaking) - Changed ABI suffix to Trait in dual case account and eth account modules (#1096). diff --git a/Scarb.lock b/Scarb.lock index 0fa419a96..3e044ff3f 100644 --- a/Scarb.lock +++ b/Scarb.lock @@ -131,5 +131,5 @@ dependencies = [ [[package]] name = "snforge_std" -version = "0.26.0" -source = "git+https://github.com/foundry-rs/starknet-foundry.git?tag=v0.26.0#50eb589db65e113efe4f09241feb59b574228c7e" +version = "0.27.0" +source = "git+https://github.com/foundry-rs/starknet-foundry.git?tag=v0.27.0#2d99b7c00678ef0363881ee0273550c44a9263de" diff --git a/Scarb.toml b/Scarb.toml index 723538b4c..414893774 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -39,7 +39,7 @@ keywords = [ [workspace.dependencies] starknet = "2.7.0" -snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.26.0" } +snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.27.0" } [dependencies] starknet.workspace = true diff --git a/packages/account/src/tests/test_account.cairo b/packages/account/src/tests/test_account.cairo index d71acc1f0..f2bf99c7b 100644 --- a/packages/account/src/tests/test_account.cairo +++ b/packages/account/src/tests/test_account.cairo @@ -21,7 +21,8 @@ use openzeppelin_testing::constants::{ use openzeppelin_testing::signing::StarkKeyPair; use openzeppelin_utils::selectors; use snforge_std::{ - cheat_signature_global, cheat_transaction_version_global, cheat_transaction_hash_global + start_cheat_signature_global, start_cheat_transaction_version_global, + start_cheat_transaction_hash_global }; use snforge_std::{spy_events, declare, test_address, start_cheat_caller_address}; use starknet::account::Call; @@ -54,9 +55,9 @@ fn setup_dispatcher( let address = utils::deploy(contract_class, calldata); let dispatcher = AccountABIDispatcher { contract_address: address }; - cheat_signature_global(array![data.r, data.s].span()); - cheat_transaction_hash_global(data.tx_hash); - cheat_transaction_version_global(MIN_TRANSACTION_VERSION); + start_cheat_signature_global(array![data.r, data.s].span()); + start_cheat_transaction_hash_global(data.tx_hash); + start_cheat_transaction_version_global(MIN_TRANSACTION_VERSION); start_cheat_caller_address(address, ZERO()); (dispatcher, contract_class.class_hash.into()) @@ -133,7 +134,7 @@ fn test_validate_deploy_invalid_signature_length() { let key_pair = KEY_PAIR(); let (account, class_hash) = setup_dispatcher(key_pair, SIGNED_TX_DATA(key_pair)); let invalid_len_sig = array!['INVALID_LEN_SIG']; - cheat_signature_global(invalid_len_sig.span()); + start_cheat_signature_global(invalid_len_sig.span()); account.__validate_deploy__(class_hash, SALT, key_pair.public_key); } @@ -145,7 +146,7 @@ fn test_validate_deploy_empty_signature() { let (account, class_hash) = setup_dispatcher(key_pair, SIGNED_TX_DATA(key_pair)); let empty_sig = array![]; - cheat_signature_global(empty_sig.span()); + start_cheat_signature_global(empty_sig.span()); account.__validate_deploy__(class_hash, SALT, key_pair.public_key); } @@ -178,7 +179,7 @@ fn test_validate_declare_invalid_signature_length() { let key_pair = KEY_PAIR(); let (account, class_hash) = setup_dispatcher(key_pair, SIGNED_TX_DATA(key_pair)); let invalid_len_sig = array!['INVALID_LEN_SIG']; - cheat_signature_global(invalid_len_sig.span()); + start_cheat_signature_global(invalid_len_sig.span()); account.__validate_declare__(class_hash); } @@ -189,7 +190,7 @@ fn test_validate_declare_empty_signature() { let key_pair = KEY_PAIR(); let (account, class_hash) = setup_dispatcher(key_pair, SIGNED_TX_DATA(key_pair)); let empty_sig = array![]; - cheat_signature_global(empty_sig.span()); + start_cheat_signature_global(empty_sig.span()); account.__validate_declare__(class_hash); } @@ -215,7 +216,7 @@ fn test_execute_with_version(version: Option) { // Handle version for test if let Option::Some(version) = version { - cheat_transaction_version_global(version); + start_cheat_transaction_version_global(version); } // Execute diff --git a/packages/account/src/tests/test_eth_account.cairo b/packages/account/src/tests/test_eth_account.cairo index 093c1b49a..5ec61aabc 100644 --- a/packages/account/src/tests/test_eth_account.cairo +++ b/packages/account/src/tests/test_eth_account.cairo @@ -24,8 +24,8 @@ use openzeppelin_testing::signing::Secp256k1KeyPair; use openzeppelin_utils::selectors; use openzeppelin_utils::serde::SerializedAppend; use snforge_std::{ - cheat_signature_global, cheat_transaction_version_global, cheat_transaction_hash_global, - start_cheat_caller_address + start_cheat_signature_global, start_cheat_transaction_version_global, + start_cheat_transaction_hash_global, start_cheat_caller_address }; use snforge_std::{spy_events, test_address}; use starknet::account::Call; @@ -61,9 +61,9 @@ fn setup_dispatcher( let mut serialized_signature = array![]; data.signature.serialize(ref serialized_signature); - cheat_signature_global(serialized_signature.span()); - cheat_transaction_hash_global(data.tx_hash); - cheat_transaction_version_global(MIN_TRANSACTION_VERSION); + start_cheat_signature_global(serialized_signature.span()); + start_cheat_transaction_hash_global(data.tx_hash); + start_cheat_transaction_version_global(MIN_TRANSACTION_VERSION); start_cheat_caller_address(contract_address, ZERO()); (dispatcher, contract_class.class_hash.into()) @@ -156,7 +156,7 @@ fn test_validate_deploy_invalid_signature_length() { let (account, class_hash) = setup_dispatcher(key_pair, SIGNED_TX_DATA(key_pair)); let invalid_len_sig = array!['INVALID_LEN']; - cheat_signature_global(invalid_len_sig.span()); + start_cheat_signature_global(invalid_len_sig.span()); account.__validate_deploy__(class_hash, SALT, key_pair.public_key); } @@ -168,7 +168,7 @@ fn test_validate_deploy_empty_signature() { let (account, class_hash) = setup_dispatcher(key_pair, SIGNED_TX_DATA(key_pair)); let empty_sig = array![]; - cheat_signature_global(empty_sig.span()); + start_cheat_signature_global(empty_sig.span()); account.__validate_deploy__(class_hash, SALT, key_pair.public_key); } @@ -202,7 +202,7 @@ fn test_validate_declare_invalid_signature_length() { let (account, class_hash) = setup_dispatcher(key_pair, SIGNED_TX_DATA(key_pair)); let invalid_len_sig = array!['INVALID_LEN']; - cheat_signature_global(invalid_len_sig.span()); + start_cheat_signature_global(invalid_len_sig.span()); account.__validate_declare__(class_hash); } @@ -214,7 +214,7 @@ fn test_validate_declare_empty_signature() { let (account, class_hash) = setup_dispatcher(key_pair, SIGNED_TX_DATA(key_pair)); let empty_sig = array![]; - cheat_signature_global(empty_sig.span()); + start_cheat_signature_global(empty_sig.span()); account.__validate_declare__(class_hash); } @@ -241,7 +241,7 @@ fn test_execute_with_version(version: Option) { // Handle version for test if let Option::Some(version) = version { - cheat_transaction_version_global(version); + start_cheat_transaction_version_global(version); } // Execute diff --git a/packages/governance/src/tests/test_timelock.cairo b/packages/governance/src/tests/test_timelock.cairo index 5b848a5b4..533c8a88d 100644 --- a/packages/governance/src/tests/test_timelock.cairo +++ b/packages/governance/src/tests/test_timelock.cairo @@ -32,7 +32,7 @@ use openzeppelin_utils::serde::SerializedAppend; use snforge_std::EventSpy; use snforge_std::{ spy_events, test_address, start_cheat_caller_address, cheat_caller_address, - cheat_block_timestamp_global, CheatSpan + start_cheat_block_timestamp_global, CheatSpan }; use starknet::ContractAddress; use starknet::account::Call; @@ -468,7 +468,7 @@ fn test_execute_when_scheduled() { assert_operation_state(timelock, OperationState::Waiting, target_id); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id); // Check initial target state @@ -503,7 +503,7 @@ fn test_execute_early() { // Fast-forward let early_time = delay - 1; - cheat_block_timestamp_global(early_time); + start_cheat_block_timestamp_global(early_time); // Execute start_cheat_caller_address(timelock.contract_address, EXECUTOR()); @@ -525,7 +525,7 @@ fn test_execute_unauthorized() { timelock.schedule(call, predecessor, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); // Execute start_cheat_caller_address(timelock.contract_address, OTHER()); @@ -549,7 +549,7 @@ fn test_execute_failing_tx() { timelock.schedule(call, predecessor, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id); // Execute @@ -575,7 +575,7 @@ fn test_execute_bad_selector() { timelock.schedule(call, predecessor, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id); // Execute @@ -601,7 +601,7 @@ fn test_execute_reentrant_call() { timelock.schedule(reentrant_call, predecessor, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); // Grant executor role to attacker start_cheat_caller_address(timelock.contract_address, ADMIN()); @@ -637,7 +637,7 @@ fn test_execute_before_dependency() { timelock.schedule(call_2, predecessor_2, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id_1); assert_operation_state(timelock, OperationState::Ready, target_id_2); @@ -685,7 +685,7 @@ fn test_execute_after_dependency() { ); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id_1); assert_operation_state(timelock, OperationState::Ready, target_id_2); @@ -745,7 +745,7 @@ fn test_execute_batch_when_scheduled() { ); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id); // Check initial target state @@ -779,7 +779,7 @@ fn test_execute_batch_early() { // Fast-forward let early_time = delay - 1; - cheat_block_timestamp_global(early_time); + start_cheat_block_timestamp_global(early_time); // Execute start_cheat_caller_address(timelock.contract_address, EXECUTOR()); @@ -801,7 +801,7 @@ fn test_execute_batch_unauthorized() { timelock.schedule_batch(calls, predecessor, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); // Execute start_cheat_caller_address(timelock.contract_address, OTHER()); @@ -829,7 +829,7 @@ fn test_execute_batch_reentrant_call() { timelock.schedule_batch(calls, predecessor, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); // Grant executor role to attacker start_cheat_caller_address(timelock.contract_address, ADMIN()); @@ -857,7 +857,7 @@ fn test_execute_batch_partial_execution() { timelock.schedule_batch(calls, predecessor, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); // Execute start_cheat_caller_address(timelock.contract_address, EXECUTOR()); @@ -888,7 +888,7 @@ fn test_execute_batch_before_dependency() { timelock.schedule_batch(calls_2, predecessor_2, salt, delay); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); // Execute start_cheat_caller_address(timelock.contract_address, EXECUTOR()); @@ -934,7 +934,7 @@ fn test_execute_batch_after_dependency() { ); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id_1); assert_operation_state(timelock, OperationState::Ready, target_id_2); @@ -980,7 +980,7 @@ fn cancel_from_canceller(operation_state: OperationState) { if operation_state == OperationState::Ready { // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id); } @@ -1021,7 +1021,7 @@ fn test_cancel_when_done() { assert_operation_state(timelock, OperationState::Waiting, target_id); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); assert_operation_state(timelock, OperationState::Ready, target_id); // Execute @@ -1104,7 +1104,7 @@ fn test_update_delay_scheduled() { ); // Fast-forward - cheat_block_timestamp_global(delay); + start_cheat_block_timestamp_global(delay); // Execute cheat_caller_address(timelock.contract_address, EXECUTOR(), CheatSpan::TargetCalls(1)); @@ -1326,7 +1326,7 @@ fn test__before_call() { state.TimelockController_timestamps.write(target_id, target_time); // Fast-forward - cheat_block_timestamp_global(target_time); + start_cheat_block_timestamp_global(target_time); state._before_call(target_id, predecessor); } @@ -1361,7 +1361,7 @@ fn test__before_call_insufficient_time() { state.TimelockController_timestamps.write(target_id, target_time); // Fast-forward - cheat_block_timestamp_global(target_time - 1); + start_cheat_block_timestamp_global(target_time - 1); state._before_call(target_id, predecessor); } @@ -1380,7 +1380,7 @@ fn test__before_call_when_already_done() { state.TimelockController_timestamps.write(target_id, done_time); // Fast-forward - cheat_block_timestamp_global(done_time); + start_cheat_block_timestamp_global(done_time); state._before_call(target_id, predecessor); } @@ -1402,7 +1402,7 @@ fn test__before_call_with_predecessor_done() { state.TimelockController_timestamps.write(target_id, target_time); // Fast-forward - cheat_block_timestamp_global(target_time); + start_cheat_block_timestamp_global(target_time); state._before_call(target_id, predecessor_id); } @@ -1425,7 +1425,7 @@ fn test__before_call_with_predecessor_not_done() { state.TimelockController_timestamps.write(target_id, target_time); // Fast-forward - cheat_block_timestamp_global(target_time); + start_cheat_block_timestamp_global(target_time); state._before_call(target_id, predecessor_id); } @@ -1446,7 +1446,7 @@ fn test__after_call() { state.TimelockController_timestamps.write(target_id, target_time); // Fast-forward - cheat_block_timestamp_global(target_time); + start_cheat_block_timestamp_global(target_time); state._after_call(target_id); @@ -1484,7 +1484,7 @@ fn test__after_call_insufficient_time() { state.TimelockController_timestamps.write(target_id, target_time); // Fast-forward - cheat_block_timestamp_global(target_time - 1); + start_cheat_block_timestamp_global(target_time - 1); state._after_call(target_id); } @@ -1502,7 +1502,7 @@ fn test__after_call_already_done() { state.TimelockController_timestamps.write(target_id, done_time); // Fast-forward - cheat_block_timestamp_global(done_time); + start_cheat_block_timestamp_global(done_time); state._after_call(target_id); } diff --git a/packages/presets/src/tests/test_account.cairo b/packages/presets/src/tests/test_account.cairo index 2682ed3ed..75b1ce914 100644 --- a/packages/presets/src/tests/test_account.cairo +++ b/packages/presets/src/tests/test_account.cairo @@ -24,7 +24,8 @@ use openzeppelin_token::erc20::interface::IERC20DispatcherTrait; use openzeppelin_utils::selectors; use openzeppelin_utils::serde::SerializedAppend; use snforge_std::{ - cheat_signature_global, cheat_transaction_version_global, cheat_transaction_hash_global + start_cheat_signature_global, start_cheat_transaction_version_global, + start_cheat_transaction_hash_global }; use snforge_std::{spy_events, test_address, start_cheat_caller_address}; use starknet::account::Call; @@ -54,9 +55,9 @@ fn setup_dispatcher_with_data( let contract_address = utils::deploy(account_class, calldata); let account_dispatcher = AccountUpgradeableABIDispatcher { contract_address }; - cheat_signature_global(array![data.r, data.s].span()); - cheat_transaction_hash_global(data.tx_hash); - cheat_transaction_version_global(MIN_TRANSACTION_VERSION); + start_cheat_signature_global(array![data.r, data.s].span()); + start_cheat_transaction_hash_global(data.tx_hash); + start_cheat_transaction_version_global(MIN_TRANSACTION_VERSION); start_cheat_caller_address(contract_address, ZERO()); (account_dispatcher, account_class.class_hash.into()) @@ -272,7 +273,7 @@ fn test_validate_deploy_invalid_signature_length() { let (account, class_hash) = setup_dispatcher_with_data(key_pair, SIGNED_TX_DATA(key_pair)); let invalid_len_sig = array!['INVALID_LEN']; - cheat_signature_global(invalid_len_sig.span()); + start_cheat_signature_global(invalid_len_sig.span()); account.__validate_deploy__(class_hash, SALT, key_pair.public_key); } @@ -284,7 +285,7 @@ fn test_validate_deploy_empty_signature() { let (account, class_hash) = setup_dispatcher_with_data(key_pair, SIGNED_TX_DATA(key_pair)); let empty_sig = array![]; - cheat_signature_global(empty_sig.span()); + start_cheat_signature_global(empty_sig.span()); account.__validate_deploy__(class_hash, SALT, key_pair.public_key); } @@ -319,7 +320,7 @@ fn test_validate_declare_invalid_signature_length() { let (account, class_hash) = setup_dispatcher_with_data(key_pair, SIGNED_TX_DATA(key_pair)); let invalid_len_sig = array!['INVALID_LEN']; - cheat_signature_global(invalid_len_sig.span()); + start_cheat_signature_global(invalid_len_sig.span()); account.__validate_declare__(class_hash); } @@ -331,7 +332,7 @@ fn test_validate_declare_empty_signature() { let (account, class_hash) = setup_dispatcher_with_data(key_pair, SIGNED_TX_DATA(key_pair)); let empty_sig = array![]; - cheat_signature_global(empty_sig.span()); + start_cheat_signature_global(empty_sig.span()); account.__validate_declare__(class_hash); } @@ -357,7 +358,7 @@ fn test_execute_with_version(version: Option) { // Handle version for test if let Option::Some(version) = version { - cheat_transaction_version_global(version) + start_cheat_transaction_version_global(version) } // Execute diff --git a/packages/presets/src/tests/test_eth_account.cairo b/packages/presets/src/tests/test_eth_account.cairo index 9a07d87fd..36bcbdcdf 100644 --- a/packages/presets/src/tests/test_eth_account.cairo +++ b/packages/presets/src/tests/test_eth_account.cairo @@ -24,8 +24,8 @@ use openzeppelin_token::erc20::interface::IERC20DispatcherTrait; use openzeppelin_utils::selectors; use openzeppelin_utils::serde::SerializedAppend; use snforge_std::{ - cheat_signature_global, cheat_transaction_version_global, cheat_transaction_hash_global, - start_cheat_caller_address + start_cheat_signature_global, start_cheat_transaction_version_global, + start_cheat_transaction_hash_global, start_cheat_caller_address }; use snforge_std::{spy_events, test_address}; use starknet::ClassHash; @@ -62,9 +62,9 @@ fn setup_dispatcher_with_data( let mut serialized_signature = array![]; data.signature.serialize(ref serialized_signature); - cheat_signature_global(serialized_signature.span()); - cheat_transaction_hash_global(data.tx_hash); - cheat_transaction_version_global(MIN_TRANSACTION_VERSION); + start_cheat_signature_global(serialized_signature.span()); + start_cheat_transaction_hash_global(data.tx_hash); + start_cheat_transaction_version_global(MIN_TRANSACTION_VERSION); start_cheat_caller_address(contract_address, ZERO()); (dispatcher, contract_class.class_hash.into()) @@ -256,7 +256,7 @@ fn test_validate_deploy_invalid_signature_length() { let (account, class_hash) = setup_dispatcher_with_data(key_pair, SIGNED_TX_DATA(key_pair)); let invalid_len_sig = array!['INVALID_LEN']; - cheat_signature_global(invalid_len_sig.span()); + start_cheat_signature_global(invalid_len_sig.span()); account.__validate_deploy__(class_hash, SALT, key_pair.public_key); } @@ -267,7 +267,7 @@ fn test_validate_deploy_empty_signature() { let (account, class_hash) = setup_dispatcher_with_data(key_pair, SIGNED_TX_DATA(key_pair)); let empty_sig = array![]; - cheat_signature_global(empty_sig.span()); + start_cheat_signature_global(empty_sig.span()); account.__validate_deploy__(class_hash, SALT, key_pair.public_key); } @@ -301,7 +301,7 @@ fn test_validate_declare_invalid_signature_length() { let (account, class_hash) = setup_dispatcher_with_data(key_pair, SIGNED_TX_DATA(key_pair)); let invalid_len_sig = array!['INVALID_LEN']; - cheat_signature_global(invalid_len_sig.span()); + start_cheat_signature_global(invalid_len_sig.span()); account.__validate_declare__(class_hash); } @@ -312,7 +312,7 @@ fn test_validate_declare_empty_signature() { let (account, class_hash) = setup_dispatcher_with_data(key_pair, SIGNED_TX_DATA(key_pair)); let empty_sig = array![]; - cheat_signature_global(empty_sig.span()); + start_cheat_signature_global(empty_sig.span()); account.__validate_declare__(class_hash); } @@ -334,7 +334,7 @@ fn test_execute_with_version(version: Option) { let calls = array![call]; if let Option::Some(version) = version { - cheat_transaction_version_global(version); + start_cheat_transaction_version_global(version); } let ret = account.__execute__(calls); diff --git a/packages/token/src/tests/erc20/test_erc20_votes.cairo b/packages/token/src/tests/erc20/test_erc20_votes.cairo index 53961b4a7..2eadecb74 100644 --- a/packages/token/src/tests/erc20/test_erc20_votes.cairo +++ b/packages/token/src/tests/erc20/test_erc20_votes.cairo @@ -17,8 +17,8 @@ use openzeppelin_utils::structs::checkpoint::{Checkpoint, TraceTrait}; use snforge_std::signature::KeyPairTrait; use snforge_std::signature::stark_curve::{StarkCurveKeyPairImpl, StarkCurveSignerImpl}; use snforge_std::{ - cheat_block_timestamp_global, start_cheat_caller_address, spy_events, cheat_chain_id_global, - test_address + start_cheat_block_timestamp_global, start_cheat_caller_address, spy_events, + start_cheat_chain_id_global, test_address }; use snforge_std::{EventSpy}; use starknet::ContractAddress; @@ -59,7 +59,7 @@ fn test__delegate_checkpoints_unordered_insertion() { let mut state = setup(); let mut trace = state.ERC20Votes_delegate_checkpoints.read(OWNER()); - cheat_block_timestamp_global('ts10'); + start_cheat_block_timestamp_global('ts10'); trace.push('ts2', 0x222); trace.push('ts1', 0x111); } @@ -70,7 +70,7 @@ fn test__total_checkpoints_unordered_insertion() { let mut state = setup(); let mut trace = state.ERC20Votes_total_checkpoints.read(); - cheat_block_timestamp_global('ts10'); + start_cheat_block_timestamp_global('ts10'); trace.push('ts2', 0x222); trace.push('ts1', 0x111); } @@ -94,7 +94,7 @@ fn test_get_past_votes() { let mut trace = state.ERC20Votes_delegate_checkpoints.read(OWNER()); // Future timestamp. - cheat_block_timestamp_global('ts10'); + start_cheat_block_timestamp_global('ts10'); trace.push('ts1', 0x111); trace.push('ts2', 0x222); trace.push('ts3', 0x333); @@ -118,7 +118,7 @@ fn test_get_past_votes_future_lookup() { let state = setup(); // Past timestamp. - cheat_block_timestamp_global('ts1'); + start_cheat_block_timestamp_global('ts1'); state.get_past_votes(OWNER(), 'ts2'); } @@ -128,7 +128,7 @@ fn test_get_past_total_supply() { let mut trace = state.ERC20Votes_total_checkpoints.read(); // Future timestamp. - cheat_block_timestamp_global('ts10'); + start_cheat_block_timestamp_global('ts10'); trace.push('ts1', 0x111); trace.push('ts2', 0x222); trace.push('ts3', 0x333); @@ -152,7 +152,7 @@ fn test_get_past_total_supply_future_lookup() { let state = setup(); // Past timestamp. - cheat_block_timestamp_global('ts1'); + start_cheat_block_timestamp_global('ts1'); state.get_past_total_supply('ts2'); } @@ -213,7 +213,7 @@ fn test_delegates() { #[test] fn test_delegate_by_sig_hash_generation() { - cheat_chain_id_global('SN_TEST'); + start_cheat_chain_id_global('SN_TEST'); let nonce = 0; let expiry = 'ts2'; @@ -240,8 +240,8 @@ fn test_delegate_by_sig_hash_generation() { #[test] fn test_delegate_by_sig() { - cheat_chain_id_global('SN_TEST'); - cheat_block_timestamp_global('ts1'); + start_cheat_chain_id_global('SN_TEST'); + start_cheat_block_timestamp_global('ts1'); let mut state = setup(); let contract_address = test_address(); @@ -268,7 +268,7 @@ fn test_delegate_by_sig() { #[test] #[should_panic(expected: ('Votes: expired signature',))] fn test_delegate_by_sig_past_expiry() { - cheat_block_timestamp_global('ts5'); + start_cheat_block_timestamp_global('ts5'); let mut state = setup(); let expiry = 'ts4';