@@ -12,6 +12,7 @@ export default class TransactionFactory {
12
12
13
13
/**
14
14
* Create a transaction from a `txData` object
15
+ *
15
16
* @param txData - The transaction data. The `type` field will determine which transaction type is returned (if undefined, create a Transaction)
16
17
* @param txOptions - Options to pass on to the constructor of the transaction
17
18
*/
@@ -35,6 +36,7 @@ export default class TransactionFactory {
35
36
/**
36
37
* This method tries to decode `raw` data. It is somewhat equivalent to `fromRlpSerializedTx`.
37
38
* However, it could be that the data is not directly RLP-encoded (it is a Typed Transaction)
39
+ *
38
40
* @param rawData - The raw data buffer
39
41
* @param txOptions - The transaction options
40
42
*/
@@ -55,7 +57,7 @@ export default class TransactionFactory {
55
57
throw new Error ( `TypedTransaction with ID ${ rawData [ 0 ] } unknown` )
56
58
}
57
59
58
- if ( ! TransactionFactory . eipSupport ( common , EIP ) ) {
60
+ if ( ! common . isActivatedEIP ( EIP ) ) {
59
61
throw new Error (
60
62
`Cannot create TypedTransaction with ID ${ rawData [ 0 ] } : EIP ${ EIP } not activated`
61
63
)
@@ -72,6 +74,7 @@ export default class TransactionFactory {
72
74
* A Buffer (a TypedTransaction - encoded as TransactionType || rlp(TransactionPayload))
73
75
* A Buffer[] (Transaction)
74
76
* This method returns the right transaction.
77
+ *
75
78
* @param rawData - Either a Buffer or a Buffer[]
76
79
* @param txOptions - The transaction options
77
80
*/
@@ -89,6 +92,7 @@ export default class TransactionFactory {
89
92
/**
90
93
* This helper method allows one to retrieve the class which matches the transactionID
91
94
* If transactionID is undefined, return the Transaction class.
95
+ *
92
96
* @param transactionID
93
97
* @param common
94
98
*/
@@ -113,16 +117,4 @@ export default class TransactionFactory {
113
117
throw new Error ( `TypedTransaction with ID ${ transactionID } unknown` )
114
118
}
115
119
}
116
-
117
- /**
118
- * Check if a typed transaction eip is supported by common
119
- * @param common - The common to use
120
- * @param eip - The EIP to check
121
- */
122
- public static eipSupport ( common : Common , eip : number ) : boolean {
123
- if ( ! common . isActivatedEIP ( 2718 ) ) {
124
- return false
125
- }
126
- return common . isActivatedEIP ( eip )
127
- }
128
120
}
0 commit comments