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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user