Files
openzeppelin-contracts/test/governance/utils/ERC6372.behavior.js
Renan Souza 7bd2b2aaf6 Use ERC-XXX syntax (#4730)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: ernestognw <ernestognw@gmail.com>
2023-11-22 23:18:04 -06:00

24 lines
751 B
JavaScript

const { clock } = require('../../helpers/time');
function shouldBehaveLikeERC6372(mode = 'blocknumber') {
describe('should implement ERC6372', function () {
beforeEach(async function () {
this.mock = this.mock ?? this.token ?? this.votes;
});
it('clock is correct', async function () {
expect(await this.mock.clock()).to.be.bignumber.equal(await clock[mode]().then(web3.utils.toBN));
});
it('CLOCK_MODE is correct', async function () {
const params = new URLSearchParams(await this.mock.CLOCK_MODE());
expect(params.get('mode')).to.be.equal(mode);
expect(params.get('from')).to.be.equal(mode == 'blocknumber' ? 'default' : null);
});
});
}
module.exports = {
shouldBehaveLikeERC6372,
};