diff --git a/e2e-tests/test/hardhat-apis.test.ts b/e2e-tests/test/hardhat-apis.test.ts index b39d635a..9ec6d6dd 100644 --- a/e2e-tests/test/hardhat-apis.test.ts +++ b/e2e-tests/test/hardhat-apis.test.ts @@ -64,8 +64,7 @@ describe("hardhat_mine", function () { }); }); -// TODO: Run this test once eth_sendTransaction has been implemented or when different tests have been added -xdescribe("hardhat_impersonateAccount & hardhat_stopImpersonatingAccount", function () { +describe("hardhat_impersonateAccount & hardhat_stopImpersonatingAccount", function () { it("Should allow transfers of funds without knowing the Private Key", async function () { // Arrange const userWallet = Wallet.createRandom().connect(provider); @@ -84,8 +83,8 @@ xdescribe("hardhat_impersonateAccount & hardhat_stopImpersonatingAccount", funct await recieptTx.wait(); // Assert - expect(await userWallet.getBalance()).to.equal(ethers.utils.parseEther("0.42")); - expect(await provider.getBalance(RichAccounts[0].Account)).to.equal(beforeBalance.sub(0.42)); + expect((await userWallet.getBalance()).eq(ethers.utils.parseEther("0.42"))).to.true; + expect((await provider.getBalance(RichAccounts[0].Account)).eq(beforeBalance.sub(ethers.utils.parseEther("0.42")))).to.true; }); }); diff --git a/e2e-tests/test/main.test.ts b/e2e-tests/test/main.test.ts index 0aaf0a12..a5739dad 100644 --- a/e2e-tests/test/main.test.ts +++ b/e2e-tests/test/main.test.ts @@ -62,7 +62,7 @@ describe("Greeter Smart Contract", function () { // Validate log is created expect(receipt.logs.length).to.greaterThanOrEqual(1); - const setGreetingLog = receipt.logs[1]; + const setGreetingLog = receipt.logs[0]; expect(setGreetingLog.address).to.equal(greeter.address); const eventInterface = new ethers.utils.Interface(["event LogString(string value)"]); @@ -79,7 +79,7 @@ describe("Greeter Smart Contract", function () { let receipt: TransactionReceipt = await setGreetingTx.wait(); // Create filter - const topic = receipt.logs[1].topics[0]; + const topic = receipt.logs[0].topics[0]; const filterId = await provider.send("eth_newFilter", [ { fromBlock: "earliest", diff --git a/e2e-tests/test/zks-apis.test.ts b/e2e-tests/test/zks-apis.test.ts index 55580123..a27e04dd 100644 --- a/e2e-tests/test/zks-apis.test.ts +++ b/e2e-tests/test/zks-apis.test.ts @@ -31,7 +31,7 @@ describe("zks_estimateFee", function () { const response: Fee = await provider.send("zks_estimateFee", [transaction]); // Assert - expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("732250"), "Unexpected gas_limit"); + expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("621166"), "Unexpected gas_limit"); expect(ethers.BigNumber.from(response.gas_per_pubdata_limit)).to.eql( ethers.BigNumber.from("4080"), "Unexpected gas_per_pubdata_limit" diff --git a/src/node/in_memory.rs b/src/node/in_memory.rs index 7389e9af..e7f21f30 100644 --- a/src/node/in_memory.rs +++ b/src/node/in_memory.rs @@ -1722,7 +1722,9 @@ mod tests { use zksync_types::utils::deployed_address_create; use super::*; - use crate::{http_fork_source::HttpForkSource, node::InMemoryNode, testing}; + use crate::{ + http_fork_source::HttpForkSource, node::InMemoryNode, system_contracts::Options, testing, + }; #[tokio::test] async fn test_run_l2_tx_validates_tx_gas_limit_too_high() { @@ -1842,7 +1844,7 @@ mod tests { None, None, InMemoryNodeConfig { - system_contracts_options: Option::BuiltInWithoutSecurity, + system_contracts_options: Options::BuiltInWithoutSecurity, ..Default::default() }, ); diff --git a/src/system_contracts.rs b/src/system_contracts.rs index fbaae46d..b1409727 100644 --- a/src/system_contracts.rs +++ b/src/system_contracts.rs @@ -105,11 +105,9 @@ fn bsc_load_with_bootloader( include_bytes!("deps/contracts/DefaultAccount.json"), ), Options::Local => read_sys_contract_bytecode("", "DefaultAccount", ContractLanguage::Sol), - // TODO: restore Options::BuiltInWithoutSecurity => bytecode_from_slice( "DefaultAccountNoSecurity", - // include_bytes!("deps/contracts/DefaultAccountNoSecurity.json"), - include_bytes!("deps/contracts/DefaultAccount.json"), + include_bytes!("deps/contracts/DefaultAccountNoSecurity.json"), ), };