From 78e4273a327d12da9a1ec008d3f2146d97385921 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Wed, 18 Aug 2021 02:59:47 -0300 Subject: [PATCH] Fxied getBlockWithTransactions results (1858). --- packages/providers/src.ts/base-provider.ts | 4 ++-- packages/providers/src.ts/formatter.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/providers/src.ts/base-provider.ts b/packages/providers/src.ts/base-provider.ts index 0eeede4b9d..8560515683 100644 --- a/packages/providers/src.ts/base-provider.ts +++ b/packages/providers/src.ts/base-provider.ts @@ -1389,8 +1389,8 @@ export class BaseProvider extends Provider implements EnsProvider { } } - const blockWithTxs = this.formatter.blockWithTransactions(block); - blockWithTxs.transactions = block.transactions.map((tx: TransactionResponse) => this._wrapTransaction(tx)); + const blockWithTxs: any = this.formatter.blockWithTransactions(block); + blockWithTxs.transactions = blockWithTxs.transactions.map((tx: TransactionResponse) => this._wrapTransaction(tx)); return blockWithTxs; } diff --git a/packages/providers/src.ts/formatter.ts b/packages/providers/src.ts/formatter.ts index 3136aea6ca..4801682ea2 100644 --- a/packages/providers/src.ts/formatter.ts +++ b/packages/providers/src.ts/formatter.ts @@ -334,7 +334,7 @@ export class Formatter { transaction.creates = this.contractAddress(transaction); } - if (transaction.type === 1 && transaction.accessList == null) { + if ((transaction.type === 1 || transaction.type === 2)&& transaction.accessList == null) { transaction.accessList = [ ]; }