-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update mockOVM_BondManager to be sequencer-only (#146)
* update function, add test * linting * more lint
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 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
46 changes: 46 additions & 0 deletions
46
packages/contracts/test/contracts/mockOVM/verification/mockOVM_BondManager.spec.ts
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,46 @@ | ||
import { expect } from '../../../setup' | ||
|
||
/* External Imports */ | ||
import { ethers } from '@nomiclabs/buidler' | ||
import { Signer, Contract } from 'ethers' | ||
|
||
/* Internal Imports */ | ||
import { makeAddressManager } from '../../../helpers' | ||
|
||
describe('mockOVM_BondManager', () => { | ||
let sequencer: Signer | ||
let nonSequencer: Signer | ||
before(async () => { | ||
;[sequencer, nonSequencer] = await ethers.getSigners() | ||
}) | ||
|
||
let AddressManager: Contract | ||
before(async () => { | ||
AddressManager = await makeAddressManager() | ||
}) | ||
|
||
let mockOVM_BondManager: Contract | ||
before(async () => { | ||
mockOVM_BondManager = await ( | ||
await ethers.getContractFactory('mockOVM_BondManager') | ||
).deploy(AddressManager.address) | ||
|
||
AddressManager.setAddress('OVM_Sequencer', await sequencer.getAddress()) | ||
}) | ||
|
||
describe('isCollateralized', () => { | ||
it('should return true for OVM_Sequencer', async () => { | ||
expect( | ||
await mockOVM_BondManager.isCollateralized(await sequencer.getAddress()) | ||
).to.equal(true) | ||
}) | ||
|
||
it('should return false for non-sequencer', async () => { | ||
expect( | ||
await mockOVM_BondManager.isCollateralized( | ||
await nonSequencer.getAddress() | ||
) | ||
).to.equal(false) | ||
}) | ||
}) | ||
}) |