This repository has been archived by the owner on May 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add retry method * Add retry method test
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright 2020 ChainSafe Systems | ||
* SPDX-License-Identifier: LGPL-3.0-only | ||
*/ | ||
const TruffleAssert = require('truffle-assertions'); | ||
const Ethers = require('ethers'); | ||
|
||
const Helpers = require('../helpers'); | ||
|
||
const BridgeContract = artifacts.require("Bridge"); | ||
|
||
// This test does NOT include all getter methods, just | ||
// getters that should work with only the constructor called | ||
contract('Bridge - [public]', async (accounts) => { | ||
const domainID = 1; | ||
|
||
const txHash = "0x59d881e01ca682130e550e3576b6de760951fb45b1d5dd81342132f57920bbfa"; | ||
|
||
let BridgeInstance; | ||
|
||
|
||
beforeEach(async () => { | ||
BridgeInstance = await BridgeContract.new(domainID); | ||
|
||
// set MPC address to unpause the Bridge | ||
await BridgeInstance.endKeygen(Helpers.mpcAddress); | ||
}); | ||
|
||
// Testing public methods | ||
|
||
it('Should successfully emit Retry event', async () => { | ||
const eventTx = await BridgeInstance.retry(txHash); | ||
|
||
TruffleAssert.eventEmitted(eventTx, 'Retry', (event) => { | ||
return event.txHash === txHash | ||
}); | ||
}); | ||
}); |