AccessManager tests consolidation (#4655)
This commit is contained in:
@ -53,22 +53,19 @@ contract('AuthorityUtils', function (accounts) {
|
||||
describe('when authority replies with a delay', function () {
|
||||
beforeEach(async function () {
|
||||
this.authority = await AuthorityDelayMock.new();
|
||||
this.immediate = true;
|
||||
this.delay = web3.utils.toBN(42);
|
||||
await this.authority._setImmediate(this.immediate);
|
||||
await this.authority._setDelay(this.delay);
|
||||
});
|
||||
|
||||
it('returns (immediate, delay)', async function () {
|
||||
const { immediate, delay } = await this.mock.$canCallWithDelay(
|
||||
this.authority.address,
|
||||
user,
|
||||
other,
|
||||
'0x12345678',
|
||||
);
|
||||
expect(immediate).to.equal(this.immediate);
|
||||
expect(delay).to.be.bignumber.equal(this.delay);
|
||||
});
|
||||
for (const immediate of [true, false]) {
|
||||
for (const delay of ['0', '42']) {
|
||||
it(`returns (immediate=${immediate}, delay=${delay})`, async function () {
|
||||
await this.authority._setImmediate(immediate);
|
||||
await this.authority._setDelay(delay);
|
||||
const result = await this.mock.$canCallWithDelay(this.authority.address, user, other, '0x12345678');
|
||||
expect(result.immediate).to.equal(immediate);
|
||||
expect(result.delay).to.be.bignumber.equal(delay);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
describe('when authority replies with empty data', function () {
|
||||
|
||||
Reference in New Issue
Block a user