From c348f32ad7ec91f5ba3b1bd1b7747a0a222219a2 Mon Sep 17 00:00:00 2001 From: Vladislav Volosnikov Date: Wed, 18 Dec 2024 15:11:04 +0100 Subject: [PATCH] Update tests --- core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs | 5 ++++- core/lib/test_contracts/contracts/mock-evm/mock-evm.sol | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs b/core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs index 322680b80b64..ee139d941639 100644 --- a/core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs +++ b/core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs @@ -63,7 +63,10 @@ impl EvmDeployTracer { return; } - match ethabi::decode(&[ethabi::ParamType::Bytes], data) { + match ethabi::decode( + &[ethabi::ParamType::Uint(256), ethabi::ParamType::Bytes], + data, + ) { Ok(decoded) => { // `unwrap`s should be safe since the function signature is checked above. let mut decoded_iter = decoded.into_iter(); diff --git a/core/lib/test_contracts/contracts/mock-evm/mock-evm.sol b/core/lib/test_contracts/contracts/mock-evm/mock-evm.sol index 3a7ee40db228..61cd483a5f7d 100644 --- a/core/lib/test_contracts/contracts/mock-evm/mock-evm.sol +++ b/core/lib/test_contracts/contracts/mock-evm/mock-evm.sol @@ -38,7 +38,7 @@ contract MockKnownCodeStorage { evmBytecodeHash = _bytecodeHash; } - function publishEVMBytecode(bytes calldata _bytecode) external { + function publishEVMBytecode(uint256 _bytecodeLen, bytes calldata _bytecode) external { bytes32 hash = evmBytecodeHash; require(hash != bytes32(0), "EVM bytecode hash not set"); @@ -85,7 +85,7 @@ contract MockContractDeployer { bytes calldata _input ) external payable returns (address) { KNOWN_CODE_STORAGE_CONTRACT.setEVMBytecodeHash(_salt); - KNOWN_CODE_STORAGE_CONTRACT.publishEVMBytecode(_input); + KNOWN_CODE_STORAGE_CONTRACT.publishEVMBytecode(_input.length, _input); address newAddress = address(uint160(msg.sender) + 1); ACCOUNT_CODE_STORAGE_CONTRACT.storeAccountConstructedCodeHash(newAddress, _salt); return newAddress; @@ -101,7 +101,7 @@ contract MockContractDeployer { bytes calldata _input ) external payable returns (address newAddress) { KNOWN_CODE_STORAGE_CONTRACT.setEVMBytecodeHash(_bytecodeHash); - KNOWN_CODE_STORAGE_CONTRACT.publishEVMBytecode(_input); + KNOWN_CODE_STORAGE_CONTRACT.publishEVMBytecode(_input.length, _input); bytes32 hash = keccak256( bytes.concat(CREATE2_PREFIX, bytes32(uint256(uint160(msg.sender))), _salt, _bytecodeHash)