fix: default preflight commitment to confirmation commitment

This commit is contained in:
Michael Vines
2020-11-16 09:15:51 -08:00
parent c2f77a3473
commit bde1e3d004
3 changed files with 14 additions and 9 deletions

View File

@@ -19,9 +19,14 @@ export async function sendAndConfirmRawTransaction(
rawTransaction: Buffer,
options?: ConfirmOptions,
): Promise<TransactionSignature> {
const sendOptions = options && {
skipPreflight: options.skipPreflight,
preflightCommitment: options.preflightCommitment || options.commitment,
};
const signature = await connection.sendRawTransaction(
rawTransaction,
options,
sendOptions,
);
const status = (

View File

@@ -23,10 +23,15 @@ export async function sendAndConfirmTransaction(
signers: Array<Account>,
options?: ConfirmOptions,
): Promise<TransactionSignature> {
const sendOptions = options && {
skipPreflight: options.skipPreflight,
preflightCommitment: options.preflightCommitment || options.commitment,
};
const signature = await connection.sendTransaction(
transaction,
signers,
options,
sendOptions,
);
const status = (