Finalize test migration: remove legacy dependencies and test helpers (#4797)
This commit is contained in:
@ -4,7 +4,7 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers');
|
||||
|
||||
const { sum } = require('../../helpers/math');
|
||||
const { zip } = require('../../helpers/iterate');
|
||||
const { bigint: time } = require('../../helpers/time');
|
||||
const time = require('../../helpers/time');
|
||||
|
||||
const { shouldBehaveLikeVotes } = require('./Votes.behavior');
|
||||
|
||||
@ -71,7 +71,7 @@ describe('Votes', function () {
|
||||
|
||||
expect(await this.votes.getVotes(this.accounts[0])).to.equal(this.amounts[this.accounts[0].address]);
|
||||
expect(await this.votes.getVotes(this.accounts[1])).to.equal(0n);
|
||||
expect(await this.votes.delegates(this.accounts[0])).to.equal(this.accounts[0].address);
|
||||
expect(await this.votes.delegates(this.accounts[0])).to.equal(this.accounts[0]);
|
||||
expect(await this.votes.delegates(this.accounts[1])).to.equal(ethers.ZeroAddress);
|
||||
|
||||
await this.votes.delegate(this.accounts[1], ethers.Typed.address(this.accounts[0]));
|
||||
@ -80,13 +80,13 @@ describe('Votes', function () {
|
||||
this.amounts[this.accounts[0].address] + this.amounts[this.accounts[1].address],
|
||||
);
|
||||
expect(await this.votes.getVotes(this.accounts[1])).to.equal(0n);
|
||||
expect(await this.votes.delegates(this.accounts[0])).to.equal(this.accounts[0].address);
|
||||
expect(await this.votes.delegates(this.accounts[1])).to.equal(this.accounts[0].address);
|
||||
expect(await this.votes.delegates(this.accounts[0])).to.equal(this.accounts[0]);
|
||||
expect(await this.votes.delegates(this.accounts[1])).to.equal(this.accounts[0]);
|
||||
});
|
||||
|
||||
it('cross delegates', async function () {
|
||||
await this.votes.delegate(this.accounts[0], ethers.Typed.address(this.accounts[1].address));
|
||||
await this.votes.delegate(this.accounts[1], ethers.Typed.address(this.accounts[0].address));
|
||||
await this.votes.delegate(this.accounts[0], ethers.Typed.address(this.accounts[1]));
|
||||
await this.votes.delegate(this.accounts[1], ethers.Typed.address(this.accounts[0]));
|
||||
|
||||
expect(await this.votes.getVotes(this.accounts[0])).to.equal(this.amounts[this.accounts[1].address]);
|
||||
expect(await this.votes.getVotes(this.accounts[1])).to.equal(this.amounts[this.accounts[0].address]);
|
||||
|
||||
Reference in New Issue
Block a user