-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* static rewards added * initial test and test util added * added new test to rpc test file * test updated * adding sleep print * removed extra bracket * updated perms. * cleanup test * checking before the soft fork * creating a few blocks to start * removing pre check
- Loading branch information
1 parent
7730c7b
commit 9601f85
Showing
9 changed files
with
153 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2018 The Navcoin Core 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 NavCoinTestFramework | ||
from test_framework.staticr_util import * | ||
|
||
import time | ||
|
||
class StaticRAmountTest(NavCoinTestFramework): | ||
"""Tests the staking amount after softfork activation.""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.setup_clean_chain = True | ||
self.num_nodes = 1 | ||
|
||
def setup_network(self, split=False): | ||
self.nodes = self.setup_nodes() | ||
self.is_network_split = split | ||
|
||
def run_test(self): | ||
|
||
#check the block reward is 2 NAV after the softfork | ||
|
||
activate_staticr(self.nodes[0]) | ||
|
||
blockcount = self.nodes[0].getblockcount() | ||
wallet_info1 = self.nodes[0].getwalletinfo() | ||
|
||
# wait for a new block to be mined | ||
while self.nodes[0].getblockcount() == blockcount: | ||
print("waiting for a new block...") | ||
time.sleep(5) | ||
|
||
assert(blockcount != self.nodes[0].getblockcount()) | ||
|
||
wallet_info2 = self.nodes[0].getwalletinfo() | ||
balance_diff = wallet_info1['balance'] - wallet_info2['balance'] | ||
|
||
# check that only 2 new NAV were created | ||
assert(wallet_info2['immature_balance'] == wallet_info1['immature_balance'] + balance_diff + 2) | ||
|
||
if __name__ == '__main__': | ||
StaticRAmountTest().main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2014-2016 The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
|
||
# | ||
# Expanded helper routines for regression testing of the NAV Coin community fund | ||
# | ||
|
||
from test_framework.util import * | ||
|
||
|
||
def activate_staticr(node): | ||
slow_gen(node, 100) | ||
# Verify the Community Fund is started | ||
assert (get_bip9_status(node, "static")["status"] == "started") | ||
|
||
slow_gen(node, 100) | ||
# Verify the Community Fund is locked_in | ||
assert (get_bip9_status(node, "static")["status"] == "locked_in") | ||
|
||
slow_gen(node, 100) | ||
# Verify the Community Fund is active | ||
assert (get_bip9_status(node, "static")["status"] == "active") | ||
|
||
def end_cycle(node): | ||
# Move to the end of the cycle | ||
slow_gen(node, node.cfundstats()["votingPeriod"]["ending"] - node.cfundstats()["votingPeriod"][ | ||
"current"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters