fix(test): fix issue causing required field 'gasPrice' in transaction #216
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.
problem
ethClient.getBlockByNumber
(source: here) by default passes "true" to "transaction_detail_flag", which causes it to return an array of tx when fetching the block.Anvil returns a block like below. Notice how there's no tx type in the transaction object, which is a deposit tx.
gasPrice
, which is a required param.this only happens occasionally in tests IFF the send message happens in same block as the deposit tx that sets the dependency set.
solution
use HeaderByNumber. this doesn't automatically set the return transaction details flag to true. This should alleviate the flakes on CI (but not all of it)
created another issue to investigate if this is just anvil or common behavior #217