Add assertion for IsValid for CPubKey.GetID()
Is your feature request related to a problem? Please describe
At the moment we do not check that when we retrieve the keyID, the hash or the sha256 of a CPubKey we are performing an operation over a pubkey that passes the CPubKey.IsValid() check.
Describe the solution you'd like We should add assertions on all the three methods and fix the tests.
Describe alternatives you've considered No alternatives where considered.
Additional context Adding those assertions at the moment causes ~160 unit tests to fail and also several functional test failures.
Adding those assertions at the moment causes ~160 unit tests to fail and also several functional test failures.
I doubt this number. Did you try running the tests using https://gist.github.com/scravy/79613b094196686f9f2e8ed7b1f551e9 ?
Since the tests all execute in a single process and bitcoin has a lot of global state to pollute a single failing test can sometimes look like a hundred failing tests. The gist referenced above runs each test/boost_test_suite individually in it's own right and helps tracing down the test that is actually failing.