Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions tests/auction-house/tests/auction-house.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ describe("auction-house", () => {
mintAuthority: authority,
}
);
await getProvider().sendAndConfirm(tx);
await getProvider().sendAndConfirm(tx, [], {
maxRetries: 3,
skipPreflight: true,
});
});

it("Creates token accounts for the NFT", async () => {
Expand Down Expand Up @@ -184,7 +187,10 @@ describe("auction-house", () => {
lamports: 100 * 10 ** 9,
})
);
const txSig = await getProvider().sendAndConfirm(tx);
const txSig = await getProvider().sendAndConfirm(tx, [], {
maxRetries: 3,
skipPreflight: true,
});
console.log("fund buyer:", txSig);
});

Expand Down Expand Up @@ -421,7 +427,10 @@ describe("auction-house", () => {
.instruction()
);

const txSig = await authorityClient.provider.sendAndConfirm(tx);
const txSig = await authorityClient.provider.sendAndConfirm(tx, [], {
maxRetries: 3,
skipPreflight: true,
});
console.log("updateAuctionHouse:", txSig);

const newAh = await authorityClient.account.auctionHouse.fetch(
Expand Down
5 changes: 4 additions & 1 deletion tests/bench/tests/compute-units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ describe("Compute units", () => {
.instruction();
tx.add(createTokenIx, initTokenIx);

await tokenProgram.provider.sendAndConfirm!(tx, [mintKp, tokenKp]);
await tokenProgram.provider.sendAndConfirm!(tx, [mintKp, tokenKp], {
maxRetries: 3,
skipPreflight: true,
});
});

it("AccountInfo", async () => {
Expand Down
7 changes: 6 additions & 1 deletion tests/cpi-returns/tests/cpi-return.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ describe("CPI return", () => {

const cpiReturn = anchor.web3.Keypair.generate();

const confirmOptions: ConfirmOptions = { commitment: "confirmed" };
const confirmOptions: ConfirmOptions = {
commitment: "confirmed",
preflightCommitment: "confirmed",
skipPreflight: true,
maxRetries: 3,
};

it("can initialize", async () => {
await calleeProgram.methods
Expand Down
5 changes: 4 additions & 1 deletion tests/custom-discriminator/tests/custom-discriminator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ describe("custom-discriminator", () => {
assert(data.equals(Buffer.from(ix.discriminator)));

// Verify tx runs
await program.provider.sendAndConfirm!(tx);
await program.provider.sendAndConfirm!(tx, [], {
maxRetries: 3,
skipPreflight: true,
});
};

it("Integer", () => testCommon("int"));
Expand Down
1 change: 1 addition & 0 deletions tests/errors/tests/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe("errors", () => {
// because we cannot get logs for them (only through overkill `onLogs`)
provider.opts.commitment = "confirmed";
anchor.setProvider(provider);
provider.opts.maxRetries = 3;

const program = anchor.workspace.Errors as Program<Errors>;

Expand Down
10 changes: 8 additions & 2 deletions tests/events/tests/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ describe("Events", () => {
});

describe("CPI event", () => {
const config = {
commitment: "confirmed",
preflightCommitment: "confirmed",
skipPreflight: true,
maxRetries: 3,
} as const;

it("Works without accounts being specified", async () => {
const tx = await program.methods.testEventCpi().transaction();
const config = { commitment: "confirmed" } as const;
const txHash = await program.provider.sendAndConfirm(tx, [], config);
const txResult = await program.provider.connection.getTransaction(
txHash,
Expand Down Expand Up @@ -91,7 +97,7 @@ describe("Events", () => {
);

try {
await program.provider.sendAndConfirm(tx, []);
await program.provider.sendAndConfirm(tx, [], config);
} catch (e) {
if (e.logs.some((log) => log.includes("ConstraintSigner"))) return;
console.log(e);
Expand Down
14 changes: 8 additions & 6 deletions tests/spl/transfer-hook/tests/transfer-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ describe("transfer hook", () => {
"confirmed"
);

await sendAndConfirmTransaction(provider.connection, transaction, [
payer,
mint,
mintAuthority,
]);
await sendAndConfirmTransaction(
provider.connection,
transaction,
[payer, mint, mintAuthority],
{ maxRetries: 3, skipPreflight: true }
);
});

it("can create an `InitializeExtraAccountMetaList` instruction with the proper discriminator", async () => {
Expand Down Expand Up @@ -275,7 +276,8 @@ describe("transfer hook", () => {
await sendAndConfirmTransaction(
provider.connection,
new Transaction().add(ix),
[payer, sourceAuthority]
[payer, sourceAuthority],
{ maxRetries: 3, skipPreflight: true }
);

// Check the resulting token balances
Expand Down
Loading