unit-e icon indicating copy to clipboard operation
unit-e copied to clipboard

Add assertion for IsValid for CPubKey.GetID()

Open Gnappuraz opened this issue 6 years ago • 1 comments

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.

Gnappuraz avatar Jan 29 '19 15:01 Gnappuraz

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.

scravy avatar Jan 30 '19 11:01 scravy