Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Fix Transaction Default Values #1730

Merged
merged 2 commits into from
Dec 3, 2021
Merged

Conversation

MicaiahReid
Copy link
Contributor

@MicaiahReid MicaiahReid commented Dec 3, 2021

Fixes bug in fetching future-nonce transactions.

Before a transaction is mined, its value and data (aka input) fields could possibly be undefined. Once the transaction is mined (which, in most cases is immediately), the transaction data is serialized and those undefined values are converted to 0x, which is the desired value for both the value and data when the fields are omitted by the user.

If a transaction is sent with a future nonce, however, it isn't immediately mined. If that transaction is retrieved via eth_getTransactionByHash, it has not yet been serialized. As such those two fields are undefined and completely missing from the resulting transaction object. Now, we give default values of 0 for value and 0x for data when those fields are missing from a transaction.

@MicaiahReid MicaiahReid merged commit 3489bc9 into develop Dec 3, 2021
@MicaiahReid MicaiahReid deleted the fix/set-default-tx-value/input branch December 3, 2021 17:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants