2019-12-04 06:59:59 -08:00
|
|
|
#!/usr/bin/env python3
|
2016-03-19 12:58:06 -07:00
|
|
|
# Copyright (c) 2015-2016 The Bitcoin Core developers
|
2015-11-08 23:40:46 -08:00
|
|
|
# Distributed under the MIT software license, see the accompanying
|
2019-07-18 07:16:09 -07:00
|
|
|
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
|
2015-11-08 23:40:46 -08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Exercise API with -disablewallet.
|
|
|
|
#
|
|
|
|
|
|
|
|
from test_framework.test_framework import BitcoinTestFramework
|
2016-05-14 04:01:31 -07:00
|
|
|
from test_framework.util import start_nodes
|
2017-06-20 13:09:33 -07:00
|
|
|
|
2015-11-08 23:40:46 -08:00
|
|
|
|
|
|
|
class DisableWalletTest (BitcoinTestFramework):
|
|
|
|
|
2016-05-14 04:01:31 -07:00
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
self.setup_clean_chain = True
|
|
|
|
self.num_nodes = 1
|
2015-11-08 23:40:46 -08:00
|
|
|
|
|
|
|
def setup_network(self, split=False):
|
2016-05-14 04:01:31 -07:00
|
|
|
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [['-disablewallet']])
|
2015-11-08 23:40:46 -08:00
|
|
|
self.is_network_split = False
|
|
|
|
self.sync_all()
|
|
|
|
|
|
|
|
def run_test (self):
|
|
|
|
# Check regression: https://github.com/bitcoin/bitcoin/issues/6963#issuecomment-154548880
|
2017-02-28 12:49:22 -08:00
|
|
|
x = self.nodes[0].validateaddress('t3b1jtLvxCstdo1pJs9Tjzc5dmWyvGQSZj8')
|
2015-11-08 23:40:46 -08:00
|
|
|
assert(x['isvalid'] == False)
|
2017-02-28 12:49:22 -08:00
|
|
|
x = self.nodes[0].validateaddress('tmGqwWtL7RsbxikDSN26gsbicxVr2xJNe86')
|
2015-11-08 23:40:46 -08:00
|
|
|
assert(x['isvalid'] == True)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
DisableWalletTest ().main ()
|