Skip to content

Commit e27fa1a

Browse files
committed
lint, improve comments
1 parent 590edcb commit e27fa1a

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

packages/tx/src/eip2930Transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default class AccessListEIP2930Transaction extends BaseTransaction<Access
108108

109109
const [chainId, nonce, gasPrice, gasLimit, to, value, data, accessList, v, r, s] = <
110110
AccessListEIP2930ValuesArray
111-
>values
111+
>values
112112
const emptyBuffer = Buffer.from([])
113113

114114
return new AccessListEIP2930Transaction(

packages/tx/src/transactionFactory.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { BN } from 'ethereumjs-util'
12
import Common from '@ethereumjs/common'
23
import { default as Transaction } from './legacyTransaction'
34
import { default as AccessListEIP2930Transaction } from './eip2930Transaction'
45
import { TxOptions, TypedTransaction, TxData, AccessListEIP2930TxData } from './types'
5-
import { BN } from 'ethereumjs-util'
66

77
const DEFAULT_COMMON = new Common({ chain: 'mainnet' })
88

@@ -13,7 +13,7 @@ export default class TransactionFactory {
1313
/**
1414
* Create a transaction from a `txData` object
1515
*
16-
* @param txData - The transaction data. The `type` field will determine which transaction type is returned (if undefined, create a Transaction)
16+
* @param txData - The transaction data. The `type` field will determine which transaction type is returned (if undefined, creates a legacy transaction)
1717
* @param txOptions - Options to pass on to the constructor of the transaction
1818
*/
1919
public static fromTxData(
@@ -22,7 +22,7 @@ export default class TransactionFactory {
2222
): TypedTransaction {
2323
const common = txOptions.common ?? DEFAULT_COMMON
2424
if (!('type' in txData) || txData.type === undefined) {
25-
// Assume Transaction
25+
// Assume legacy transaction
2626
return Transaction.fromTxData(<TxData>txData, txOptions)
2727
} else {
2828
const txType = new BN(txData.type).toNumber()
@@ -34,8 +34,7 @@ export default class TransactionFactory {
3434
}
3535

3636
/**
37-
* This method tries to decode `raw` data. It is somewhat equivalent to `fromRlpSerializedTx`.
38-
* However, it could be that the data is not directly RLP-encoded (it is a Typed Transaction)
37+
* This method tries to decode `raw` data. It is somewhat equivalent to `fromSerializedTx`, however it could be that the data is not directly RLP-encoded (it is a Typed Transaction)
3938
*
4039
* @param rawData - The raw data buffer
4140
* @param txOptions - The transaction options
@@ -72,7 +71,7 @@ export default class TransactionFactory {
7271
/**
7372
* When decoding a BlockBody, in the transactions field, a field is either:
7473
* A Buffer (a TypedTransaction - encoded as TransactionType || rlp(TransactionPayload))
75-
* A Buffer[] (Transaction)
74+
* A Buffer[] (Legacy Transaction)
7675
* This method returns the right transaction.
7776
*
7877
* @param rawData - Either a Buffer or a Buffer[]
@@ -82,7 +81,7 @@ export default class TransactionFactory {
8281
if (Buffer.isBuffer(rawData)) {
8382
return this.fromRawData(rawData, txOptions)
8483
} else if (Array.isArray(rawData)) {
85-
// It is a Transaction
84+
// It is a legacy transaction
8685
return Transaction.fromValuesArray(rawData, txOptions)
8786
} else {
8887
throw new Error('Cannot decode transaction: unknown type input')
@@ -91,7 +90,7 @@ export default class TransactionFactory {
9190

9291
/**
9392
* This helper method allows one to retrieve the class which matches the transactionID
94-
* If transactionID is undefined, return the Transaction class.
93+
* If transactionID is undefined, returns the legacy transaction class.
9594
*
9695
* @param transactionID
9796
* @param common

0 commit comments

Comments
 (0)