@@ -1132,7 +1132,7 @@ impl<'a> serde::Serialize for ImportMultiRequestScriptPubkey<'a> {
11321132/// Note: unlike in bitcoind, `timestamp` defaults to 0.
11331133#[ derive( Clone , PartialEq , Eq , Debug , Default , Serialize ) ]
11341134pub struct ImportMultiRequest < ' a > {
1135- pub timestamp : ImportMultiRescanSince ,
1135+ pub timestamp : Timestamp ,
11361136 /// If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys.
11371137 #[ serde( rename = "desc" , skip_serializing_if = "Option::is_none" ) ]
11381138 pub descriptor : Option < & ' a str > ,
@@ -1165,32 +1165,32 @@ pub struct ImportMultiOptions {
11651165}
11661166
11671167#[ derive( Clone , PartialEq , Eq , Copy , Debug ) ]
1168- pub enum ImportMultiRescanSince {
1168+ pub enum Timestamp {
11691169 Now ,
1170- Timestamp ( u64 ) ,
1170+ Time ( u64 ) ,
11711171}
11721172
1173- impl serde:: Serialize for ImportMultiRescanSince {
1173+ impl serde:: Serialize for Timestamp {
11741174 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
11751175 where
11761176 S : serde:: Serializer ,
11771177 {
11781178 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) ,
11811181 }
11821182 }
11831183}
11841184
1185- impl < ' de > serde:: Deserialize < ' de > for ImportMultiRescanSince {
1185+ impl < ' de > serde:: Deserialize < ' de > for Timestamp {
11861186 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
11871187 where
11881188 D : serde:: Deserializer < ' de > ,
11891189 {
11901190 use serde:: de;
11911191 struct Visitor ;
11921192 impl < ' de > de:: Visitor < ' de > for Visitor {
1193- type Value = ImportMultiRescanSince ;
1193+ type Value = Timestamp ;
11941194
11951195 fn expecting ( & self , formatter : & mut fmt:: Formatter ) -> fmt:: Result {
11961196 write ! ( formatter, "unix timestamp or 'now'" )
@@ -1200,15 +1200,15 @@ impl<'de> serde::Deserialize<'de> for ImportMultiRescanSince {
12001200 where
12011201 E : de:: Error ,
12021202 {
1203- Ok ( ImportMultiRescanSince :: Timestamp ( value) )
1203+ Ok ( Timestamp :: Time ( value) )
12041204 }
12051205
12061206 fn visit_str < E > ( self , value : & str ) -> Result < Self :: Value , E >
12071207 where
12081208 E : de:: Error ,
12091209 {
12101210 if value == "now" {
1211- Ok ( ImportMultiRescanSince :: Now )
1211+ Ok ( Timestamp :: Now )
12121212 } else {
12131213 Err ( de:: Error :: custom ( format ! (
12141214 "invalid str '{}', expecting 'now' or unix timestamp" ,
@@ -1221,21 +1221,21 @@ impl<'de> serde::Deserialize<'de> for ImportMultiRescanSince {
12211221 }
12221222}
12231223
1224- impl Default for ImportMultiRescanSince {
1224+ impl Default for Timestamp {
12251225 fn default ( ) -> Self {
1226- ImportMultiRescanSince :: Timestamp ( 0 )
1226+ Timestamp :: Time ( 0 )
12271227 }
12281228}
12291229
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 )
12331233 }
12341234}
12351235
1236- impl From < Option < u64 > > for ImportMultiRescanSince {
1236+ impl From < Option < u64 > > for Timestamp {
12371237 fn from ( timestamp : Option < u64 > ) -> Self {
1238- timestamp. map_or ( ImportMultiRescanSince :: Now , ImportMultiRescanSince :: Timestamp )
1238+ timestamp. map_or ( Timestamp :: Now , Timestamp :: Time )
12391239 }
12401240}
12411241
@@ -1253,6 +1253,24 @@ pub struct ImportMultiResult {
12531253 pub error : Option < ImportMultiResultError > ,
12541254}
12551255
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+
12561274/// Progress toward rejecting pre-softfork blocks
12571275#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
12581276pub struct RejectStatus {
0 commit comments