4
4
//!
5
5
//! Types for methods found under the `== Wallet ==` section of the API docs.
6
6
7
- use serde :: { Deserialize , Serialize } ;
7
+ mod into ;
8
8
9
- use crate :: model ;
9
+ use serde :: { Deserialize , Serialize } ;
10
10
11
11
/// Result of the JSON-RPC method `createwallet`.
12
12
///
@@ -39,17 +39,6 @@ pub struct CreateWallet {
39
39
pub warnings : Option < Vec < String > > ,
40
40
}
41
41
42
- impl CreateWallet {
43
- /// Converts version specific type to a version nonspecific, more strongly typed type.
44
- pub fn into_model ( self ) -> model:: CreateWallet {
45
- // As the content of the deprecated `warning` field would be the same as `warnings`, we
46
- // simply ignore the field, even in case it's set.
47
- model:: CreateWallet { name : self . name , warnings : self . warnings . unwrap_or_default ( ) }
48
- }
49
-
50
- /// Returns the created wallet name.
51
- pub fn name ( self ) -> String { self . into_model ( ) . name }
52
- }
53
42
/// Result of JSON-RPC method `listdescriptors`.
54
43
///
55
44
/// > List descriptors imported into a descriptor-enabled wallet.
@@ -108,18 +97,6 @@ pub struct LoadWallet {
108
97
pub warnings : Option < Vec < String > > ,
109
98
}
110
99
111
- impl LoadWallet {
112
- /// Converts version specific type to a version nonspecific, more strongly typed type.
113
- pub fn into_model ( self ) -> model:: LoadWallet {
114
- // As the content of the deprecated `warning` field would be the same as `warnings`, we
115
- // simply ignore the field, even in case it's set.
116
- model:: LoadWallet { name : self . name , warnings : self . warnings . unwrap_or_default ( ) }
117
- }
118
-
119
- /// Returns the loaded wallet name.
120
- pub fn name ( self ) -> String { self . into_model ( ) . name }
121
- }
122
-
123
100
/// Result of the JSON-RPC method `unloadwallet`.
124
101
///
125
102
/// > unloadwallet ( "wallet_name" load_on_startup )
@@ -141,10 +118,3 @@ pub struct UnloadWallet {
141
118
/// Warning messages, if any, related to loading the wallet.
142
119
pub warnings : Option < Vec < String > > ,
143
120
}
144
-
145
- impl UnloadWallet {
146
- /// Converts version specific type to a version nonspecific, more strongly typed type.
147
- pub fn into_model ( self ) -> model:: UnloadWallet {
148
- model:: UnloadWallet { warnings : self . warnings . unwrap_or_default ( ) }
149
- }
150
- }
0 commit comments