@@ -1132,7 +1132,7 @@ impl<'a> serde::Serialize for ImportMultiRequestScriptPubkey<'a> {
1132
1132
/// Note: unlike in bitcoind, `timestamp` defaults to 0.
1133
1133
#[ derive( Clone , PartialEq , Eq , Debug , Default , Serialize ) ]
1134
1134
pub struct ImportMultiRequest < ' a > {
1135
- pub timestamp : ImportMultiRescanSince ,
1135
+ pub timestamp : Timestamp ,
1136
1136
/// If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys.
1137
1137
#[ serde( rename = "desc" , skip_serializing_if = "Option::is_none" ) ]
1138
1138
pub descriptor : Option < & ' a str > ,
@@ -1165,32 +1165,32 @@ pub struct ImportMultiOptions {
1165
1165
}
1166
1166
1167
1167
#[ derive( Clone , PartialEq , Eq , Copy , Debug ) ]
1168
- pub enum ImportMultiRescanSince {
1168
+ pub enum Timestamp {
1169
1169
Now ,
1170
- Timestamp ( u64 ) ,
1170
+ Time ( u64 ) ,
1171
1171
}
1172
1172
1173
- impl serde:: Serialize for ImportMultiRescanSince {
1173
+ impl serde:: Serialize for Timestamp {
1174
1174
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
1175
1175
where
1176
1176
S : serde:: Serializer ,
1177
1177
{
1178
1178
match * self {
1179
- ImportMultiRescanSince :: Now => serializer. serialize_str ( "now" ) ,
1180
- ImportMultiRescanSince :: Timestamp ( timestamp) => serializer. serialize_u64 ( timestamp) ,
1179
+ Timestamp :: Now => serializer. serialize_str ( "now" ) ,
1180
+ Timestamp :: Time ( timestamp) => serializer. serialize_u64 ( timestamp) ,
1181
1181
}
1182
1182
}
1183
1183
}
1184
1184
1185
- impl < ' de > serde:: Deserialize < ' de > for ImportMultiRescanSince {
1185
+ impl < ' de > serde:: Deserialize < ' de > for Timestamp {
1186
1186
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
1187
1187
where
1188
1188
D : serde:: Deserializer < ' de > ,
1189
1189
{
1190
1190
use serde:: de;
1191
1191
struct Visitor ;
1192
1192
impl < ' de > de:: Visitor < ' de > for Visitor {
1193
- type Value = ImportMultiRescanSince ;
1193
+ type Value = Timestamp ;
1194
1194
1195
1195
fn expecting ( & self , formatter : & mut fmt:: Formatter ) -> fmt:: Result {
1196
1196
write ! ( formatter, "unix timestamp or 'now'" )
@@ -1200,15 +1200,15 @@ impl<'de> serde::Deserialize<'de> for ImportMultiRescanSince {
1200
1200
where
1201
1201
E : de:: Error ,
1202
1202
{
1203
- Ok ( ImportMultiRescanSince :: Timestamp ( value) )
1203
+ Ok ( Timestamp :: Time ( value) )
1204
1204
}
1205
1205
1206
1206
fn visit_str < E > ( self , value : & str ) -> Result < Self :: Value , E >
1207
1207
where
1208
1208
E : de:: Error ,
1209
1209
{
1210
1210
if value == "now" {
1211
- Ok ( ImportMultiRescanSince :: Now )
1211
+ Ok ( Timestamp :: Now )
1212
1212
} else {
1213
1213
Err ( de:: Error :: custom ( format ! (
1214
1214
"invalid str '{}', expecting 'now' or unix timestamp" ,
@@ -1221,21 +1221,21 @@ impl<'de> serde::Deserialize<'de> for ImportMultiRescanSince {
1221
1221
}
1222
1222
}
1223
1223
1224
- impl Default for ImportMultiRescanSince {
1224
+ impl Default for Timestamp {
1225
1225
fn default ( ) -> Self {
1226
- ImportMultiRescanSince :: Timestamp ( 0 )
1226
+ Timestamp :: Time ( 0 )
1227
1227
}
1228
1228
}
1229
1229
1230
- impl From < u64 > for ImportMultiRescanSince {
1231
- fn from ( timestamp : u64 ) -> Self {
1232
- ImportMultiRescanSince :: Timestamp ( timestamp )
1230
+ impl From < u64 > for Timestamp {
1231
+ fn from ( t : u64 ) -> Self {
1232
+ Timestamp :: Time ( t )
1233
1233
}
1234
1234
}
1235
1235
1236
- impl From < Option < u64 > > for ImportMultiRescanSince {
1236
+ impl From < Option < u64 > > for Timestamp {
1237
1237
fn from ( timestamp : Option < u64 > ) -> Self {
1238
- timestamp. map_or ( ImportMultiRescanSince :: Now , ImportMultiRescanSince :: Timestamp )
1238
+ timestamp. map_or ( Timestamp :: Now , Timestamp :: Time )
1239
1239
}
1240
1240
}
1241
1241
@@ -1253,6 +1253,24 @@ pub struct ImportMultiResult {
1253
1253
pub error : Option < ImportMultiResultError > ,
1254
1254
}
1255
1255
1256
+ /// A import request for importdescriptors.
1257
+ #[ derive( Clone , PartialEq , Eq , Debug , Default , Serialize ) ]
1258
+ pub struct ImportDescriptors < ' a > {
1259
+ #[ serde( rename = "desc" ) ]
1260
+ pub descriptor : & ' a str ,
1261
+ pub timestamp : Timestamp ,
1262
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1263
+ pub active : Option < bool > ,
1264
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1265
+ pub range : Option < ( usize , usize ) > ,
1266
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1267
+ pub next_index : Option < usize > ,
1268
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1269
+ pub internal : Option < bool > ,
1270
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1271
+ pub label : Option < & ' a str > ,
1272
+ }
1273
+
1256
1274
/// Progress toward rejecting pre-softfork blocks
1257
1275
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
1258
1276
pub struct RejectStatus {
0 commit comments