Add Required Fields to SignedTransaction Type #9
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.
As described in #8, we find the transaction hash being returned by
getBlockByNumber
.sample request
sample response: http://jsonblob.com/1173956359015489536
This PR adds the
hash
andfrom
fields to allSignedTransaction
types.Closes #8
Also reported this inconsistency to the base docs: ethereum/execution-apis#492
I also lifted these common fields out into public methods (so we don't have to match all the time when trying to access them).
Note
It is becoming more clear that
SignedTransaction
is not the type we should be updating here. It almost seems more like the function returnsTransactionReceipts
orTransaction
type. We are finding fields liketransactionIndex
being returned which are certainly not part of aSignedTransaction
. We can see that the type returned by this call is Transaction in the ethers crateFurther Issues
Now, it seems that this change does not work with QuickNode or Infura while it works seamlessly with Ankr. The reason appears to be that both QuickNode and Infura return BOTH "v" and "yParity" fields (see transaction 0 of
with
| jq '.result.transactions[0]'
or see diff
Blahhhh...
the type is declared with
Which seems to cause conflict when both fields are present. Is there some way to intercept the responses and eliminate one of the two if they are both there? This is becoming such a mess.
I am going to report this as a separate independent bug since it affects the current main branch already without this change.