From c16649102d4eb562fca2c90f965e43b1b64c6cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Fingen?= Date: Fri, 3 May 2024 16:57:15 +0100 Subject: [PATCH] test: Fix hardhat tests after reduce liquidation penalty --- contracts/test/CollSurplusPool.js | 4 ++-- contracts/test/OwnershipTest.js | 2 +- contracts/utils/deploymentHelpers.js | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/contracts/test/CollSurplusPool.js b/contracts/test/CollSurplusPool.js index a431eb111..a3bf5952c 100644 --- a/contracts/test/CollSurplusPool.js +++ b/contracts/test/CollSurplusPool.js @@ -40,14 +40,14 @@ contract("CollSurplusPool", async (accounts) => { it("CollSurplusPool: claimColl(): Reverts if caller is not Borrower Operations", async () => { await th.assertRevert( - collSurplusPool.claimColl(A, th.addressToTroveId(A), { from: A }), + collSurplusPool.claimColl(A, { from: A }), "CollSurplusPool: Caller is not Borrower Operations", ); }); it("CollSurplusPool: claimColl(): Reverts if nothing to claim", async () => { await th.assertRevert( - borrowerOperations.claimCollateral(th.addressToTroveId(A), { from: A }), + borrowerOperations.claimCollateral({ from: A }), "CollSurplusPool: No collateral available to claim", ); }); diff --git a/contracts/test/OwnershipTest.js b/contracts/test/OwnershipTest.js index 0f5bc12dd..423920601 100644 --- a/contracts/test/OwnershipTest.js +++ b/contracts/test/OwnershipTest.js @@ -89,7 +89,7 @@ contract("All Liquity functions with onlyOwner modifier", async (accounts) => { describe("BorrowerOperations", async (accounts) => { it("setAddresses(): reverts when called by non-owner, with wrong addresses, or twice", async () => { - await testDeploymentSetter(borrowerOperations, 9); + await testDeploymentSetter(borrowerOperations, 8); }); }); diff --git a/contracts/utils/deploymentHelpers.js b/contracts/utils/deploymentHelpers.js index 429590661..bd4b0772a 100644 --- a/contracts/utils/deploymentHelpers.js +++ b/contracts/utils/deploymentHelpers.js @@ -59,7 +59,8 @@ class DeploymentHelper { // Borrowing contracts const activePool = await Contracts.ActivePool.new(WETH.address); - const borrowerOperations = await Contracts.BorrowerOperations.new(WETH.address); + const troveManager = await Contracts.TroveManager.new(web3.utils.toBN("1100000000000000000"), web3.utils.toBN("100000000000000000"), web3.utils.toBN("100000000000000000")); + const borrowerOperations = await Contracts.BorrowerOperations.new(WETH.address, troveManager.address); const collSurplusPool = await Contracts.CollSurplusPool.new(WETH.address); const defaultPool = await Contracts.DefaultPool.new(WETH.address); const gasPool = await Contracts.GasPool.new(); @@ -67,7 +68,6 @@ class DeploymentHelper { const priceFeed = await Contracts.PriceFeedMock.new(); const sortedTroves = await Contracts.SortedTroves.new(); const stabilityPool = await Contracts.StabilityPool.new(WETH.address); - const troveManager = await Contracts.TroveManager.new(); const { boldToken } = await this.deployBoldToken({ troveManager, @@ -167,7 +167,6 @@ class DeploymentHelper { // set contracts in BorrowerOperations await contracts.borrowerOperations.setAddresses( - contracts.troveManager.address, contracts.activePool.address, contracts.defaultPool.address, contracts.stabilityPool.address,