Skip to content

Commit 343437b

Browse files
committed
Fix MVM Pause test command: should thrown when not foundation wallet
Instead of the original crowdsale owner, the one allowed to pause the MVM is the foundation wallet
1 parent 1669907 commit 343437b

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

test/CrowdsaleGenTest.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,20 @@ contract('LifCrowdsale Property-based test', function(accounts) {
735735
});
736736
});
737737

738+
it('handles fund over soft cap with finalize and then pause the MVM from crowdsale owner', async function() {
739+
// pause actually fails because it's from the crowdsale owner instead of the foundation wallet address
740+
await runGeneratedCrowdsaleAndCommands({
741+
'commands': [
742+
{'type':'fundCrowdsaleOverSoftCap','account':2,'softCapExcessWei':2,'finalize':true},
743+
{'type':'MVMPause','pause':true,'fromAccount':8}
744+
],
745+
'crowdsale': {
746+
'rate1': 24, 'rate2': 15, 'foundationWallet': 9, 'foundersWallet': 8,
747+
'setWeiLockSeconds': 1532, 'owner': 8
748+
}
749+
});
750+
});
751+
738752
it('distributes tokens correctly on any combination of bids', async function() {
739753
// stateful prob based tests can take a long time to finish when shrinking...
740754
this.timeout(GEN_TESTS_TIMEOUT * 1000);

test/commands.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,10 @@ async function runMVMWaitForMonthCommand(command, state) {
869869

870870
async function runMVMPauseCommand(command, state) {
871871
if (state.MVM !== undefined) {
872-
let fromAccount = gen.getAccount(command.fromAccount),
873-
shouldThrow = (state.MVMPaused == command.pause) || (command.fromAccount != state.owner);
872+
let fromAccount = gen.getAccount(command.fromAccount);
873+
874+
const shouldThrow = (state.MVMPaused == command.pause) ||
875+
(command.fromAccount != state.foundationWallet);
874876

875877
try {
876878
let tx;

0 commit comments

Comments
 (0)