From b4cd7c4caaf5f87a445125cb6be117857559d5ce Mon Sep 17 00:00:00 2001 From: Ben DiFrancesco Date: Fri, 25 Feb 2022 23:14:23 -0500 Subject: [PATCH] Directly verify vote totals when testing parameterized voting --- test/governance/extensions/GovernorWithParams.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/governance/extensions/GovernorWithParams.test.js b/test/governance/extensions/GovernorWithParams.test.js index eca66a28ec1..5b4ac8901d9 100644 --- a/test/governance/extensions/GovernorWithParams.test.js +++ b/test/governance/extensions/GovernorWithParams.test.js @@ -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'); @@ -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(); }); @@ -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(); });