diff options
| author | Ross Nicoll <[email protected]> | 2017-04-18 16:52:01 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2018-09-19 19:21:49 +0100 |
| commit | 3cff8e9773332283a5471771edcdbd1fd9a07b21 (patch) | |
| tree | 4aaa94fe16ee5e1261be03727470e7f99b71bc80 /src/test/test_bitcoin.cpp | |
| parent | Add Dogecoin block subsidy calculations. (diff) | |
| download | discoin-3cff8e9773332283a5471771edcdbd1fd9a07b21.tar.xz discoin-3cff8e9773332283a5471771edcdbd1fd9a07b21.zip | |
Replace test data with Dogecoin values
Replace test data with Dogecoin equivalents in the folowing tests:
* base58
* bip32
* keys
* miner
* pow
Replace RPC and deterministic signatures in unit tests with Dogecoin values. While
conventionally I'd use an alternative implementation for these, as RFC 6979
compliant signature generation isn't terribly common, and there's no reason
to suspect we've modified this code, I'm going to assert that it's good enough
to test that the code doesn't provide different values.
Disabled Bitcoin PoW tests, but left code in place to simplify later merges. These are
replaced by the Dogecoin PoW tests.
Diffstat (limited to 'src/test/test_bitcoin.cpp')
| -rw-r--r-- | src/test/test_bitcoin.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 4785415e3..e9af8f1c6 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -95,9 +95,9 @@ TestingSetup::~TestingSetup() boost::filesystem::remove_all(pathTemp); } -TestChain100Setup::TestChain100Setup() : TestingSetup(CBaseChainParams::REGTEST) +TestChain240Setup::TestChain240Setup() : TestingSetup(CBaseChainParams::REGTEST) { - // Generate a 100-block chain: + // Generate a 240-block chain: coinbaseKey.MakeNewKey(true); CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG; for (int i = 0; i < COINBASE_MATURITY; i++) @@ -113,7 +113,7 @@ TestChain100Setup::TestChain100Setup() : TestingSetup(CBaseChainParams::REGTEST) // scriptPubKey, and try to add it to the current chain. // CBlock -TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey) +TestChain240Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey) { const CChainParams& chainparams = Params(); std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey); @@ -127,7 +127,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& unsigned int extraNonce = 0; IncrementExtraNonce(&block, chainActive.Tip(), extraNonce); - while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce; + while (!CheckProofOfWork(block.GetPoWHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce; std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block); ProcessNewBlock(chainparams, shared_pblock, true, NULL); @@ -136,7 +136,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& return result; } -TestChain100Setup::~TestChain100Setup() +TestChain240Setup::~TestChain240Setup() { } |