encoding,test: backport BIP350 bech32m and align test vectors to Palladium

- use Bech32 for witness v0 and Bech32m for witness v1+ in key_io
- update C++ bech32 tests and python segwit_addr framework
- realign key/address test vectors and fixtures to Palladium prefixes/params
- adjust chain-parameter-sensitive tests (maturity, BIP66/regtest, message verify)
- fix incorrect historical sha256 expected vector in unit tests
This commit is contained in:
2026-02-06 15:23:23 +01:00
parent b1e1451911
commit 613bcdbed7
14 changed files with 324 additions and 132 deletions

View File

@@ -257,6 +257,25 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
pblock->hashPrevBlock = pblock->GetHash();
}
// Palladium uses a higher coinbase maturity than Bitcoin test vectors.
// Advance the active chain with dummy block indices so the imported coinbase
// outputs referenced later in this test are spendable.
{
LOCK(cs_main);
const int spend_height = baseheight + COINBASE_MATURITY + 3;
while (::ChainActive().Tip()->nHeight < spend_height) {
CBlockIndex* prev = ::ChainActive().Tip();
CBlockIndex* next = new CBlockIndex();
next->phashBlock = new uint256(InsecureRand256());
next->nTime = prev->nTime + 1;
::ChainstateActive().CoinsTip().SetBestBlock(next->GetBlockHash());
next->pprev = prev;
next->nHeight = prev->nHeight + 1;
next->BuildSkip();
::ChainActive().SetTip(next);
}
}
LOCK(cs_main);
LOCK(m_node.mempool->cs);