Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add maxSupportedTransactionVersion config to remaining getTransaction calls #26731

Merged
merged 1 commit into from
Jul 22, 2022
Merged
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
25 changes: 19 additions & 6 deletions web3.js/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3739,12 +3739,15 @@ export class Connection {
*/
async getParsedTransaction(
signature: TransactionSignature,
commitment?: Finality,
commitmentOrConfig?: GetTransactionConfig | Finality,
): Promise<ParsedConfirmedTransaction | null> {
const {commitment, config} =
extractCommitmentFromConfig(commitmentOrConfig);
const args = this._buildArgsAtLeastConfirmed(
[signature],
commitment,
commitment as Finality,
'jsonParsed',
config,
);
const unsafeRes = await this._rpcRequest('getTransaction', args);
const res = create(unsafeRes, GetParsedTransactionRpcResult);
Expand All @@ -3759,13 +3762,16 @@ export class Connection {
*/
async getParsedTransactions(
signatures: TransactionSignature[],
commitment?: Finality,
commitmentOrConfig?: GetTransactionConfig | Finality,
): Promise<(ParsedConfirmedTransaction | null)[]> {
const {commitment, config} =
extractCommitmentFromConfig(commitmentOrConfig);
const batch = signatures.map(signature => {
const args = this._buildArgsAtLeastConfirmed(
[signature],
commitment,
commitment as Finality,
'jsonParsed',
config,
);
return {
methodName: 'getTransaction',
Expand All @@ -3791,10 +3797,17 @@ export class Connection {
*/
async getTransactions(
signatures: TransactionSignature[],
commitment?: Finality,
commitmentOrConfig?: GetTransactionConfig | Finality,
): Promise<(TransactionResponse | null)[]> {
const {commitment, config} =
extractCommitmentFromConfig(commitmentOrConfig);
const batch = signatures.map(signature => {
const args = this._buildArgsAtLeastConfirmed([signature], commitment);
const args = this._buildArgsAtLeastConfirmed(
[signature],
commitment as Finality,
undefined /* encoding */,
config,
);
return {
methodName: 'getTransaction',
args,
Expand Down