-
Notifications
You must be signed in to change notification settings - Fork 681
Conversation
…/ganache into feat/eip-1559-tx-david-temp
accessList?: never; | ||
maxPriorityFeePerGas?: never; | ||
maxFeePerGas?: never; | ||
export type LegacyRpcTransaction = Readonly<RpcTransaction> & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about the reasoning for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never mutate the json data a user gives us (like in provider.send("eth_sendTransaction", transaction)
) but in one place in our code we were. Marking the type as Readonly
prevents that sort of bug from happening.
It doesn't just throw with an "invalid remainder" message now :-)
@@ -64,12 +64,11 @@ export class Block { | |||
}); | |||
} | |||
|
|||
toJSON(includeFullTransactions = false) { | |||
toJSON(includeFullTransactions = false, common: Common) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably fine to leave it as is and fix when we re-organize the transactions classes
@@ -83,7 +106,7 @@ export class EIP1559FeeMarketTransaction extends RuntimeTransaction { | |||
this.updateEffectiveGasPrice(); | |||
} | |||
|
|||
public toJSON(): EIP1559FeeMarketTransactionJSON { | |||
public toJSON(_common?: Common): EIP1559FeeMarketTransactionJSON { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the _common
is needed because the super class needs it because LegacyTransaction
needs it. The _
makes the linter stop complaining about an unused variable.
accessList?: never; | ||
maxPriorityFeePerGas?: never; | ||
maxFeePerGas?: never; | ||
export type LegacyRpcTransaction = Readonly<RpcTransaction> & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never mutate the json data a user gives us (like in provider.send("eth_sendTransaction", transaction)
) but in one place in our code we were. Marking the type as Readonly
prevents that sort of bug from happening.
…/ganache into feat/eip-1559-tx-david-temp
baseFeePerGas
to ablock
baseFeePerGas
as the block'sgasPrice
effectiveGasPrice
DESIGN-DECISIONS.md
to explain the change