Remove default gasPrice when 1559 params present #2092
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was wrong?
sign_and_send_raw_middleware
was broken for EIP-1559 transactions since it made use offill_transaction_defaults()
and this was always adding agasPrice
if none was present. This would cause both legacy and 1559 params to be present leading to errors.How was it fixed?
fill_transaction_defaults()
, removed the default value forgasPrice
when 1559 parameters are present. This keeps things backwards compatible and also provides support for 1559 for the signing middleware.fill_transaction_defaults()
also defaults the transactiontype
to'0x2'
when 1559 params are present as this implies a 1559-style transaction. This is important because transaction signing (done viaeth-account
) relies on thetype
for validating 1559 transactions. We don't require thetype
forsend_transaction
so this makes the user experience smoother when using this middleware since they may already be used to sending transactions without providing atype
.Todo:
Cute Animal Picture