fix(anvil): Return transaction hash in ots_getTransactionBySenderAndNonce #7741
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.
Motivation
Anvil currently returns a transaction object from
ots_getTransactionBySenderAndNonce
, but both the Otterscan execution specs (https://otterscan.github.io/execution-apis/api-documentation/) and the Foundry Book itself (https://book.getfoundry.sh/reference/anvil/) say it should return the transaction hash. Users can't navigate by sender nonce in Anvil-backed Otterscan instances because if this mistake.Solution
Simply return the transaction hash rather than the complete transaction object.
Fixes #7740
First-time contributing feedback
I wasn't aware of some extra requirements to run the tests, namely:
Setup:
gcc
make
solc
libopenssl-dev
And for formatting:
It would be helpful if these instructions were added to or linked from the contributing guidelines.
Also, there were some git commit related tests that always failed when running:
cmd::clone::tests::test_clone_single_file_contract
failed withcalled
Result::unwrap()on an
Errvalue: Project init error: failed to commit (code=Some(128), stdout="", stderr="Author identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n git config --global user.email \"[email protected]\"\n git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: unable to auto-detect email address (got 'username@rustup.(none)')")