From 71f6456b613692405c713ef12052dead435410dd Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Wed, 12 Jun 2024 18:15:06 +0300 Subject: [PATCH] Fixes for hardhat tests. --- contracts/config/networks.json | 4 +--- .../messenger/layer1/001_deploy_cross_chain_messenger.ts | 2 ++ contracts/test/bridge-test.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/config/networks.json b/contracts/config/networks.json index 631a89a62a..889a53d724 100644 --- a/contracts/config/networks.json +++ b/contracts/config/networks.json @@ -1,6 +1,6 @@ { "localGeth": { - "url": "http://127.0.0.1:28000", + "url": "http://127.0.0.1:17000", "deploy": [ "deployment_scripts/core/layer1/", "deployment_scripts/testnet/layer1/", @@ -19,8 +19,6 @@ "layer1" : "localGeth" }, "deploy": [ - "deployment_scripts/core/", - "deployment_scripts/funding/layer1", "deployment_scripts/messenger/layer1", "deployment_scripts/messenger/layer2", "deployment_scripts/bridge/", diff --git a/contracts/deployment_scripts/messenger/layer1/001_deploy_cross_chain_messenger.ts b/contracts/deployment_scripts/messenger/layer1/001_deploy_cross_chain_messenger.ts index 3e4f5d85b8..5a742677e9 100644 --- a/contracts/deployment_scripts/messenger/layer1/001_deploy_cross_chain_messenger.ts +++ b/contracts/deployment_scripts/messenger/layer1/001_deploy_cross_chain_messenger.ts @@ -34,6 +34,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } }); + + console.log(`Management Contract address ${mgmtContractAddress}`); // get management contract and write the cross chain messenger address to it const mgmtContract = (await hre.ethers.getContractFactory('ManagementContract')).attach(mgmtContractAddress) const tx = await mgmtContract.getFunction("SetImportantContractAddress").populateTransaction("L1CrossChainMessenger", crossChainDeployment.address); diff --git a/contracts/test/bridge-test.ts b/contracts/test/bridge-test.ts index 26f05a919f..2b8279fdc1 100644 --- a/contracts/test/bridge-test.ts +++ b/contracts/test/bridge-test.ts @@ -79,7 +79,7 @@ describe("Bridge", function () { const eventSignature = "LogMessagePublished(address,uint64,uint32,uint32,bytes,uint8)"; const topic = ethers.id(eventSignature) - let eventIface = new ethers.Interface([ `event ${eventSignature}`]); + let eventIface = new ethers.Interface([ `event LogMessagePublished(address indexed,uint64,uint32,uint32,bytes,uint8)`]); const receipt = (await tx.wait())!!; @@ -93,10 +93,10 @@ describe("Bridge", function () { const promises = events.map(async (event) => { const decodedEvent = eventIface.parseLog({ - topics: event!.topics!.map((v)=>v), + topics: event!.topics!, data: event!.data })!!; - + const xchainMessage = { sender: decodedEvent.args[0], sequence: decodedEvent.args[1], @@ -283,7 +283,7 @@ describe("Bridge", function () { await expect(event).to.not.be.undefined; - let eventIface = new ethers.Interface([ `event ${eventSignature}`]); + let eventIface = new ethers.Interface([ `event LogMessagePublished(address indexed,uint64,uint32,uint32,bytes,uint8)`]); const decodedEvent = eventIface.parseLog({ topics: event!.topics!.map((v)=>v),