Skip to content

Commit

Permalink
minor test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SatyamSB committed Apr 10, 2019
1 parent 2941a9c commit 04fbdcc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ contract WeightedVoteCheckpointFactory is ModuleFactory {
tagsData.push("Vote");
tagsData.push("Transparent");
tagsData.push("Checkpoint");
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(3), uint8(0), uint8(0));
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(3), uint8(0), uint8(0));

}

Expand Down
10 changes: 5 additions & 5 deletions test/zc_weighted_vote_checkpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ contract("WeightedVoteCheckpoint", async (accounts) => {
let tx = await I_STRProxied.generateSecurityToken(name, symbol, tokenDetails, false, token_owner, 0, { from: token_owner });

// Verify the successful generation of the security token
assert.equal(tx.logs[2].args._ticker, symbol, "SecurityToken doesn't get deployed");
assert.equal(tx.logs[1].args._ticker, symbol, "SecurityToken doesn't get deployed");

I_SecurityToken = await SecurityToken.at(tx.logs[2].args._securityTokenAddress);
I_SecurityToken = await SecurityToken.at(tx.logs[1].args._securityTokenAddress);
stGetter = await STGetter.at(I_SecurityToken.address);
const log = (await I_SecurityToken.getPastEvents('ModuleAdded', {filter: {transactionHash: tx.transactionHash}}))[0];
// Verify that GeneralTransferManager module get added successfully or not
Expand All @@ -156,22 +156,22 @@ contract("WeightedVoteCheckpoint", async (accounts) => {
});

it("\t\t Should attach the voting module with the ST \n", async() => {
let tx = await I_SecurityToken.addModule(I_WeightedVoteCheckpointFactory.address, "0x0", 0, 0, {from: token_owner});
let tx = await I_SecurityToken.addModule(I_WeightedVoteCheckpointFactory.address, "0x0", 0, 0, false, {from: token_owner});
assert.equal(tx.logs[2].args._types[0], checkpointKey, "Checkpoint doesn't get deployed");
assert.equal(web3.utils.hexToString(tx.logs[2].args._name), "WeightedVoteCheckpoint", "WeightedVoteCheckpoint module was not added");
I_WeightedVoteCheckpoint = await WeightedVoteCheckpoint.at(tx.logs[2].args._module);
});

it("\t\t Should fail to attach the voting module because allowance is unsufficent \n", async() => {
await catchRevert(
I_SecurityToken.addModule(P_WeightedVoteCheckpointFactory.address, "0x0", new BN(web3.utils.toWei("500")), 0, {from: token_owner})
I_SecurityToken.addModule(P_WeightedVoteCheckpointFactory.address, "0x0", new BN(web3.utils.toWei("500")), 0, false, {from: token_owner})
);
});

it("\t\t Should attach the voting module with the ST \n", async() => {
let id = await takeSnapshot();
await I_PolyToken.transfer(I_SecurityToken.address, new BN(web3.utils.toWei("2000", "ether")), { from: token_owner });
let tx = await I_SecurityToken.addModule(P_WeightedVoteCheckpointFactory.address, "0x0", new BN(web3.utils.toWei("2000")), 0, {from: token_owner});
let tx = await I_SecurityToken.addModule(P_WeightedVoteCheckpointFactory.address, "0x0", new BN(web3.utils.toWei("2000")), 0, false, {from: token_owner});
assert.equal(tx.logs[3].args._types[0], checkpointKey, "Checkpoint doesn't get deployed");
assert.equal(web3.utils.hexToString(tx.logs[3].args._name), "WeightedVoteCheckpoint", "WeightedVoteCheckpoint module was not added");
await revertToSnapshot(id);
Expand Down

0 comments on commit 04fbdcc

Please sign in to comment.