Skip to content

Commit 7a32628

Browse files
author
Lewis
committed
project10: fix spell error in test case(solana-developers#39)
When borrowing SOL, usdc priceFeedAccount needs to be passed, so that collateral value can be calculated for determining max amount of SOL to be borrowed
1 parent 1cf2be5 commit 7a32628

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

project-10-lending/tests/bankrun.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,21 @@ describe("Lending Smart Contract Tests", async () => {
5252
wallet: provider.wallet,
5353
});
5454

55-
const SOL_PRICE_FEED_ID =
55+
const USDC_PRICE_FEED_ID =
5656
"0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a";
5757

58-
const solUsdPriceFeedAccount = pythSolanaReceiver
59-
.getPriceFeedAccountAddress(0, SOL_PRICE_FEED_ID)
58+
const usdcUsdPriceFeedAccount = pythSolanaReceiver
59+
.getPriceFeedAccountAddress(0, USDC_PRICE_FEED_ID)
6060
.toBase58();
6161

62-
const solUsdPriceFeedAccountPubkey = new PublicKey(solUsdPriceFeedAccount);
62+
const solUsdPriceFeedAccountPubkey = new PublicKey(usdcUsdPriceFeedAccount);
6363
const feedAccountInfo = await devnetConnection.getAccountInfo(
6464
solUsdPriceFeedAccountPubkey
6565
);
6666

6767
context.setAccount(solUsdPriceFeedAccountPubkey, feedAccountInfo);
6868

69-
console.log("pricefeed:", solUsdPriceFeedAccount);
69+
console.log("pricefeed:", usdcUsdPriceFeedAccount);
7070

7171
console.log("Pyth Account Info:", accountInfo);
7272

@@ -220,7 +220,7 @@ describe("Lending Smart Contract Tests", async () => {
220220
signer: signer.publicKey,
221221
mint: mintSOL,
222222
tokenProgram: TOKEN_PROGRAM_ID,
223-
priceUpdate: solUsdPriceFeedAccount,
223+
priceUpdate: usdcUsdPriceFeedAccount,
224224
})
225225
.rpc({ commitment: "confirmed" });
226226

@@ -252,4 +252,4 @@ describe("Lending Smart Contract Tests", async () => {
252252

253253
console.log("Withdraw USDC", withdrawUSDC);
254254
});
255-
});
255+
});

0 commit comments

Comments
 (0)