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.
Description
Fixes a broken address test that exhibits inconsistent failure.
Closes issue 5133.
Motivation and Context
The test in question claims to detect failures caused by bad network bytes. However, it attempts to do this by mutating the checksum, setting the second address byte to a fixed value that happens to match the checksum mutation, and checking for a checksum failure when the result is decoded using the same network used when generating the address.
It's not clear why the test is structured this way. What it's really doing is simulating the effect of two mutations, which the checksum algorithm is not guaranteed to detect (and which has caused CI failures).
This PR restructures the test to perform two separate but related tests.
In the first test, we generate a valid address on one network and attempt to decode it for another network. The checksum algorithm guarantees this will always be detected. In the second test, we mutate the checksum and attempt to decode it for the same network. The checksum algorithm guarantees this will also always be detected.
How Has This Been Tested?
Updated test passes. Manually ran 100000 iterations to ensure no obvious spurious failures occur.