@@ -6,7 +6,7 @@ import { BigNumber } from "@ethersproject/bignumber";
66import { hexDataLength , hexDataSlice , hexValue , hexZeroPad , isHexString } from "@ethersproject/bytes" ;
77import { AddressZero } from "@ethersproject/constants" ;
88import { shallowCopy } from "@ethersproject/properties" ;
9- import { parse as parseTransaction } from "@ethersproject/transactions" ;
9+ import { AccessList , accessListify , parse as parseTransaction } from "@ethersproject/transactions" ;
1010
1111import { Logger } from "@ethersproject/logger" ;
1212import { version } from "./_version" ;
@@ -51,6 +51,9 @@ export class Formatter {
5151 formats . transaction = {
5252 hash : hash ,
5353
54+ type : Formatter . allowNull ( number , null ) ,
55+ accessList : Formatter . allowNull ( this . accessList . bind ( this ) , null ) ,
56+
5457 blockHash : Formatter . allowNull ( hash , null ) ,
5558 blockNumber : Formatter . allowNull ( number , null ) ,
5659 transactionIndex : Formatter . allowNull ( number , null ) ,
@@ -83,6 +86,8 @@ export class Formatter {
8386 to : Formatter . allowNull ( address ) ,
8487 value : Formatter . allowNull ( bigNumber ) ,
8588 data : Formatter . allowNull ( strictData ) ,
89+ type : Formatter . allowNull ( number ) ,
90+ accessList : Formatter . allowNull ( this . accessList . bind ( this ) , null ) ,
8691 } ;
8792
8893 formats . receiptLog = {
@@ -162,6 +167,10 @@ export class Formatter {
162167 return formats ;
163168 }
164169
170+ accessList ( accessList : Array < any > ) : AccessList {
171+ return accessListify ( accessList || [ ] ) ;
172+ }
173+
165174 // Requires a BigNumberish that is within the IEEE754 safe integer range; returns a number
166175 // Strict! Used on input.
167176 number ( number : any ) : number {
@@ -308,28 +317,9 @@ export class Formatter {
308317 transaction . creates = this . contractAddress ( transaction ) ;
309318 }
310319
311- // @TODO : use transaction.serialize? Have to add support for including v, r, and s...
312- /*
313- if (!transaction.raw) {
314-
315- // Very loose providers (e.g. TestRPC) do not provide a signature or raw
316- if (transaction.v && transaction.r && transaction.s) {
317- let raw = [
318- stripZeros(hexlify(transaction.nonce)),
319- stripZeros(hexlify(transaction.gasPrice)),
320- stripZeros(hexlify(transaction.gasLimit)),
321- (transaction.to || "0x"),
322- stripZeros(hexlify(transaction.value || "0x")),
323- hexlify(transaction.data || "0x"),
324- stripZeros(hexlify(transaction.v || "0x")),
325- stripZeros(hexlify(transaction.r)),
326- stripZeros(hexlify(transaction.s)),
327- ];
328-
329- transaction.raw = rlpEncode(raw);
330- }
320+ if ( transaction . type === 1 && transaction . accessList == null ) {
321+ transaction . accessList = [ ] ;
331322 }
332- */
333323
334324 const result : TransactionResponse = Formatter . check ( this . formats . transaction , transaction ) ;
335325
0 commit comments