@@ -1115,7 +1115,7 @@ impl<'a> serde::Serialize for ImportMultiRequestScriptPubkey<'a> {
1115
1115
/// Note: unlike in bitcoind, `timestamp` defaults to 0.
1116
1116
#[ derive( Clone , PartialEq , Eq , Debug , Default , Serialize ) ]
1117
1117
pub struct ImportMultiRequest < ' a > {
1118
- pub timestamp : ImportMultiRescanSince ,
1118
+ pub timestamp : Timestamp ,
1119
1119
/// If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys.
1120
1120
#[ serde( rename = "desc" , skip_serializing_if = "Option::is_none" ) ]
1121
1121
pub descriptor : Option < & ' a str > ,
@@ -1148,32 +1148,32 @@ pub struct ImportMultiOptions {
1148
1148
}
1149
1149
1150
1150
#[ derive( Clone , PartialEq , Eq , Copy , Debug ) ]
1151
- pub enum ImportMultiRescanSince {
1151
+ pub enum Timestamp {
1152
1152
Now ,
1153
- Timestamp ( u64 ) ,
1153
+ Time ( u64 ) ,
1154
1154
}
1155
1155
1156
- impl serde:: Serialize for ImportMultiRescanSince {
1156
+ impl serde:: Serialize for Timestamp {
1157
1157
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
1158
1158
where
1159
1159
S : serde:: Serializer ,
1160
1160
{
1161
1161
match * self {
1162
- ImportMultiRescanSince :: Now => serializer. serialize_str ( "now" ) ,
1163
- ImportMultiRescanSince :: Timestamp ( timestamp) => serializer. serialize_u64 ( timestamp) ,
1162
+ Timestamp :: Now => serializer. serialize_str ( "now" ) ,
1163
+ Timestamp :: Time ( timestamp) => serializer. serialize_u64 ( timestamp) ,
1164
1164
}
1165
1165
}
1166
1166
}
1167
1167
1168
- impl < ' de > serde:: Deserialize < ' de > for ImportMultiRescanSince {
1168
+ impl < ' de > serde:: Deserialize < ' de > for Timestamp {
1169
1169
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
1170
1170
where
1171
1171
D : serde:: Deserializer < ' de > ,
1172
1172
{
1173
1173
use serde:: de;
1174
1174
struct Visitor ;
1175
1175
impl < ' de > de:: Visitor < ' de > for Visitor {
1176
- type Value = ImportMultiRescanSince ;
1176
+ type Value = Timestamp ;
1177
1177
1178
1178
fn expecting ( & self , formatter : & mut fmt:: Formatter ) -> fmt:: Result {
1179
1179
write ! ( formatter, "unix timestamp or 'now'" )
@@ -1183,15 +1183,15 @@ impl<'de> serde::Deserialize<'de> for ImportMultiRescanSince {
1183
1183
where
1184
1184
E : de:: Error ,
1185
1185
{
1186
- Ok ( ImportMultiRescanSince :: Timestamp ( value) )
1186
+ Ok ( Timestamp :: Time ( value) )
1187
1187
}
1188
1188
1189
1189
fn visit_str < E > ( self , value : & str ) -> Result < Self :: Value , E >
1190
1190
where
1191
1191
E : de:: Error ,
1192
1192
{
1193
1193
if value == "now" {
1194
- Ok ( ImportMultiRescanSince :: Now )
1194
+ Ok ( Timestamp :: Now )
1195
1195
} else {
1196
1196
Err ( de:: Error :: custom ( format ! (
1197
1197
"invalid str '{}', expecting 'now' or unix timestamp" ,
@@ -1204,21 +1204,21 @@ impl<'de> serde::Deserialize<'de> for ImportMultiRescanSince {
1204
1204
}
1205
1205
}
1206
1206
1207
- impl Default for ImportMultiRescanSince {
1207
+ impl Default for Timestamp {
1208
1208
fn default ( ) -> Self {
1209
- ImportMultiRescanSince :: Timestamp ( 0 )
1209
+ Timestamp :: Time ( 0 )
1210
1210
}
1211
1211
}
1212
1212
1213
- impl From < u64 > for ImportMultiRescanSince {
1214
- fn from ( timestamp : u64 ) -> Self {
1215
- ImportMultiRescanSince :: Timestamp ( timestamp )
1213
+ impl From < u64 > for Timestamp {
1214
+ fn from ( t : u64 ) -> Self {
1215
+ Timestamp :: Time ( t )
1216
1216
}
1217
1217
}
1218
1218
1219
- impl From < Option < u64 > > for ImportMultiRescanSince {
1219
+ impl From < Option < u64 > > for Timestamp {
1220
1220
fn from ( timestamp : Option < u64 > ) -> Self {
1221
- timestamp. map_or ( ImportMultiRescanSince :: Now , ImportMultiRescanSince :: Timestamp )
1221
+ timestamp. map_or ( Timestamp :: Now , Timestamp :: Time )
1222
1222
}
1223
1223
}
1224
1224
@@ -1236,6 +1236,25 @@ pub struct ImportMultiResult {
1236
1236
pub error : Option < ImportMultiResultError > ,
1237
1237
}
1238
1238
1239
+ /// A import request for importdescriptors.
1240
+ #[ derive( Clone , PartialEq , Eq , Debug , Default , Serialize ) ]
1241
+ pub struct ImportDescriptors < ' a > {
1242
+ #[ serde( rename = "desc" ) ]
1243
+ pub descriptor : & ' a str ,
1244
+ pub timestamp : Timestamp ,
1245
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1246
+ pub active : Option < bool > ,
1247
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1248
+ pub range : Option < ( usize , usize ) > ,
1249
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1250
+ pub next_index : Option < usize > ,
1251
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1252
+ pub internal : Option < bool > ,
1253
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1254
+ pub label : Option < & ' a str > ,
1255
+
1256
+ }
1257
+
1239
1258
/// Progress toward rejecting pre-softfork blocks
1240
1259
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
1241
1260
pub struct RejectStatus {
0 commit comments