Make ERC20Votes independent from ERC20Permit (#3816)

Co-authored-by: Francisco <frangio.1@gmail.com>
This commit is contained in:
JulissaDantes
2022-11-29 10:25:52 -04:00
committed by GitHub
parent bc8f442d00
commit e2d2ebc8fc
18 changed files with 231 additions and 343 deletions

25
test/utils/Nonces.test.js Normal file
View File

@ -0,0 +1,25 @@
require('@openzeppelin/test-helpers');
const NoncesImpl = artifacts.require('NoncesImpl');
contract('Nonces', function (accounts) {
const [ sender, other ] = accounts;
beforeEach(async function () {
this.nonces = await NoncesImpl.new();
});
it('gets a nonce', async function () {
expect(await this.nonces.nonces(sender)).to.be.bignumber.equal('0');
});
it('increment a nonce', async function () {
await this.nonces.useNonce(sender);
expect(await this.nonces.nonces(sender)).to.be.bignumber.equal('1');
});
it('nonce is specific to address argument', async function () {
await this.nonces.useNonce(sender);
expect(await this.nonces.nonces(other)).to.be.bignumber.equal('0');
});
});