Skip to content

Commit

Permalink
Directly verify vote totals when testing parameterized voting
Browse files Browse the repository at this point in the history
  • Loading branch information
apbendi committed Feb 26, 2022
1 parent 8722c5c commit b4cd7c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/governance/extensions/GovernorWithParams.test.js
Expand Up @@ -7,6 +7,7 @@ const { EIP712Domain } = require('../../helpers/eip712');
const { fromRpcSig } = require('ethereumjs-util');

const { runGovernorWorkflow } = require('../GovernorWorkflow.behavior');
const { expect } = require('chai');

const Token = artifacts.require('ERC20VotesCompMock');
const Governor = artifacts.require('GovernorWithParamsMock');
Expand Down Expand Up @@ -142,6 +143,8 @@ contract('GovernorWithParams', function (accounts) {

expectEvent(tx, 'CountParams', { uintParam, strParam });
expectEvent(tx, 'VoteCastWithParams', { voter: voter2, weight: reducedWeight, params });
const votes = await this.mock.proposalVotes(this.id);
expect(votes.forVotes).to.be.bignumber.equal(reducedWeight);
});
runGovernorWorkflow();
});
Expand Down Expand Up @@ -227,6 +230,8 @@ contract('GovernorWithParams', function (accounts) {

expectEvent(tx, 'CountParams', { uintParam, strParam });
expectEvent(tx, 'VoteCastWithParams', { voter: this.voter, weight: reducedWeight, params });
const votes = await this.mock.proposalVotes(this.id);
expect(votes.forVotes).to.be.bignumber.equal(reducedWeight);
});
runGovernorWorkflow();
});
Expand Down

0 comments on commit b4cd7c4

Please sign in to comment.