diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 298a1cfb7..e997e7bef 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -28,7 +28,7 @@ "xmlhttprequest": "^1.8.0" }, "devDependencies": { - "@nomiclabs/buidler": "^1.4.4", + "@nomiclabs/buidler": "1.4.4", "@nomiclabs/buidler-ethers": "^1.3.4", "@nomiclabs/buidler-truffle5": "^1.3.4", "@nomiclabs/buidler-web3": "^1.3.4", diff --git a/packages/contracts/test/AccessControlTest.js b/packages/contracts/test/AccessControlTest.js index 8ef9cbe93..a4ee7294a 100644 --- a/packages/contracts/test/AccessControlTest.js +++ b/packages/contracts/test/AccessControlTest.js @@ -63,7 +63,7 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit } catch (err) { assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -75,7 +75,7 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit } catch (err) { assert.include(err.message, "revert" ) - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -87,7 +87,7 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit } catch (err) { assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -99,7 +99,7 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit } catch (err) { assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -111,7 +111,7 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit } catch (err) { assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -123,8 +123,8 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit const txAlice = await troveManager.addTroveOwnerToArray(bob, { from: alice }) } catch (err) { - assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "revert") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -136,8 +136,8 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit const txAlice = await troveManager.setTroveStatus(bob, 1, { from: alice }) } catch (err) { - assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "revert") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -148,8 +148,8 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit const txAlice = await troveManager.increaseTroveColl(bob, 100, { from: alice }) } catch (err) { - assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "revert") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -160,8 +160,8 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit const txAlice = await troveManager.decreaseTroveColl(bob, 100, { from: alice }) } catch (err) { - assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "revert") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -172,8 +172,8 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit const txAlice = await troveManager.increaseTroveDebt(bob, 100, { from: alice }) } catch (err) { - assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "revert") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) @@ -184,8 +184,8 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit const txAlice = await troveManager.decreaseTroveDebt(bob, 100, { from: alice }) } catch (err) { - assert.include(err.message, "revert") - // assert.include(err.message, "Caller is not the BorrowerOperations contract") + assert.include(err.message, "revert") + assert.include(err.message, "Caller is not the BorrowerOperations contract") } }) }) @@ -361,7 +361,7 @@ contract('Access Control: Liquity functions with the caller restricted to Liquit } catch (err) { assert.include(err.message, "revert") - // assert.include(err.message, "Caller is neither TroveManager nor StabilityPool") + assert.include(err.message, "Caller is neither TroveManager nor StabilityPool") } }) }) diff --git a/packages/contracts/test/CollSurplusPool.js b/packages/contracts/test/CollSurplusPool.js index 8969a66bd..3388d0ca9 100644 --- a/packages/contracts/test/CollSurplusPool.js +++ b/packages/contracts/test/CollSurplusPool.js @@ -9,7 +9,7 @@ const mv = testHelpers.MoneyValues const timeValues = testHelpers.TimeValues -contract('CollSUrplusPool', async accounts => { +contract('CollSurplusPool', async accounts => { const [ owner, A, B, C, D, E] = accounts; @@ -50,11 +50,11 @@ contract('CollSUrplusPool', async accounts => { }) it("CollSurplusPool: claimColl(): Reverts if caller is not Borrower Operations", async () => { - await th.assertRevert(collSurplusPool.claimColl(A, { from: A }), 'CollSurplus: Caller is not Borrower Operations') + await th.assertRevert(collSurplusPool.claimColl(A, { from: A }), 'CollSurplusPool: Caller is not Borrower Operations') }) it("CollSurplusPool: claimColl(): Reverts if nothing to claim", async () => { - await th.assertRevert(borrowerOperations.claimRedeemedCollateral(A), 'CollSurplus: No collateral available to claim') + await th.assertRevert(borrowerOperations.claimRedeemedCollateral(A), 'CollSurplusPool: No collateral available to claim') }) it("CollSurplusPool: claimColl(): Reverts if owner cannot receive ETH surplus", async () => { @@ -72,7 +72,7 @@ contract('CollSUrplusPool', async accounts => { const ETH_2 = await collSurplusPool.getETH() assert.equal(ETH_2, dec(5, 17)) - await th.assertRevert(borrowerOperations.claimRedeemedCollateral(B), 'CollSurplus: sending ETH failed') + await th.assertRevert(borrowerOperations.claimRedeemedCollateral(nonPayable.address), 'CollSurplusPool: sending ETH failed') }) it('CollSurplusPool: reverts trying to send ETH to it', async () => { diff --git a/packages/contracts/utils/testHelpers.js b/packages/contracts/utils/testHelpers.js index 1222ba87c..85662b610 100644 --- a/packages/contracts/utils/testHelpers.js +++ b/packages/contracts/utils/testHelpers.js @@ -968,12 +968,9 @@ class TestHelper { const tx = await txPromise } catch (err) { assert.include(err.message, "revert") - // TODO !!! - /* if (message) { assert.include(err.message, message) } - */ } } diff --git a/yarn.lock b/yarn.lock index fbc29877f..897900798 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2617,10 +2617,10 @@ dependencies: "@types/bignumber.js" "^5.0.0" -"@nomiclabs/buidler@^1.3.6": - version "1.4.8" - resolved "https://registry.yarnpkg.com/@nomiclabs/buidler/-/buidler-1.4.8.tgz#36ebbd0fb54eb2052b1336bf90ee47825393e5dc" - integrity sha512-OUnNWx+WXOJzueJCfyuEXu3qNMq1j9eGDDpgflpRwjPeiQQnvVzfbwrPjs0PlxOC3Xtmaxabtgek5wGxS1C7Ew== +"@nomiclabs/buidler@1.4.4": + version "1.4.4" + resolved "https://registry.yarnpkg.com/@nomiclabs/buidler/-/buidler-1.4.4.tgz#a46ff9383111330c10d9fe96ccc626d742093022" + integrity sha512-XciYZnaVOwXupwqTS5AqR/G0pWG2BBw61Na8m8Dm63n2KH0A+077n7xUw3PHpmMP32vw1Ua/U29o2phHNXrIAQ== dependencies: "@nomiclabs/ethereumjs-vm" "^4.1.1" "@sentry/node" "^5.18.1" @@ -2636,7 +2636,6 @@ deepmerge "^2.1.0" download "^7.1.0" enquirer "^2.3.0" - env-paths "^2.2.0" eth-sig-util "^2.5.2" ethereum-cryptography "^0.1.2" ethereumjs-abi "^0.6.8" @@ -2666,10 +2665,10 @@ uuid "^3.3.2" ws "^7.2.1" -"@nomiclabs/buidler@^1.4.4": - version "1.4.5" - resolved "https://registry.yarnpkg.com/@nomiclabs/buidler/-/buidler-1.4.5.tgz#9e332918bf0c19416494e3c4580fd3ca350ed70b" - integrity sha512-jaaVvG7OsrObhEBnLtQ/8L3J92+Jgioaw2+296dDO4Uc+MO/kprORbnpbE/WKvPL1geKQ4uj6VdCpM7qNCwL3g== +"@nomiclabs/buidler@^1.3.6": + version "1.4.8" + resolved "https://registry.yarnpkg.com/@nomiclabs/buidler/-/buidler-1.4.8.tgz#36ebbd0fb54eb2052b1336bf90ee47825393e5dc" + integrity sha512-OUnNWx+WXOJzueJCfyuEXu3qNMq1j9eGDDpgflpRwjPeiQQnvVzfbwrPjs0PlxOC3Xtmaxabtgek5wGxS1C7Ew== dependencies: "@nomiclabs/ethereumjs-vm" "^4.1.1" "@sentry/node" "^5.18.1" @@ -2685,6 +2684,7 @@ deepmerge "^2.1.0" download "^7.1.0" enquirer "^2.3.0" + env-paths "^2.2.0" eth-sig-util "^2.5.2" ethereum-cryptography "^0.1.2" ethereumjs-abi "^0.6.8"