diff --git a/lib/tests/2wp.js b/lib/tests/2wp.js index 51ee88c4..78a35725 100644 --- a/lib/tests/2wp.js +++ b/lib/tests/2wp.js @@ -117,6 +117,8 @@ const execute = (description, getRskHost) => { // Arrange + const initialBridgeBalance = Number(await rskTxHelper.getBalance(BRIDGE_ADDRESS)); + const initialBridgeUtxosBalance = await getBridgeUtxosBalance(rskTxHelper); const initialFederationAddressBalanceInSatoshis = await getBtcAddressBalanceInSatoshis(btcTxHelper, federationAddress); const senderRecipientInfo = await createSenderRecipientInfo(rskTxHelper, btcTxHelper); const initialSenderAddressBalanceInSatoshis = await getBtcAddressBalanceInSatoshis(btcTxHelper, senderRecipientInfo.btcSenderAddressInfo.address); @@ -153,6 +155,14 @@ const execute = (description, getRskHost) => { const finalRskRecipientBalance = Number(await rskTxHelper.getBalance(senderRecipientInfo.rskRecipientRskAddressInfo.address)); expect(finalRskRecipientBalance).to.be.equal(Number(satoshisToWeis(peginValueInSatoshis))); + // After the successful pegin, the Bridge balance should be reduced by the pegin value + const finalBridgeBalance = Number(await rskTxHelper.getBalance(BRIDGE_ADDRESS)); + expect(finalBridgeBalance).to.be.equal(initialBridgeBalance - satoshisToWeis(peginValueInSatoshis)); + + // After the successful pegin, the Bridge utxos sum should be incremented by the pegin value + const finalBridgeUtxosBalance = await getBridgeUtxosBalance(rskTxHelper); + expect(finalBridgeUtxosBalance).to.be.equal(initialBridgeUtxosBalance + peginValueInSatoshis); + }); });