Skip to content

Commit

Permalink
test(blue-sdk): no need for asArg
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Oct 21, 2024
1 parent b468055 commit fa72cfa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/bundler-sdk-viem/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const donate =
abi: blueAbi,
functionName: "supply",
args: [
data.getMarket(data.getVault(vault).withdrawQueue[0]!).params.asArg,
{ ...data.getMarket(data.getVault(vault).withdrawQueue[0]!).params },
donation,
0n,
vault,
Expand Down
18 changes: 9 additions & 9 deletions packages/bundler-sdk-viem/test/populateBundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ describe("populateBundle", () => {
address: morpho,
abi: blueAbi,
functionName: "createMarket",
args: [marketParams.asArg],
args: [{ ...marketParams }],
});

const block = await client.getBlock();
Expand Down Expand Up @@ -798,7 +798,7 @@ describe("populateBundle", () => {
address: morpho,
abi: blueAbi,
functionName: "createMarket",
args: [marketParams.asArg],
args: [{ ...marketParams }],
});

const block = await client.getBlock();
Expand Down Expand Up @@ -1601,7 +1601,7 @@ describe("populateBundle", () => {
abi: blueAbi,
functionName: "borrow",
args: [
eth_wstEth.asArg,
{ ...eth_wstEth },
loanAssets,
0n,
client.account.address,
Expand Down Expand Up @@ -2213,7 +2213,7 @@ describe("populateBundle", () => {
abi: blueAbi,
functionName: "borrow",
args: [
eth_wstEth.asArg,
{ ...eth_wstEth },
borrowAmount,
0n,
client.account.address,
Expand Down Expand Up @@ -3083,7 +3083,7 @@ describe("populateBundle", () => {
address: morpho,
abi: blueAbi,
functionName: "createMarket",
args: [marketParams.asArg],
args: [{ ...marketParams }],
});

const block = await client.getBlock();
Expand Down Expand Up @@ -3251,7 +3251,7 @@ describe("populateBundle", () => {
address: morpho,
abi: blueAbi,
functionName: "createMarket",
args: [marketParams.asArg],
args: [{ ...marketParams }],
});

const block = await client.getBlock();
Expand Down Expand Up @@ -4090,7 +4090,7 @@ describe("populateBundle", () => {
abi: blueAbi,
functionName: "borrow",
args: [
eth_wstEth.asArg,
{ ...eth_wstEth },
loanAssets,
0n,
client.account.address,
Expand Down Expand Up @@ -4725,7 +4725,7 @@ describe("populateBundle", () => {
abi: blueAbi,
functionName: "borrow",
args: [
eth_wstEth.asArg,
{ ...eth_wstEth },
borrowAmount,
0n,
client.account.address,
Expand Down Expand Up @@ -4963,7 +4963,7 @@ describe("populateBundle", () => {
address: morpho,
abi: blueAbi,
functionName: "createMarket",
args: [marketParams.asArg],
args: [{ ...marketParams }],
});

const whitelisted = "0x53753098E2660AbD4834A3eD713D11AC1123421A";
Expand Down
19 changes: 0 additions & 19 deletions packages/morpho-test/src/fixtures/markets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
type Address,
ChainId,
type InputMarketParams,
MarketParams,
Expand Down Expand Up @@ -210,21 +209,3 @@ export const randomMarket = (params: Partial<InputMarketParams> = {}) =>
lltv: parseEther("0.80"),
...params,
});

declare module "@morpho-org/blue-sdk" {
interface MarketParams {
asArg: {
collateralToken: Address;
loanToken: Address;
oracle: Address;
irm: Address;
lltv: bigint;
};
}
}

Object.defineProperty(MarketParams.prototype, "asArg", {
get() {
return this;
},
});

0 comments on commit fa72cfa

Please sign in to comment.