| 70 | namespace { |
| 71 | |
| 72 | bool IsExpectedWitnessProgram(const CScript& script, const int expectedVersion, const std::vector<unsigned char>& expectedProgram) |
| 73 | { |
| 74 | int actualVersion; |
| 75 | std::vector<unsigned char> actualProgram; |
| 76 | if (!script.IsWitnessProgram(actualVersion, actualProgram)) { |
| 77 | return false; |
| 78 | } |
| 79 | BOOST_CHECK_EQUAL(actualVersion, expectedVersion); |
| 80 | BOOST_CHECK(actualProgram == expectedProgram); |
| 81 | return true; |
| 82 | } |
| 83 | |
| 84 | bool IsNoWitnessProgram(const CScript& script) |
| 85 | { |
no test coverage detected