Update toString() checks
Check BN using chai instead of toString() equivalencies
@@ -194,7 +194,7 @@ contract('DepositRedemption', (accounts) => {
const events = await tbtcToken.getPastEvents('Transfer', { fromBlock: block.number, toBlock: 'latest' })
expect(events[0].returnValues.from).to.equal(accounts[0])
expect(events[0].returnValues.to).to.equal(testInstance.address)
- expect(events[0].returnValues.value.toString()).to.equal(signerFee.toString())
+ expect(events[0].returnValues.value).to.eq.BN(signerFee)
})
it('burns 1 TBTC if deposit is at-term and Deposit Token owner is Vending Machine', async () => {
@@ -210,7 +210,7 @@ contract('DepositRedemption', (accounts) => {
assert.equal(events.length, 1)
expect(events[0].returnValues.from).to.equal(accounts[0])
expect(events[0].returnValues.to).to.equal(utils.address0)
- expect(events[0].returnValues.value.toString()).to.equal(depositValue.toString())
+ expect(events[0].returnValues.value).to.eq.BN(depositValue)
})
it('sends 1 TBTC to Deposit Token owner if deposit is at-term and fee is escrowed', async () => {
@@ -227,7 +227,7 @@ contract('DepositRedemption', (accounts) => {
assert.equal(events.length, 1)
expect(events[0].returnValues.from).to.equal(accounts[0])
expect(events[0].returnValues.to).to.equal(accounts[1])
- expect(events[0].returnValues.value.toString()).to.equal(depositValue.toString())
+ expect(events[0].returnValues.value).to.eq.BN(depositValue)
})
it('escrows fee and sends correct TBTC if Deposit is at-term and fee is not escrowed', async () => {
@@ -243,10 +243,10 @@ contract('DepositRedemption', (accounts) => {
assert.equal(events.length, 2)
expect(events[0].returnValues.from).to.equal(accounts[0])
expect(events[0].returnValues.to).to.equal(testInstance.address)
- expect(events[0].returnValues.value.toString()).to.equal(signerFee.toString())
+ expect(events[0].returnValues.value).to.eq.BN(signerFee)
expect(events[1].returnValues.from).to.equal(accounts[0])
expect(events[1].returnValues.to).to.equal(accounts[1])
- expect(events[1].returnValues.value.toString()).to.equal(depositValue.sub(signerFee).toString())
+ expect(events[1].returnValues.value).to.eq.BN(depositValue.sub(signerFee))
})
})
@@ -317,7 +317,7 @@ contract('DepositRedemption', (accounts) => {
const event = events[0]
expect(event.returnValues.from).to.equal(accounts[0])
expect(event.returnValues.to).to.equal(testInstance.address)
- expect(event.returnValues.value.toString()).to.equal(signerFee.toString())
+ expect(event.returnValues.value).to.eq.BN(signerFee)
})
it('reverts if not in Active or Courtesy', async () => {
