@@ -107,9 +107,9 @@ def stop_three(self):
107
107
self .stop_node (2 )
108
108
109
109
def erase_three (self ):
110
- os .remove (os .path .join (self .nodes [0 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
111
- os .remove (os .path .join (self .nodes [1 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
112
- os .remove (os .path .join (self .nodes [2 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
110
+ os .remove (os .path .join (self .nodes [0 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
111
+ os .remove (os .path .join (self .nodes [1 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
112
+ os .remove (os .path .join (self .nodes [2 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
113
113
114
114
def run_test (self ):
115
115
self .log .info ("Generating initial blockchain" )
@@ -167,13 +167,13 @@ def run_test(self):
167
167
self .erase_three ()
168
168
169
169
# Start node2 with no chain
170
- shutil .rmtree (os .path .join (self .nodes [2 ].datadir , 'regtest' , 'blocks' ))
171
- shutil .rmtree (os .path .join (self .nodes [2 ].datadir , 'regtest' , 'chainstate' ))
170
+ shutil .rmtree (os .path .join (self .nodes [2 ].datadir , self . chain , 'blocks' ))
171
+ shutil .rmtree (os .path .join (self .nodes [2 ].datadir , self . chain , 'chainstate' ))
172
172
173
173
# Restore wallets from backup
174
- shutil .copyfile (os .path .join (self .nodes [0 ].datadir , 'wallet.bak' ), os .path .join (self .nodes [0 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
175
- shutil .copyfile (os .path .join (self .nodes [1 ].datadir , 'wallet.bak' ), os .path .join (self .nodes [1 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
176
- shutil .copyfile (os .path .join (self .nodes [2 ].datadir , 'wallet.bak' ), os .path .join (self .nodes [2 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
174
+ shutil .copyfile (os .path .join (self .nodes [0 ].datadir , 'wallet.bak' ), os .path .join (self .nodes [0 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
175
+ shutil .copyfile (os .path .join (self .nodes [1 ].datadir , 'wallet.bak' ), os .path .join (self .nodes [1 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
176
+ shutil .copyfile (os .path .join (self .nodes [2 ].datadir , 'wallet.bak' ), os .path .join (self .nodes [2 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
177
177
178
178
self .log .info ("Re-starting nodes" )
179
179
self .start_three ()
@@ -188,8 +188,8 @@ def run_test(self):
188
188
self .erase_three ()
189
189
190
190
#start node2 with no chain
191
- shutil .rmtree (os .path .join (self .nodes [2 ].datadir , 'regtest' , 'blocks' ))
192
- shutil .rmtree (os .path .join (self .nodes [2 ].datadir , 'regtest' , 'chainstate' ))
191
+ shutil .rmtree (os .path .join (self .nodes [2 ].datadir , self . chain , 'blocks' ))
192
+ shutil .rmtree (os .path .join (self .nodes [2 ].datadir , self . chain , 'chainstate' ))
193
193
194
194
self .start_three ()
195
195
@@ -209,10 +209,10 @@ def run_test(self):
209
209
210
210
# Backup to source wallet file must fail
211
211
sourcePaths = [
212
- os .path .join (self .nodes [0 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ),
213
- os .path .join (self .nodes [0 ].datadir , 'regtest' , '.' , 'wallets' , 'wallet.dat' ),
214
- os .path .join (self .nodes [0 ].datadir , 'regtest' , 'wallets' , '' ),
215
- os .path .join (self .nodes [0 ].datadir , 'regtest' , 'wallets' )]
212
+ os .path .join (self .nodes [0 ].datadir , self . chain , 'wallets' , 'wallet.dat' ),
213
+ os .path .join (self .nodes [0 ].datadir , self . chain , '.' , 'wallets' , 'wallet.dat' ),
214
+ os .path .join (self .nodes [0 ].datadir , self . chain , 'wallets' , '' ),
215
+ os .path .join (self .nodes [0 ].datadir , self . chain , 'wallets' )]
216
216
217
217
for sourcePath in sourcePaths :
218
218
assert_raises_rpc_error (- 4 , "backup failed" , self .nodes [0 ].backupwallet , sourcePath )
0 commit comments