Skip to content

Commit

Permalink
chore: typo in BlockheightBasedTransactionConfirmationStrategy (#25279)
Browse files Browse the repository at this point in the history
* fix typo: Confimation => Confirmation

* chore: run prettier

Co-authored-by: steveluscher <[email protected]>
  • Loading branch information
philcchen and steveluscher authored May 17, 2022
1 parent ad38806 commit 4c75263
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
12 changes: 7 additions & 5 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export type BlockhashWithExpiryBlockHeight = Readonly<{
* A strategy for confirming transactions that uses the last valid
* block height for a given blockhash to check for transaction expiration.
*/
export type BlockheightBasedTransactionConfimationStrategy = {
export type BlockheightBasedTransactionConfirmationStrategy = {
signature: TransactionSignature;
} & BlockhashWithExpiryBlockHeight;

Expand Down Expand Up @@ -2842,7 +2842,7 @@ export class Connection {
}

confirmTransaction(
strategy: BlockheightBasedTransactionConfimationStrategy,
strategy: BlockheightBasedTransactionConfirmationStrategy,
commitment?: Commitment,
): Promise<RpcResponseAndContext<SignatureResult>>;

Expand All @@ -2856,7 +2856,7 @@ export class Connection {
// eslint-disable-next-line no-dupe-class-members
async confirmTransaction(
strategy:
| BlockheightBasedTransactionConfimationStrategy
| BlockheightBasedTransactionConfirmationStrategy
| TransactionSignature,
commitment?: Commitment,
): Promise<RpcResponseAndContext<SignatureResult>> {
Expand All @@ -2865,7 +2865,8 @@ export class Connection {
if (typeof strategy == 'string') {
rawSignature = strategy;
} else {
const config = strategy as BlockheightBasedTransactionConfimationStrategy;
const config =
strategy as BlockheightBasedTransactionConfirmationStrategy;
rawSignature = config.signature;
}

Expand Down Expand Up @@ -2942,7 +2943,8 @@ export class Connection {
timeoutMs,
);
} else {
let config = strategy as BlockheightBasedTransactionConfimationStrategy;
let config =
strategy as BlockheightBasedTransactionConfirmationStrategy;
(async () => {
let currentBlockHeight = await checkBlockHeight();
if (done) return;
Expand Down
12 changes: 6 additions & 6 deletions src/util/send-and-confirm-raw-transaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {Buffer} from 'buffer';

import {
BlockheightBasedTransactionConfimationStrategy,
BlockheightBasedTransactionConfirmationStrategy,
Connection,
} from '../connection';
import type {TransactionSignature} from '../transaction';
Expand All @@ -14,14 +14,14 @@ import type {ConfirmOptions} from '../connection';
*
* @param {Connection} connection
* @param {Buffer} rawTransaction
* @param {BlockheightBasedTransactionConfimationStrategy} confirmationStrategy
* @param {BlockheightBasedTransactionConfirmationStrategy} confirmationStrategy
* @param {ConfirmOptions} [options]
* @returns {Promise<TransactionSignature>}
*/
export async function sendAndConfirmRawTransaction(
connection: Connection,
rawTransaction: Buffer,
confirmationStrategy: BlockheightBasedTransactionConfimationStrategy,
confirmationStrategy: BlockheightBasedTransactionConfirmationStrategy,
options?: ConfirmOptions,
): Promise<TransactionSignature>;

Expand All @@ -41,13 +41,13 @@ export async function sendAndConfirmRawTransaction(
connection: Connection,
rawTransaction: Buffer,
confirmationStrategyOrConfirmOptions:
| BlockheightBasedTransactionConfimationStrategy
| BlockheightBasedTransactionConfirmationStrategy
| ConfirmOptions
| undefined,
maybeConfirmOptions?: ConfirmOptions,
): Promise<TransactionSignature> {
let confirmationStrategy:
| BlockheightBasedTransactionConfimationStrategy
| BlockheightBasedTransactionConfirmationStrategy
| undefined;
let options: ConfirmOptions | undefined;
if (
Expand All @@ -58,7 +58,7 @@ export async function sendAndConfirmRawTransaction(
)
) {
confirmationStrategy =
confirmationStrategyOrConfirmOptions as BlockheightBasedTransactionConfimationStrategy;
confirmationStrategyOrConfirmOptions as BlockheightBasedTransactionConfirmationStrategy;
options = maybeConfirmOptions;
} else {
options = confirmationStrategyOrConfirmOptions as
Expand Down

0 comments on commit 4c75263

Please sign in to comment.