Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_multiwallet.py
Show First 20 Lines • Show All 276 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_equal(set(self.nodes[0].listwallets()), set(wallet_names)) | assert_equal(set(self.nodes[0].listwallets()), set(wallet_names)) | ||||
# Fail to load if wallet doesn't exist | # Fail to load if wallet doesn't exist | ||||
assert_raises_rpc_error(-18, 'Wallet wallets not found.', | assert_raises_rpc_error(-18, 'Wallet wallets not found.', | ||||
self.nodes[0].loadwallet, 'wallets') | self.nodes[0].loadwallet, 'wallets') | ||||
# Fail to load duplicate wallets | # Fail to load duplicate wallets | ||||
path = os.path.join( | |||||
self.options.tmpdir, | |||||
"node0", | |||||
"regtest", | |||||
"wallets", | |||||
"w1", | |||||
"wallet.dat") | |||||
assert_raises_rpc_error( | assert_raises_rpc_error( | ||||
-4, | -4, | ||||
'Wallet file verification failed. Error loading wallet w1. Duplicate -wallet filename specified.', | "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format( | ||||
path), | |||||
self.nodes[0].loadwallet, | self.nodes[0].loadwallet, | ||||
wallet_names[0]) | wallet_names[0]) | ||||
# Fail to load duplicate wallets by different ways (directory and | # Fail to load duplicate wallets by different ways (directory and | ||||
# filepath) | # filepath) | ||||
path = os.path.join( | |||||
self.options.tmpdir, | |||||
"node0", | |||||
"regtest", | |||||
"wallets", | |||||
"wallet.dat") | |||||
assert_raises_rpc_error( | assert_raises_rpc_error( | ||||
-4, | -4, | ||||
"Wallet file verification failed. Error loading wallet wallet.dat. Duplicate -wallet filename specified.", | "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format( | ||||
path), | |||||
self.nodes[0].loadwallet, | self.nodes[0].loadwallet, | ||||
'wallet.dat') | 'wallet.dat') | ||||
# Fail to load if one wallet is a copy of another | # Fail to load if one wallet is a copy of another | ||||
assert_raises_rpc_error(-4, "BerkeleyDatabase: Can't open database w8_copy (duplicates fileid", | assert_raises_rpc_error(-4, "BerkeleyDatabase: Can't open database w8_copy (duplicates fileid", | ||||
self.nodes[0].loadwallet, 'w8_copy') | self.nodes[0].loadwallet, 'w8_copy') | ||||
# Fail to load if one wallet is a copy of another. | # Fail to load if one wallet is a copy of another. | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |