diff --git a/core/lib/multivm/src/versions/testonly/account_validation_rules.rs b/core/lib/multivm/src/versions/testonly/account_validation_rules.rs index 5d2a4f835b5..5fe94a4ffba 100644 --- a/core/lib/multivm/src/versions/testonly/account_validation_rules.rs +++ b/core/lib/multivm/src/versions/testonly/account_validation_rules.rs @@ -1,14 +1,14 @@ use assert_matches::assert_matches; -use ethabi::Token; use zksync_types::{ - fee::Fee, l2::L2Tx, transaction_request::TransactionRequest, Address, Eip712Domain, Execute, - L2ChainId, U256, + fee::Fee, l2::L2Tx, transaction_request::TransactionRequest, AccountTreeId, Address, + Eip712Domain, L2ChainId, StorageKey, U256, }; -use zksync_vm_interface::{tracer::ViolatedValidationRule, InspectExecutionMode, VmInterfaceExt}; +use zksync_utils::u256_to_h256; +use zksync_vm_interface::tracer::ViolatedValidationRule; use super::{ - read_validation_test_contract, tester::VmTesterBuilder, ContractToDeploy, TestedVm, - TestedVmForValidation, + get_empty_storage, read_validation_test_contract, tester::VmTesterBuilder, ContractToDeploy, + TestedVm, TestedVmForValidation, }; use crate::interface::TxExecutionMode; @@ -40,35 +40,25 @@ fn test_rule(rule: u32) -> Option(); - let mut private_account = vm.rich_accounts[0].clone(); - - // Set the type of misbehaviour of the AA contract - let function = contract.function("setTypeOfRuleBreak").unwrap(); - let transaction = private_account.get_l2_tx_for_execute( - Execute { - contract_address: Some(aa_address), - calldata: function.encode_input(&[Token::Uint(rule.into())]).unwrap(), - value: U256::zero(), - factory_deps: vec![], - }, - None, - ); - vm.vm.push_transaction(transaction); - assert!(!vm - .vm - .execute(InspectExecutionMode::OneTx) - .result - .is_failed()); + let private_account = vm.rich_accounts[0].clone(); // Use account abstraction let chain_id: u32 = 270; diff --git a/core/lib/multivm/src/versions/testonly/mod.rs b/core/lib/multivm/src/versions/testonly/mod.rs index b46d687c461..df3e8701a4a 100644 --- a/core/lib/multivm/src/versions/testonly/mod.rs +++ b/core/lib/multivm/src/versions/testonly/mod.rs @@ -131,9 +131,9 @@ pub(crate) fn read_simple_transfer_contract() -> Vec { ) } -pub(crate) fn read_validation_test_contract() -> (Vec, Contract) { +pub(crate) fn read_validation_test_contract() -> Vec { let path = "etc/contracts-test-data/artifacts-zk/contracts/custom-account/validation-rule-breaker.sol/ValidationRuleBreaker.json"; - (read_bytecode(path), load_contract(path)) + read_bytecode(path) } pub(crate) fn get_bootloader(test: &str) -> SystemContractCode {