Skip to content

Commit

Permalink
test(aavev3): fix Aave V3 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Brenzee committed Oct 31, 2023
1 parent 7ab1152 commit fa199b3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 55 deletions.
26 changes: 0 additions & 26 deletions src/smartPlugins/AaveV2/AaveV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,6 @@ describe("AaveV2 Smart Plugin tests", () => {

expect(plugin).instanceOf(AaveV2.borrow);
});
it("interestRateMode should revert", async () => {
expect(() => {
smartPlugin.set({
// @ts-ignore
interestRateMode: "3",
amount: "1" + "0".repeat(6),
asset: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
onBehalfOf: smartPlugin.vaultAddress,
});
})
.to.throw(Error)
.with.property("message", `interestRateMode: Invalid value. Expected: 1, 2`);
});
});
describe("AaveV2 Repay", () => {
// smartPlugin is an initialized instance of AaveV2 Repay
Expand All @@ -86,18 +73,5 @@ describe("AaveV2 Smart Plugin tests", () => {

expect(plugin).instanceOf(AaveV2.repay);
});
it("rateMode should revert", async () => {
expect(() => {
smartPlugin.set({
// @ts-ignore
rateMode: "3",
amount: "1" + "0".repeat(6),
asset: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
onBehalfOf: smartPlugin.vaultAddress,
});
})
.to.throw(Error)
.with.property("message", `rateMode: Invalid value. Expected: 1, 2`);
});
});
});
28 changes: 1 addition & 27 deletions src/smartPlugins/AaveV3/AaveV3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,6 @@ describe("AaveV3 Smart Plugin tests", () => {

expect(plugin).instanceOf(AaveV3.borrow);
});
it("interestRateMode should revert", async () => {
expect(() => {
smartPlugin.set({
// @ts-ignore
interestRateMode: "3",
amount: "1" + "0".repeat(6),
asset: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
onBehalfOf: smartPlugin.vaultAddress,
});
})
.to.throw(Error)
.with.property("message", `interestRateMode: Invalid value. Expected: 1, 2`);
});
});
describe("AaveV3 Repay", () => {
// smartPlugin is an initialized instance of AaveV3 Repay
Expand All @@ -79,25 +66,12 @@ describe("AaveV3 Smart Plugin tests", () => {
amount: "1" + "0".repeat(6),
asset: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
onBehalfOf: smartPlugin.vaultAddress,
rateMode: "2",
interestRateMode: "2",
});

const plugin = await smartPlugin.getPlugin();

expect(plugin).instanceOf(AaveV3.repay);
});
it("rateMode should revert", async () => {
expect(() => {
smartPlugin.set({
// @ts-ignore
rateMode: "3",
amount: "1" + "0".repeat(6),
asset: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
onBehalfOf: smartPlugin.vaultAddress,
});
})
.to.throw(Error)
.with.property("message", `rateMode: Invalid value. Expected: 1, 2`);
});
});
});
3 changes: 1 addition & 2 deletions src/smartPlugins/AaveV3/plugins/Repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ const abiFragment = {
type: "uint256",
},
{
name: "rateMode",
name: "interestRateMode",
type: "uint256",
options: ["1", "2"],
},
{
name: "onBehalfOf",
Expand Down

0 comments on commit fa199b3

Please sign in to comment.