Commit eefbf2ee authored by smartcontracts's avatar smartcontracts Committed by GitHub

maint(ct): clean up BondManager tests (#2474)

Cleans up BondManager tests using same techniques as previous test
cleanup PRs.
parent 1338135c
/* External Imports */
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import { Signer, Contract } from 'ethers' import { Contract } from 'ethers'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
/* Internal Imports */
import { expect } from '../../../setup' import { expect } from '../../../setup'
import { makeAddressManager } from '../../../helpers' import { deploy } from '../../../helpers'
describe('BondManager', () => { describe('BondManager', () => {
let sequencer: Signer let sequencer: SignerWithAddress
let nonSequencer: Signer let nonSequencer: SignerWithAddress
before(async () => { before(async () => {
;[sequencer, nonSequencer] = await ethers.getSigners() ;[sequencer, nonSequencer] = await ethers.getSigners()
}) })
let AddressManager: Contract let AddressManager: Contract
before(async () => {
AddressManager = await makeAddressManager()
})
let BondManager: Contract let BondManager: Contract
before(async () => { beforeEach(async () => {
BondManager = await ( AddressManager = await deploy('Lib_AddressManager')
await ethers.getContractFactory('BondManager')
).deploy(AddressManager.address) BondManager = await deploy('BondManager', {
args: [AddressManager.address],
})
AddressManager.setAddress('OVM_Proposer', await sequencer.getAddress()) AddressManager.setAddress('OVM_Proposer', sequencer.address)
}) })
describe('isCollateralized', () => { describe('isCollateralized', () => {
it('should return true for OVM_Proposer', async () => { it('should return true for OVM_Proposer', async () => {
expect( expect(await BondManager.isCollateralized(sequencer.address)).to.equal(
await BondManager.isCollateralized(await sequencer.getAddress()) true
).to.equal(true) )
}) })
it('should return false for non-sequencer', async () => { it('should return false for non-sequencer', async () => {
expect( expect(await BondManager.isCollateralized(nonSequencer.address)).to.equal(
await BondManager.isCollateralized(await nonSequencer.getAddress()) false
).to.equal(false) )
}) })
}) })
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment