Skip to content

Commit

Permalink
Revert "throw when gasPrice passed to 1559 tx"
Browse files Browse the repository at this point in the history
This reverts commit 6a9b15e.
  • Loading branch information
acolytec3 committed Nov 11, 2024
1 parent 6a9b15e commit 226135b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 0 additions & 4 deletions packages/tx/src/1559/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ export class FeeMarket1559Tx implements TransactionInterface<TransactionType.Fee
throw new Error(msg)
}

if (txData.gasPrice !== undefined && txData.gasPrice !== null) {
const msg = Legacy.errorMsg(this, 'gasPrice cannot be defined on 1559 tx')
throw new Error(msg)
}
EIP2718.validateYParity(this)
Legacy.validateHighS(this)

Expand Down
5 changes: 5 additions & 0 deletions packages/tx/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ export interface AccessList2930TxData extends LegacyTxData {
* {@link FeeMarket1559Tx} data.
*/
export interface FeeMarketEIP1559TxData extends AccessList2930TxData {
/**
* The transaction's gas price, inherited from {@link Transaction}. This property is not used for EIP1559
* transactions and should always be undefined for this specific transaction type.
*/
gasPrice?: never | null
/**
* The maximum inclusion fee per gas (this fee is given to the miner)
*/
Expand Down
1 change: 1 addition & 0 deletions packages/tx/test/base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ describe('[BaseTransaction]', () => {
...txType.txs,
// add unsigned variants
...txType.txs.map((tx) =>
// @ts-ignore Not sure why this is now throwing
txType.create.txData({
...tx,
v: undefined,
Expand Down
3 changes: 0 additions & 3 deletions packages/tx/test/eip1559.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,5 @@ describe('[FeeMarket1559Tx]', () => {
undefined,
'total fee must be the larger of the two',
)
assert.throws(() => {
createFeeMarket1559Tx({ gasPrice: 1 }, { common })
}, 'gasPrice cannot be defined on 1559 tx')
})
})

0 comments on commit 226135b

Please sign in to comment.