This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
16 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,37 @@ | ||
const TBTCSystem = artifacts.require('TBTCSystem') | ||
const KeepRegistryStub = artifacts.require('KeepRegistryStub') | ||
const ECDSAKeepVendorStub = artifacts.require('ECDSAKeepVendorStub') | ||
|
||
contract('TBTCSystem', (accounts) => { | ||
let tbtcSystem | ||
let ecdsaKeepVendor | ||
|
||
before(async () => { | ||
ecdsaKeepVendor = await ECDSAKeepVendorStub.new() | ||
|
||
const keepRegistry = await KeepRegistryStub.new() | ||
await keepRegistry.setVendor(ecdsaKeepVendor.address) | ||
|
||
tbtcSystem = await TBTCSystem.deployed() | ||
await tbtcSystem.initialize(keepRegistry.address) | ||
}) | ||
|
||
describe('requestNewKeep()', async () => { | ||
it('sends caller as owner to open new keep', async () => { | ||
const expectedKeepOwner = accounts[2] | ||
|
||
await tbtcSystem.requestNewKeep(5, 10, { from: expectedKeepOwner }) | ||
const keepOwner = await ecdsaKeepVendor.keepOwner.call() | ||
|
||
assert.equal(expectedKeepOwner, keepOwner, 'incorrect keep owner address') | ||
}) | ||
|
||
it('returns keep address', async () => { | ||
const expectedKeepAddress = '0x0000000000000000000000000000000000000378' | ||
|
||
const result = await tbtcSystem.requestNewKeep.call(5, 10) | ||
|
||
assert.equal(expectedKeepAddress, result, 'incorrect keep address') | ||
}) | ||
}) | ||
}) |
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
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