Skip to content

Commit

Permalink
test: Fix hardhat tests after reduce liquidation penalty
Browse files Browse the repository at this point in the history
  • Loading branch information
bingen committed May 3, 2024
1 parent b89f18e commit c166491
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions contracts/test/CollSurplusPool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
});
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/OwnershipTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down
5 changes: 2 additions & 3 deletions contracts/utils/deploymentHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ 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();
const priceFeedTestnet = await Contracts.PriceFeedTestnet.new();
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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c166491

Please sign in to comment.