Skip to content

Commit bffc701

Browse files
committed
Fix test
1 parent f82810d commit bffc701

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

contracts/extensions/VotingBase.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ abstract contract VotingBase is ColonyExtension {
613613

614614
require(
615615
stakerTotalAmount <= getInfluence(_motionId, msg.sender),
616-
"voting-base-insufficient-rep"
616+
"voting-base-insufficient-influence"
617617
);
618618
require(
619619
stakerTotalAmount >= wmul(requiredStake, userMinStakeFraction) ||

test/extensions/voting-rep.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ contract("Voting Reputation", (accounts) => {
797797

798798
await checkErrorRevert(
799799
voting.stakeMotion(motionId, 1, UINT256_MAX, YAY, REQUIRED_STAKE, user2Key, user2Value, user2Mask, user2Siblings, { from: USER2 }),
800-
"voting-base-insufficient-rep"
800+
"voting-base-insufficient-influence"
801801
);
802802
});
803803

test/extensions/voting-token.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,19 @@ contract("Voting Token", (accounts) => {
593593
expect(expenditureSlot.claimDelay).to.be.zero;
594594
});
595595

596-
it("cannot stake with insufficient reputation", async () => {
597-
await checkErrorRevert(voting.stakeMotion(motionId, 1, UINT256_MAX, YAY, requiredStake, { from: USER2 }), "voting-base-insufficient-rep");
596+
it("cannot stake with insufficient token balance", async () => {
597+
const user3 = accounts[3];
598+
const user3influence = WAD.divn(1000);
599+
600+
await token.mint(user3, user3influence);
601+
await token.approve(tokenLocking.address, user3influence, { from: user3 });
602+
await tokenLocking.deposit(token.address, user3influence, { from: user3 });
603+
await colony.approveStake(voting.address, 1, user3influence, { from: user3 });
604+
605+
const totalSupply = await token.totalSupply();
606+
requiredStake = totalSupply.divn(1000);
607+
608+
await checkErrorRevert(voting.stakeMotion(motionId, 1, UINT256_MAX, YAY, requiredStake, { from: user3 }), "voting-base-insufficient-influence");
598609
});
599610

600611
it("cannot stake once time runs out", async () => {

0 commit comments

Comments
 (0)