From 7f0e140d5e3925a42e8bb2ac9eb1ba3fbd939864 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Wed, 14 Feb 2024 12:23:48 -0500 Subject: [PATCH] Fix transaction.index not being populated on some backends (#4591). --- src.ts/_tests/blockchain-data.ts | 8 ++++---- src.ts/providers/format.ts | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src.ts/_tests/blockchain-data.ts b/src.ts/_tests/blockchain-data.ts index 6a03bf3987..568b4da8a2 100644 --- a/src.ts/_tests/blockchain-data.ts +++ b/src.ts/_tests/blockchain-data.ts @@ -39,7 +39,7 @@ export interface TestBlockchainTransaction { hash: string, blockHash: string, blockNumber: number, -// index: number, + index: number, type: number, from: string, gasPrice: bigint, @@ -297,7 +297,7 @@ export const testTransaction: Record { if (value === "0x" || value == null) { return 0; } return getNumber(value); @@ -212,8 +215,6 @@ export function formatTransactionResponse(value: any): TransactionResponseParams blockNumber: allowNull(getNumber, null), transactionIndex: allowNull(getNumber, null), - //confirmations: allowNull(getNumber, null), - from: getAddress, // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set @@ -233,7 +234,8 @@ export function formatTransactionResponse(value: any): TransactionResponseParams chainId: allowNull(getBigInt, null) }, { data: [ "input" ], - gasLimit: [ "gas" ] + gasLimit: [ "gas" ], + index: [ "transactionIndex" ] })(value); // If to and creates are empty, populate the creates from the value