Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864996
D13128.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D13128.diff
View Options
diff --git a/src/test/minerfund_tests.cpp b/src/test/minerfund_tests.cpp
--- a/src/test/minerfund_tests.cpp
+++ b/src/test/minerfund_tests.cpp
@@ -6,8 +6,10 @@
#include <blockindex.h>
#include <chainparams.h>
+#include <consensus/activation.h>
#include <key_io.h> // For DecodeDestination
+#include <test/util/blockindex.h>
#include <test/util/setup_common.h>
#include <boost/test/unit_test.hpp>
@@ -18,7 +20,7 @@
CheckWhitelist(const Consensus::Params &consensusParams,
const CBlockIndex *pindexPrev,
const std::unordered_set<CTxDestination, TxDestinationHasher>
- expectedWhitelist) {
+ &expectedWhitelist) {
auto whitelist = GetMinerFundWhitelist(consensusParams, pindexPrev);
BOOST_CHECK_EQUAL(whitelist.size(), expectedWhitelist.size());
for (const auto &expectedDest : expectedWhitelist) {
@@ -30,7 +32,15 @@
const CChainParams &chainparams = Params();
const Consensus::Params &consensusParams = chainparams.GetConsensus();
- CBlockIndex block;
+ std::array<CBlockIndex, 12> blocks;
+ for (size_t i = 1; i < blocks.size(); ++i) {
+ blocks[i].pprev = &blocks[i - 1];
+ }
+ CBlockIndex &block = blocks.back();
+
+ const auto activation = gArgs.GetIntArg(
+ "-wellingtonactivationtime", consensusParams.wellingtonActivationTime);
+ SetMTP(blocks, activation - 100000);
// Consensus whitelist has not activated yet
block.nHeight = consensusParams.axionHeight - 1;
@@ -53,6 +63,15 @@
"ecash:prfhcnyqnl5cgrnmlfmms675w93ld7mvvqd0y8lz07", chainparams)};
block.nHeight = consensusParams.gluonHeight;
CheckWhitelist(consensusParams, &block, expectedMinerFund);
+
+ // Test address does not change around Wellington activation
+ SetMTP(blocks, activation - 1);
+ BOOST_CHECK(!IsWellingtonEnabled(consensusParams, &blocks.back()));
+ CheckWhitelist(consensusParams, &block, expectedMinerFund);
+
+ SetMTP(blocks, activation);
+ BOOST_CHECK(IsWellingtonEnabled(consensusParams, &blocks.back()));
+ CheckWhitelist(consensusParams, &block, expectedMinerFund);
}
BOOST_AUTO_TEST_SUITE_END()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 21, 00:12 (56 m, 10 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5866193
Default Alt Text
D13128.diff (2 KB)
Attached To
D13128: Improve miner fund whitelist test coverage
Event Timeline
Log In to Comment