Skip to content

Commit

Permalink
use sendAndConfirmTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters committed Sep 23, 2024
1 parent 2b326bb commit 2bd5499
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions solana/tests/anchor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ import {
import { SolanaWormholeCore } from "@wormhole-foundation/sdk-solana-core";
import * as fs from "fs";

import { PublicKey, SystemProgram, Transaction } from "@solana/web3.js";
import {
PublicKey,
sendAndConfirmTransaction,
SystemProgram,
Transaction,
} from "@solana/web3.js";
import { DummyTransferHook } from "../ts/idl/1_0_0/ts/dummy_transfer_hook.js";
import { SolanaNtt } from "../ts/sdk/index.js";

Expand Down Expand Up @@ -159,8 +164,9 @@ describe("example-native-token-transfers", () => {
transaction.feePayer = payer.publicKey;
transaction.recentBlockhash = blockhash;

const txid = await connection.sendTransaction(transaction, [payer, mint]);
await connection.confirmTransaction(txid, "confirmed");
await sendAndConfirmTransaction(connection, transaction, [payer, mint], {
commitment: "confirmed",
});

tokenAccount = await spl.createAssociatedTokenAccount(
connection,
Expand Down Expand Up @@ -270,8 +276,9 @@ describe("example-native-token-transfers", () => {
transaction.recentBlockhash = blockhash;

transaction.sign(payer);
const txid = await connection.sendTransaction(transaction, [payer]);
await connection.confirmTransaction(txid, "confirmed");
await sendAndConfirmTransaction(connection, transaction, [payer], {
commitment: "confirmed",
});
});

test("Can send tokens", async () => {
Expand Down

0 comments on commit 2bd5499

Please sign in to comment.