Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
henrye committed Mar 25, 2024
1 parent 0a5f8ce commit f233caa
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions tests/openbook-twap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,22 +423,21 @@ describe("openbook-twap", () => {
})
.rpc();

let [settleFundsIx, settleFundsSigners] = await openbook.settleFundsIx(
oos[i],
await openbook.deserializeOpenOrderAccount(oos[i]),
market,
await openbook.deserializeMarketAccount(market),
metaAccount,
usdcAccount,
null,
provider.publicKey
);

let settleTx = new anchor.web3.Transaction().add(settleFundsIx);
[settleTx.recentBlockhash] = await banksClient.getLatestBlockhash();
settleTx.feePayer = provider.publicKey;

await provider.sendAndConfirm(settleTx, settleFundsSigners);
await openbookTwap.methods
.settleFundsExpired()
.accounts({
twapMarket,
openOrdersAccount: oos[i],
market,
marketAuthority: storedMarket.marketAuthority,
marketBaseVault: storedMarket.marketBaseVault,
marketQuoteVault: storedMarket.marketQuoteVault,
userBaseAccount: metaAccount,
userQuoteAccount: usdcAccount,
tokenProgram: TOKEN_PROGRAM_ID,
openbookProgram: OPENBOOK_PROGRAM_ID,
})
.rpc();
}
// Fetch the current balance in lamports
const balanceBefore = await banksClient.getBalance(
Expand Down

0 comments on commit f233caa

Please sign in to comment.