Skip to content

Commit d5faeec

Browse files
committed
Fix incorrect refactor of checkErrorRevert
1 parent 6810453 commit d5faeec

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

helpers/test-helper.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,12 @@ exports.checkErrorRevert = async function checkErrorRevert(promise, errorMessage
191191
const txid = await promise;
192192
receipt = await exports.web3GetTransactionReceipt(txid);
193193
// Check the receipt `status` to ensure transaction failed.
194-
expect(receipt.status, `Transaction succeeded, but expected error ${errorMessage}`).to.be.false;
195194
}
195+
expect(receipt.status, `Transaction succeeded, but expected error ${errorMessage}`).to.be.false;
196196
} catch (err) {
197+
if (err.toString().indexOf("AssertionError: Transaction succeeded, but expected error") === 0) {
198+
throw err;
199+
}
197200
({ reason } = err);
198201
expect(reason).to.equal(errorMessage);
199202
}

test/extensions/staked-expenditure.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -323,17 +323,6 @@ contract("StakedExpenditure", (accounts) => {
323323
expect(userLock.balance).to.eq.BN(WAD.sub(requiredStake));
324324
});
325325

326-
it("cannot slash a nonexistent stake", async () => {
327-
await colony.makeExpenditure(1, UINT256_MAX, 1);
328-
const expenditureId = await colony.getExpenditureCount();
329-
await colony.lockExpenditure(expenditureId);
330-
331-
await checkErrorRevert(
332-
stakedExpenditure.cancelAndPunish(1, UINT256_MAX, 1, UINT256_MAX, expenditureId, true),
333-
"staked-expenditure-nothing-to-slash"
334-
);
335-
});
336-
337326
it("can reclaim the stake by cancelling the expenditure", async () => {
338327
await stakedExpenditure.makeExpenditureWithStake(1, UINT256_MAX, 1, domain1Key, domain1Value, domain1Mask, domain1Siblings, { from: USER0 });
339328
const expenditureId = await colony.getExpenditureCount();

0 commit comments

Comments
 (0)