@@ -64,14 +64,14 @@ macro_rules! impl_client_v17__getpeerinfo {
64
64
macro_rules! impl_client_v17__addnode {
65
65
( ) => {
66
66
impl Client {
67
- pub fn add_node( & self , node: & str , command: AddNodeCommand ) -> Result <( ) > {
67
+ pub fn add_node( & self , node: & str , command: AddNodeCommand ) -> Result <AddNode > {
68
68
let params = & [ node. into( ) , serde_json:: to_value( command) ?] ;
69
69
70
70
match self . call( "addnode" , params) {
71
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
72
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
71
+ Ok ( serde_json:: Value :: Null ) => Ok ( AddNode ) ,
72
+ Ok ( ref val) if val. is_null( ) => Ok ( AddNode ) ,
73
73
Ok ( other) => {
74
- Err ( crate :: client_sync :: Error :: Returned ( format!(
74
+ Err ( Error :: Returned ( format!(
75
75
"addnode expected null, got: {}" , other
76
76
) ) )
77
77
} ,
@@ -87,11 +87,11 @@ macro_rules! impl_client_v17__addnode {
87
87
macro_rules! impl_client_v17__clearbanned {
88
88
( ) => {
89
89
impl Client {
90
- pub fn clear_banned( & self ) -> Result <( ) > {
90
+ pub fn clear_banned( & self ) -> Result <ClearBanned > {
91
91
match self . call( "clearbanned" , & [ ] ) {
92
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
93
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
94
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "clearbanned expected null, got: {}" , other) ) ) ,
92
+ Ok ( serde_json:: Value :: Null ) => Ok ( ClearBanned ) ,
93
+ Ok ( ref val) if val. is_null( ) => Ok ( ClearBanned ) ,
94
+ Ok ( other) => Err ( Error :: Returned ( format!( "clearbanned expected null, got: {}" , other) ) ) ,
95
95
Err ( e) => Err ( e. into( ) ) ,
96
96
}
97
97
}
@@ -110,7 +110,7 @@ macro_rules! impl_client_v17__setban {
110
110
command: SetBanCommand ,
111
111
bantime: Option <i64 >,
112
112
absolute: Option <bool >,
113
- ) -> Result <( ) > {
113
+ ) -> Result <SetBan > {
114
114
let mut params: Vec <serde_json:: Value > = vec![ subnet. into( ) , serde_json:: to_value( command) ?, ] ;
115
115
116
116
if bantime. is_some( ) || absolute. is_some( ) {
@@ -122,10 +122,10 @@ macro_rules! impl_client_v17__setban {
122
122
}
123
123
124
124
match self . call( "setban" , & params) {
125
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
126
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
125
+ Ok ( serde_json:: Value :: Null ) => Ok ( SetBan ) ,
126
+ Ok ( ref val) if val. is_null( ) => Ok ( SetBan ) ,
127
127
Ok ( other) => {
128
- Err ( crate :: client_sync :: Error :: Returned ( format!( "setban expected null, got: {}" , other) ) )
128
+ Err ( Error :: Returned ( format!( "setban expected null, got: {}" , other) ) )
129
129
} ,
130
130
Err ( e) => Err ( e. into( ) ) ,
131
131
}
@@ -155,7 +155,7 @@ macro_rules! impl_client_v17__disconnectnode {
155
155
& self ,
156
156
address: Option <& str >,
157
157
nodeid: Option <u64 >,
158
- ) -> Result <( ) > {
158
+ ) -> Result <DisconnectNode > {
159
159
let params: Vec <serde_json:: Value > = match ( address, nodeid) {
160
160
( Some ( addr) , None ) => {
161
161
vec![ addr. into( ) ]
@@ -164,18 +164,18 @@ macro_rules! impl_client_v17__disconnectnode {
164
164
vec![ serde_json:: Value :: String ( String :: new( ) ) , id. into( ) ]
165
165
}
166
166
( Some ( _) , Some ( _) ) => {
167
- return Err ( crate :: client_sync :: Error :: DisconnectNodeArgsBoth ) ;
167
+ return Err ( Error :: DisconnectNodeArgsBoth ) ;
168
168
}
169
169
( None , None ) => {
170
- return Err ( crate :: client_sync :: Error :: DisconnectNodeArgsNone ) ;
170
+ return Err ( Error :: DisconnectNodeArgsNone ) ;
171
171
}
172
172
} ;
173
173
174
174
match self . call( "disconnectnode" , & params) {
175
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
176
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
175
+ Ok ( serde_json:: Value :: Null ) => Ok ( DisconnectNode ) ,
176
+ Ok ( ref val) if val. is_null( ) => Ok ( DisconnectNode ) ,
177
177
Ok ( other) => {
178
- Err ( crate :: client_sync :: Error :: Returned ( format!( "disconnectnode expected null, got: {}" , other) ) )
178
+ Err ( Error :: Returned ( format!( "disconnectnode expected null, got: {}" , other) ) )
179
179
}
180
180
Err ( e) => Err ( e. into( ) ) ,
181
181
}
@@ -189,7 +189,7 @@ macro_rules! impl_client_v17__disconnectnode {
189
189
macro_rules! impl_client_v17__getconnectioncount {
190
190
( ) => {
191
191
impl Client {
192
- pub fn get_connection_count( & self ) -> Result <u64 > {
192
+ pub fn get_connection_count( & self ) -> Result <GetConnectionCount > {
193
193
self . call( "getconnectioncount" , & [ ] )
194
194
}
195
195
}
@@ -201,12 +201,12 @@ macro_rules! impl_client_v17__getconnectioncount {
201
201
macro_rules! impl_client_v17__ping {
202
202
( ) => {
203
203
impl Client {
204
- pub fn ping( & self ) -> Result <( ) > {
204
+ pub fn ping( & self ) -> Result <Ping > {
205
205
match self . call( "ping" , & [ ] ) {
206
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
207
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
206
+ Ok ( serde_json:: Value :: Null ) => Ok ( Ping ) ,
207
+ Ok ( ref val) if val. is_null( ) => Ok ( Ping ) ,
208
208
Ok ( other) => {
209
- Err ( crate :: client_sync :: Error :: Returned ( format!( "ping expected null, got: {}" , other) ) )
209
+ Err ( Error :: Returned ( format!( "ping expected null, got: {}" , other) ) )
210
210
}
211
211
Err ( e) => Err ( e. into( ) ) ,
212
212
}
@@ -220,12 +220,12 @@ macro_rules! impl_client_v17__ping {
220
220
macro_rules! impl_client_v17__setnetworkactive {
221
221
( ) => {
222
222
impl Client {
223
- pub fn set_network_active( & self , state: bool ) -> Result <( ) > {
223
+ pub fn set_network_active( & self , state: bool ) -> Result <SetNetworkActive > {
224
224
match self . call( "setnetworkactive" , & [ state. into( ) ] ) {
225
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
226
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
225
+ Ok ( serde_json:: Value :: Null ) => Ok ( SetNetworkActive ) ,
226
+ Ok ( ref val) if val. is_null( ) => Ok ( SetNetworkActive ) ,
227
227
Ok ( other) => {
228
- Err ( crate :: client_sync :: Error :: Returned ( format!( "setnetworkactive expected null, got: {}" , other) ) )
228
+ Err ( Error :: Returned ( format!( "setnetworkactive expected null, got: {}" , other) ) )
229
229
}
230
230
Err ( e) => Err ( e. into( ) ) ,
231
231
}
@@ -245,7 +245,7 @@ macro_rules! impl_client_v17__importprivkey {
245
245
privkey: & PrivateKey ,
246
246
label: Option <& str >,
247
247
rescan: Option <bool >,
248
- ) -> Result <( ) > {
248
+ ) -> Result <ImportPrivKey > {
249
249
let privkey_wif = privkey. to_wif( ) ;
250
250
let mut params = vec![ privkey_wif. into( ) ] ;
251
251
@@ -258,9 +258,9 @@ macro_rules! impl_client_v17__importprivkey {
258
258
}
259
259
260
260
match self . call( "importprivkey" , & params) {
261
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
262
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
263
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "importprivkey expected null, got: {}" , other) ) ) ,
261
+ Ok ( serde_json:: Value :: Null ) => Ok ( ImportPrivKey ) ,
262
+ Ok ( ref val) if val. is_null( ) => Ok ( ImportPrivKey ) ,
263
+ Ok ( other) => Err ( Error :: Returned ( format!( "importprivkey expected null, got: {}" , other) ) ) ,
264
264
Err ( e) => Err ( e. into( ) ) ,
265
265
}
266
266
}
0 commit comments