From f3254636b6c0318dedb2d3dc85e505f6e239bb59 Mon Sep 17 00:00:00 2001 From: jeremy-then Date: Wed, 3 Jan 2024 01:51:10 -0400 Subject: [PATCH] Updating bridge before running receiveHeader test --- lib/tests/post_iris_call_receive_header.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tests/post_iris_call_receive_header.js b/lib/tests/post_iris_call_receive_header.js index ccc0e3d8..ecc1c41c 100644 --- a/lib/tests/post_iris_call_receive_header.js +++ b/lib/tests/post_iris_call_receive_header.js @@ -2,7 +2,7 @@ const expect = require('chai').expect; const { getRskTransactionHelper } = require('../rsk-tx-helper-provider'); const { getBtcClient } = require('../btc-client-provider'); const { getBridge, getLatestActiveForkName } = require('../precompiled-abi-forks-util'); -const { activateFork, sendTxWithCheck, getLatestForkName } = require('../rsk-utils'); +const { activateFork, sendTxWithCheck, getLatestForkName, waitAndUpdateBridge } = require('../rsk-utils'); const { ensure0x } = require('../utils'); let rskTxHelper; @@ -29,6 +29,9 @@ const execute = (description, getRskHost) => { it('should return 0 and increment BTC blockchain size when calling receiveHeader method', async () => { const cowAddress = await rskTxHelper.newAccountWithSeed('cow'); + + await waitAndUpdateBridge(rskTxHelper); + const blockHashes = await btcTxHelper.mine(); const blockHeader = await btcTxHelper.getBlockHeader(blockHashes[0], false); const blockchainInitialHeigth = await bridge.methods.getBtcBlockchainBestChainHeight().call(); @@ -46,7 +49,7 @@ const execute = (description, getRskHost) => { it('should return -1 when calling receiveHeader method consecutively', async () => { const blockHashes = await btcTxHelper.mine(); const blockHeader = await btcTxHelper.getBlockHeader(blockHashes[0], false); - const result = await bridge.methods.receiveHeader([ensure0x(blockHeader)]).call() + const result = await bridge.methods.receiveHeader(ensure0x(blockHeader)).call(); expect(result).to.be.equal('-1'); } );