Skip to content

Commit

Permalink
sdk: avoid setting drift client commitment to undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Nov 13, 2024
1 parent ddd10dd commit 2b61f28
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sdk/src/driftClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ export class DriftClient {
this.wallet = config.wallet;
this.opts = config.opts || {
...DEFAULT_CONFIRMATION_OPTS,
commitment: config?.connection?.commitment,
preflightCommitment: config?.connection?.commitment, // At the moment this ensures that our transaction simulations (which use Connection object) will use the same commitment level as our Transaction blockhashes (which use these opts)
};
if (config?.connection?.commitment) {
// At the moment this ensures that our transaction simulations (which use Connection object) will use the same commitment level as our Transaction blockhashes (which use these opts)
this.opts.commitment = config.connection.commitment;
this.opts.preflightCommitment = config.connection.commitment;
}
this.provider = new AnchorProvider(
config.connection,
// @ts-ignore
Expand Down

0 comments on commit 2b61f28

Please sign in to comment.