Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New community fund addresses #440

Merged
merged 3 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions qa/pull-tester/rpc-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ testScripts=(
'getblockexpanded.py'
'sc_rpc_cmds_json_output.py'
'sc_getscgenesisinfo.py'
'fundaddresses.py'
);
testScriptsExt=(
'getblocktemplate_longpoll.py'
Expand Down
81 changes: 81 additions & 0 deletions qa/rpc-tests/fundaddresses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2018 The Zencash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import SC_VERSION_FORK_HEIGHT, BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, start_nodes, mark_logs

NUMB_OF_NODES = 1
DEBUG_MODE = 1

class FundAddressesTest(BitcoinTestFramework):

def setup_chain(self, split=False):
print("Initializing test directory " + self.options.tmpdir)
initialize_chain_clean(self.options.tmpdir, NUMB_OF_NODES)

def setup_network(self, split=False):
self.nodes = []

self.nodes = start_nodes(NUMB_OF_NODES, self.options.tmpdir)

self.is_network_split = split
self.sync_all()

def check_block_fund_addresses(self, block_hash, expected_addresses):
block_data = self.nodes[0].getblock(block_hash, 1)
tx_data = block_data["tx"]
for tx in tx_data:
vout_data = self.nodes[0].getrawtransaction(tx, 1)["vout"]

# We expect the coinbase transaction to have one output for each fund address
# (foundation one is always mandatory, secure node and super node ones only starting from fork 3)
# and one output for the miner reward.
assert_equal(len(vout_data), len(expected_addresses) + 1)

for i in range(1, len(vout_data)):
vout = vout_data[i]
assert_equal(vout["scriptPubKey"]["addresses"][0], expected_addresses[i - 1])

def run_test(self):

'''
This test checks that the right addresses are used for community, securenode and supernode funds
when mining blocks.
'''

# network topology: (0)

mark_logs("Node 0 generates 500 blocks", self.nodes, DEBUG_MODE)
blocks = self.nodes[0].generate(500)
self.sync_all()

# Consider that blocks[0] is not the genesis block but the block at height 1 (second block)
# For this reason, all fork heights must be decreased by 1

current_fork_height = 1 - 1 # chainsplit fork
mark_logs("Check chainsplit fork address [height = {}]".format(current_fork_height + 1), self.nodes, DEBUG_MODE)
self.check_block_fund_addresses(blocks[current_fork_height], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD"])
self.check_block_fund_addresses(blocks[current_fork_height + 1], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD"])

current_fork_height = 101 - 1 # community fund fork
mark_logs("Check community fund fork address [height = {}]".format(current_fork_height + 1), self.nodes, DEBUG_MODE)
self.check_block_fund_addresses(blocks[current_fork_height - 1], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD"])
self.check_block_fund_addresses(blocks[current_fork_height], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD"])
self.check_block_fund_addresses(blocks[current_fork_height + 1], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD"])

current_fork_height = 105 - 1 # null transaction fork
mark_logs("Check null transaction fork addresses [height = {}]".format(current_fork_height + 1), self.nodes, DEBUG_MODE)
self.check_block_fund_addresses(blocks[current_fork_height - 1], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD"])
self.check_block_fund_addresses(blocks[current_fork_height], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD", "zrQG6x9j33DLbCfzAqu3qKMe7z1VDL1z2L7", "zrMasbhB1yyfQ5RBUm7NPcEjGWZdRneWCEx"])
self.check_block_fund_addresses(blocks[current_fork_height + 1], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD", "zrQG6x9j33DLbCfzAqu3qKMe7z1VDL1z2L7", "zrMasbhB1yyfQ5RBUm7NPcEjGWZdRneWCEx"])

current_fork_height = SC_VERSION_FORK_HEIGHT - 1 # sidechain version fork
mark_logs("Check sidechain version fork addresses [height = {}]".format(current_fork_height + 1), self.nodes, DEBUG_MODE)
self.check_block_fund_addresses(blocks[current_fork_height - 1], ["zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD", "zrQG6x9j33DLbCfzAqu3qKMe7z1VDL1z2L7", "zrMasbhB1yyfQ5RBUm7NPcEjGWZdRneWCEx"])
self.check_block_fund_addresses(blocks[current_fork_height], ["zrLaR63UYCHVvo5BJHoMUTuZFPmcUu866wB", "zrPaU1KWpNrg5fcLsSk17z7cc71FvnVnXxi", "zrMna8FbuTyrvFikAsmQMyAfufF3WoGksFu"])
self.check_block_fund_addresses(blocks[current_fork_height + 1], ["zrLaR63UYCHVvo5BJHoMUTuZFPmcUu866wB", "zrPaU1KWpNrg5fcLsSk17z7cc71FvnVnXxi", "zrMna8FbuTyrvFikAsmQMyAfufF3WoGksFu"])

if __name__ == '__main__':
FundAddressesTest().main()
2 changes: 1 addition & 1 deletion src/gtest/test_checkblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ TEST(ContextualCheckBlock, SidechainCreationVersion)
{
SelectParams(CBaseChainParams::MAIN);

int sidechainVersionForkHeight = 2000000;
int sidechainVersionForkHeight = 1127000;

// Create a Sidechain Creation transaction with version 0
CMutableTransaction mtx_v0 = txCreationUtils::createNewSidechainTxWith(CAmount(10));
Expand Down
138 changes: 132 additions & 6 deletions src/gtest/test_forkmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,33 @@ TEST(ForkManager, SelectNetworkAfterChainsplit) {
EXPECT_TRUE(ForkManager::getInstance().isAfterChainsplit(110001));
}

TEST(ForkManager, GetCommunityFundAddressRegtest) {
SelectParams(CBaseChainParams::REGTEST);
Fork::CommunityFundType foundation = Fork::CommunityFundType::FOUNDATION;

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(0, 840000, foundation),"");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1 - 1, 840000, foundation),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1, 840000, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1 + 1, 840000, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101 - 1, 840000, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101, 840000, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101 + 1, 840000, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105 - 1, 840000, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105, 840000, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105 + 1, 840000, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450 - 1, 0, foundation),"zrQWJd1fhtkQtrjbYPXfHFF1c61DUtiXcCD");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450, 0, foundation),"zrLaR63UYCHVvo5BJHoMUTuZFPmcUu866wB");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450 + 1, 0, foundation),"zrLaR63UYCHVvo5BJHoMUTuZFPmcUu866wB");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, foundation),"zrLaR63UYCHVvo5BJHoMUTuZFPmcUu866wB");
}

TEST(ForkManager, GetCommunityFundAddressTestnet) {
SelectParams(CBaseChainParams::TESTNET);
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(70000,840000, Fork::CommunityFundType::FOUNDATION),"");
Expand All @@ -123,6 +150,14 @@ TEST(ForkManager, GetCommunityFundAddressTestnet) {
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(85500,840000, Fork::CommunityFundType::FOUNDATION),"zrRBQ5heytPMN5nY3ssPf3cG4jocXeD8fm1");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(260499,840000, Fork::CommunityFundType::FOUNDATION),"zrRBQ5heytPMN5nY3ssPf3cG4jocXeD8fm1");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(260500,840000, Fork::CommunityFundType::FOUNDATION),"zrFzxutppvxEdjyu4QNjogBMjtC1py9Hp1S");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900 - 1, 0, Fork::CommunityFundType::FOUNDATION),"zrFzxutppvxEdjyu4QNjogBMjtC1py9Hp1S");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900, 0, Fork::CommunityFundType::FOUNDATION),"zrFwQjR613EuvLSufoNvUzZrfKvjSQx5a23");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900 + 1, 0, Fork::CommunityFundType::FOUNDATION),"zrFwQjR613EuvLSufoNvUzZrfKvjSQx5a23");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, Fork::CommunityFundType::FOUNDATION),"zrFwQjR613EuvLSufoNvUzZrfKvjSQx5a23");
}

TEST(ForkManager, GetCommunityFundAddressMainnet) {
Expand All @@ -143,26 +178,120 @@ TEST(ForkManager, GetCommunityFundAddressMainnet) {
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(339200,840000, Fork::CommunityFundType::FOUNDATION),"zsyF68hcYYNLPj5i4PfQJ1kUY6nsFnZkc82");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(344699,840000, Fork::CommunityFundType::FOUNDATION),"zsyF68hcYYNLPj5i4PfQJ1kUY6nsFnZkc82");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(344700,840000, Fork::CommunityFundType::FOUNDATION),"zszpcLB6C5B8QvfDbF2dYWXsrpac5DL9WRk");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000 - 1, 0, Fork::CommunityFundType::FOUNDATION),"zszpcLB6C5B8QvfDbF2dYWXsrpac5DL9WRk");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000, 0, Fork::CommunityFundType::FOUNDATION),"zshX5BAgUvNgM1VoBVKZyFVVozTDjjJvRxJ");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000 + 1, 0, Fork::CommunityFundType::FOUNDATION),"zshX5BAgUvNgM1VoBVKZyFVVozTDjjJvRxJ");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, Fork::CommunityFundType::FOUNDATION),"zshX5BAgUvNgM1VoBVKZyFVVozTDjjJvRxJ");
}

TEST(ForkManager, GetSecureNodeFundAddressRegtest) {
SelectParams(CBaseChainParams::REGTEST);
Fork::CommunityFundType securenode = Fork::CommunityFundType::SECURENODE;

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(0, 840000, securenode),"");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1 - 1, 840000, securenode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1, 840000, securenode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1 + 1, 840000, securenode),"");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101 - 1, 840000, securenode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101, 840000, securenode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101 + 1, 840000, securenode),"");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105 - 1, 840000, securenode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105, 840000, securenode),"zrQG6x9j33DLbCfzAqu3qKMe7z1VDL1z2L7");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105 + 1, 840000, securenode),"zrQG6x9j33DLbCfzAqu3qKMe7z1VDL1z2L7");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450 - 1, 0, securenode),"zrQG6x9j33DLbCfzAqu3qKMe7z1VDL1z2L7");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450, 0, securenode),"zrPaU1KWpNrg5fcLsSk17z7cc71FvnVnXxi");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450 + 1, 0, securenode),"zrPaU1KWpNrg5fcLsSk17z7cc71FvnVnXxi");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, securenode),"zrPaU1KWpNrg5fcLsSk17z7cc71FvnVnXxi");
}

TEST(ForkManager, GetSecureNodeFundAddressTestnet) {
SelectParams(CBaseChainParams::TESTNET);
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(260500,840000, Fork::CommunityFundType::SECURENODE),"zrS7QUB2eDbbKvyP43VJys3t7RpojW8GdxH");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900 - 1, 0, Fork::CommunityFundType::SECURENODE),"zrS7QUB2eDbbKvyP43VJys3t7RpojW8GdxH");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900, 0, Fork::CommunityFundType::SECURENODE),"zrQM7AZ1qpm9TPzLc2YinGhWePt7vaHz4Rg");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900 + 1, 0, Fork::CommunityFundType::SECURENODE),"zrQM7AZ1qpm9TPzLc2YinGhWePt7vaHz4Rg");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, Fork::CommunityFundType::SECURENODE),"zrQM7AZ1qpm9TPzLc2YinGhWePt7vaHz4Rg");
}

TEST(ForkManager, GetSecureNodeFundAddressMainnet) {
SelectParams(CBaseChainParams::MAIN);
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(344700,840000, Fork::CommunityFundType::SECURENODE),"zsxWnyDbU8pk2Vp98Uvkx5Nh33RFzqnCpWN");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000 - 1, 0, Fork::CommunityFundType::SECURENODE),"zsxWnyDbU8pk2Vp98Uvkx5Nh33RFzqnCpWN");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000, 0, Fork::CommunityFundType::SECURENODE),"zsx68qSKMNoc1ZPQpGwNFZXVzgf27KN6a9u");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000 + 1, 0, Fork::CommunityFundType::SECURENODE),"zsx68qSKMNoc1ZPQpGwNFZXVzgf27KN6a9u");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, Fork::CommunityFundType::SECURENODE),"zsx68qSKMNoc1ZPQpGwNFZXVzgf27KN6a9u");
}

TEST(ForkManager, GetSuperNodeFundAddressRegtest) {
SelectParams(CBaseChainParams::REGTEST);
Fork::CommunityFundType supernode = Fork::CommunityFundType::SUPERNODE;

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(0, 840000, supernode),"");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1 - 1, 840000, supernode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1, 840000, supernode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1 + 1, 840000, supernode),"");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101 - 1, 840000, supernode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101, 840000, supernode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(101 + 1, 840000, supernode),"");

EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105 - 1, 840000, supernode),"");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105, 840000, supernode),"zrMasbhB1yyfQ5RBUm7NPcEjGWZdRneWCEx");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(105 + 1, 840000, supernode),"zrMasbhB1yyfQ5RBUm7NPcEjGWZdRneWCEx");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450 - 1, 0, supernode),"zrMasbhB1yyfQ5RBUm7NPcEjGWZdRneWCEx");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450, 0, supernode),"zrMna8FbuTyrvFikAsmQMyAfufF3WoGksFu");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(450 + 1, 0, supernode),"zrMna8FbuTyrvFikAsmQMyAfufF3WoGksFu");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, supernode),"zrMna8FbuTyrvFikAsmQMyAfufF3WoGksFu");
}

TEST(ForkManager, GetSuperNodeFundAddressTestnet) {
SelectParams(CBaseChainParams::TESTNET);
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(260500,840000, Fork::CommunityFundType::SUPERNODE),"zrFr5HVm7woVq3oFzkMEdJdbfBchfPAPDsP");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900 - 1, 0, Fork::CommunityFundType::SUPERNODE),"zrFr5HVm7woVq3oFzkMEdJdbfBchfPAPDsP");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900, 0, Fork::CommunityFundType::SUPERNODE),"zrSRNSqeBNEtXqn8NkAgJ9gwhLTJmXjKqoX");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1028900 + 1, 0, Fork::CommunityFundType::SUPERNODE),"zrSRNSqeBNEtXqn8NkAgJ9gwhLTJmXjKqoX");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, Fork::CommunityFundType::SUPERNODE),"zrSRNSqeBNEtXqn8NkAgJ9gwhLTJmXjKqoX");
}

TEST(ForkManager, GetSuperNodeFundAddressMainnet) {
SelectParams(CBaseChainParams::MAIN);
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(344700,840000, Fork::CommunityFundType::SUPERNODE),"zsnL6pKdzvZ1BPVzALUoqw2KsY966XFs5CE");

// Test the new addresses introduced in the hard fork 9 (sidechain version)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000 - 1, 0, Fork::CommunityFundType::SUPERNODE),"zsnL6pKdzvZ1BPVzALUoqw2KsY966XFs5CE");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000, 0, Fork::CommunityFundType::SUPERNODE),"zszMgcogAqz49sLHGV22YCDFSvwzwkfog4k");
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(1127000 + 1, 0, Fork::CommunityFundType::SUPERNODE),"zszMgcogAqz49sLHGV22YCDFSvwzwkfog4k");

// Test the highest possible block (for spotting potential regressions)
EXPECT_EQ(ForkManager::getInstance().getCommunityFundAddress(INT_MAX, 0, Fork::CommunityFundType::SUPERNODE),"zszMgcogAqz49sLHGV22YCDFSvwzwkfog4k");
}

TEST(ForkManager, GetMinimumTimeTestnet) {
Expand Down Expand Up @@ -291,8 +420,7 @@ TEST(ForkManager, SidechainForkMainnet) {
TEST(ForkManager, SidechainVersionForkMainnet) {
SelectParams(CBaseChainParams::MAIN);

// TODO: set proper fork height value.
int sidechainVersionForkHeight = 2000000;
int sidechainVersionForkHeight = 1127000;
EXPECT_EQ(ForkManager::getInstance().getMaxSidechainVersion(0), 0);
EXPECT_EQ(ForkManager::getInstance().getMaxSidechainVersion(sidechainVersionForkHeight - 1), 0);
EXPECT_EQ(ForkManager::getInstance().getMaxSidechainVersion(sidechainVersionForkHeight), 1);
Expand All @@ -302,8 +430,7 @@ TEST(ForkManager, SidechainVersionForkMainnet) {
TEST(ForkManager, SidechainVersionForkTestnet) {
SelectParams(CBaseChainParams::TESTNET);

// TODO: set proper fork height value.
int sidechainVersionForkHeight = 2000000;
int sidechainVersionForkHeight = 1028900;
EXPECT_EQ(ForkManager::getInstance().getMaxSidechainVersion(0), 0);
EXPECT_EQ(ForkManager::getInstance().getMaxSidechainVersion(sidechainVersionForkHeight - 1), 0);
EXPECT_EQ(ForkManager::getInstance().getMaxSidechainVersion(sidechainVersionForkHeight), 1);
Expand All @@ -313,7 +440,6 @@ TEST(ForkManager, SidechainVersionForkTestnet) {
TEST(ForkManager, SidechainVersionForkRegtest) {
SelectParams(CBaseChainParams::REGTEST);

// TODO: set proper fork height value.
int sidechainVersionForkHeight = 450;
EXPECT_EQ(ForkManager::getInstance().getMaxSidechainVersion(0), 0);
EXPECT_EQ(ForkManager::getInstance().getMaxSidechainVersion(sidechainVersionForkHeight - 1), 0);
Expand All @@ -325,4 +451,4 @@ TEST(ForkManager, HighestFork) {
SelectParams(CBaseChainParams::MAIN);
const Fork* highestFork = ForkManager::getInstance().getHighestFork();
EXPECT_EQ(typeid(*highestFork), typeid(SidechainVersionFork));
}
}
Loading