File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -158,11 +158,20 @@ fn wallet__dump_wallet() {
158
158
#[ test]
159
159
fn wallet__encrypt_wallet ( ) {
160
160
let wallet_name = "test-wallet" ;
161
+ let passphrase = "test-passphrase" ;
161
162
let node = Node :: with_wallet ( Wallet :: None , & [ ] ) ;
162
- let _: CreateWallet = node. client . create_wallet ( wallet_name) . expect ( "createwallet" ) ;
163
163
164
- let passphrase = "test-passphrase" ;
165
- let _: EncryptWallet = node. client . encrypt_wallet ( passphrase) . expect ( "encryptwallet" ) ;
164
+ let client = match ( ) {
165
+ #[ cfg( feature = "v20_and_below" ) ]
166
+ ( ) => node. create_wallet ( wallet_name) . expect ( "createwallet" ) ,
167
+ #[ cfg( not( feature = "v20_and_below" ) ) ]
168
+ ( ) => {
169
+ node. client . create_wallet ( wallet_name) . expect ( "createwallet" ) ;
170
+ & node. client
171
+ } ,
172
+ } ;
173
+
174
+ let _: EncryptWallet = client. encrypt_wallet ( passphrase) . expect ( "encryptwallet" ) ;
166
175
}
167
176
168
177
#[ test]
You can’t perform that action at this time.
0 commit comments