-
-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into elysium-lelantus
- Loading branch information
Showing
81 changed files
with
5,675 additions
and
177 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
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,60 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2017-2021 The Firo Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
"""dip47 sending receiving RPCs QA test. | ||
""" | ||
|
||
from test_framework.test_framework import BitcoinTestFramework | ||
from test_framework.util import * | ||
|
||
class Bip47SendReceive(BitcoinTestFramework): | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.setup_clean_chain = True | ||
self.num_nodes = 3 | ||
|
||
def setup_network(self, split=False): | ||
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir) | ||
connect_nodes_bi(self.nodes,0,1) | ||
connect_nodes_bi(self.nodes,1,2) | ||
connect_nodes_bi(self.nodes,0,2) | ||
self.is_network_split=False | ||
self.sync_all() | ||
|
||
def run_test(self): | ||
|
||
self.nodes[1].generate(1010) | ||
node0_pcode = self.nodes[0].createpcode("node0-pcode0") | ||
|
||
try: | ||
self.nodes[1].setupchannel(node0_pcode) | ||
raise AssertionError('Lelantus balance should be zero') | ||
except JSONRPCException as e: | ||
assert(e.error['code']==-6) | ||
|
||
self.nodes[1].mintlelantus(1) | ||
self.nodes[1].mintlelantus(1) | ||
self.nodes[1].generate(10) | ||
self.nodes[1].setupchannel(node0_pcode) | ||
self.nodes[1].generate(1) | ||
sync_blocks(self.nodes) | ||
self.nodes[1].sendtopcode(node0_pcode, 10) | ||
|
||
self.nodes[1].generate(1) | ||
self.sync_all() | ||
|
||
assert_equal(self.nodes[0].getbalance(), Decimal("10.0001")) | ||
|
||
self.nodes[0].sendtoaddress(self.nodes[2].getaccountaddress(""), 9.99) | ||
|
||
self.sync_all() | ||
self.nodes[1].generate(1) | ||
sync_blocks(self.nodes) | ||
|
||
assert_equal(self.nodes[2].getbalance(), Decimal("9.99")) | ||
|
||
|
||
if __name__ == '__main__': | ||
Bip47SendReceive().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,40 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2017-2021 The Firo Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
"""dip47 sending receiving RPCs QA test. | ||
""" | ||
|
||
from test_framework.test_framework import BitcoinTestFramework | ||
from test_framework.util import * | ||
|
||
class Bip47WalletRestore(BitcoinTestFramework): | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.setup_clean_chain = True | ||
self.num_nodes = 1 | ||
|
||
def setup_network(self, split=False): | ||
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir) | ||
|
||
def run_test(self): | ||
backup_file = os.path.join(self.options.tmpdir, "cleanwallet.bak") | ||
wallet_file = os.path.join(self.options.tmpdir, "node0/regtest/wallet.dat") | ||
self.nodes[0].backupwallet(backup_file) | ||
initial_pcodes = [self.nodes[0].createpcode("pcode" + str(num)) for num in range(0,200)] | ||
assert(len(initial_pcodes) == 200) | ||
|
||
stop_node(self.nodes[0], 0) | ||
os.remove(wallet_file) | ||
shutil.copy(backup_file, wallet_file) | ||
|
||
self.nodes[0] = start_node(0, self.options.tmpdir) | ||
assert(len(self.nodes[0].listpcodes()) == 0) | ||
|
||
for i in range(0, 200): | ||
assert(initial_pcodes[i] == self.nodes[0].createpcode("pcode" + str(i))) | ||
|
||
|
||
if __name__ == '__main__': | ||
Bip47WalletRestore().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
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
Oops, something went wrong.