Stable integration tests for the transaction fetcher #129
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.
Our fetcher integration test so far relies on hard-coded transaction hashes that were pre-populated by the
setter-popluate.sh
script. Those tx hashes need to be manually updated whenever the testnet resets, or when the setter contract is updated.This PR introduces programmatic population of the deployed setter contract to achieve a more stable integration test: On each integration test run, a fresh copy of the setter contract is created from its on-chain WASM code (there is a 1:n relationship between WASM code and contracts IDs). Each test then invokes a setter function of the contract, followed by fetching the respective transaction and verifying the call decoder output as before.
This could be further optimized for performance (i.e., only repopulate the contract when necessary), but for now a stable integration test is more important.
Closes #56