Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_multiwallet.py
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# 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(-1, "BerkeleyBatch: Can't open database w8_copy (duplicates fileid", | assert_raises_rpc_error(-1, "BerkeleyBatch: Can't open database w8_copy (duplicates fileid", | ||||
self.nodes[0].loadwallet, 'w8_copy') | self.nodes[0].loadwallet, 'w8_copy') | ||||
# Fail to load if wallet file is a symlink | # Fail to load if wallet file is a symlink | ||||
assert_raises_rpc_error(-4, "Wallet file verification failed: Invalid -wallet path 'w8_symlink'", | assert_raises_rpc_error(-4, "Wallet file verification failed: Invalid -wallet path 'w8_symlink'", | ||||
self.nodes[0].loadwallet, 'w8_symlink') | self.nodes[0].loadwallet, 'w8_symlink') | ||||
# Fail to load if a directory is specified that doesn't contain a wallet | |||||
os.mkdir(wallet_dir('empty_wallet_dir')) | |||||
assert_raises_rpc_error(-18, "Directory empty_wallet_dir does not contain a wallet.dat file", | |||||
self.nodes[0].loadwallet, 'empty_wallet_dir') | |||||
self.log.info("Test dynamic wallet creation.") | self.log.info("Test dynamic wallet creation.") | ||||
# Fail to create a wallet if it already exists. | # Fail to create a wallet if it already exists. | ||||
assert_raises_rpc_error(-4, "Wallet w2 already exists.", | assert_raises_rpc_error(-4, "Wallet w2 already exists.", | ||||
self.nodes[0].createwallet, 'w2') | self.nodes[0].createwallet, 'w2') | ||||
# Successfully create a wallet with a new name | # Successfully create a wallet with a new name | ||||
loadwallet_name = self.nodes[0].createwallet('w9') | loadwallet_name = self.nodes[0].createwallet('w9') | ||||
Show All 19 Lines |