-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6059de0
commit e377b81
Showing
3 changed files
with
43 additions
and
1 deletion.
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,41 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2014-2019 The Bitcoin Core developers | ||
# Copyright (c) DeFi Blockchain Developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php. | ||
"""Test account mining behaviour""" | ||
|
||
from test_framework.test_framework import DefiTestFramework | ||
from test_framework.authproxy import JSONRPCException | ||
from test_framework.util import ( | ||
assert_greater_than, | ||
assert_equal | ||
) | ||
from decimal import Decimal | ||
|
||
class BlockRewardTest(DefiTestFramework): | ||
def set_test_params(self): | ||
self.num_nodes = 1 | ||
self.setup_clean_chain = True | ||
self.extra_args = [['-txnotokens=0', '-amkheight=50', '-eunosheight=100', '-eunosheight=100', '-subsidytest=1']] | ||
|
||
def run_test(self): | ||
node = self.nodes[0] | ||
node.generate(120) | ||
|
||
result = node.listaccounthistory("mine", {"depth":0}) | ||
assert_equal(result[0]["amounts"][0], '134.99983200@DFI') | ||
|
||
account = node.getnewaddress() | ||
txid = node.utxostoaccount({account: "1.1@0"}) | ||
txid = node.utxostoaccount({account: "1.2@0"}) | ||
txid = node.utxostoaccount({account: "1.3@0"}) | ||
node.generate(1) | ||
|
||
result = node.listaccounthistory("mine", {"depth":0}) | ||
for subResult in result: | ||
if subResult["type"] == "blockReward": | ||
assert_greater_than(subResult["amounts"][0], '134.99983200@DFI') | ||
|
||
if __name__ == '__main__': | ||
BlockRewardTest().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