add pauseDeposits

This commit is contained in:
Roman Storm 2019-08-01 01:41:22 -07:00
parent 9b14a22b0d
commit d91435dd00
9 changed files with 1642 additions and 5 deletions

View file

@ -111,6 +111,17 @@ contract('Mixer', accounts => {
logs[0].args.leafIndex.should.be.eq.BN(toBN(1))
})
it('should not deposit if disabled', async () => {
let commitment = 42;
(await mixer.isDepositsEnabled()).should.be.equal(true)
const err = await mixer.toggleDeposits({ from: accounts[1] }).should.be.rejected
err.reason.should.be.equal('unauthorized')
await mixer.toggleDeposits({ from: sender });
(await mixer.isDepositsEnabled()).should.be.equal(false)
let error = await mixer.deposit(commitment, { value, from: sender }).should.be.rejected
error.reason.should.be.equal('deposits disabled')
})
it('should throw if there is a such commitment', async () => {
const commitment = 42
await mixer.deposit(commitment, { value, from: sender }).should.be.fulfilled