@@ -384,6 +384,72 @@ pub struct GetChainTxStats {
384384 pub tx_rate : Option < u32 > ,
385385}
386386
387+ /// Models the result of JSON-RPC method `getdeploymentinfo`.
388+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
389+ #[ serde( deny_unknown_fields) ]
390+ pub struct GetDeploymentInfo {
391+ /// Requested block hash (or tip).
392+ pub hash : BlockHash ,
393+ /// Requested block height (or tip).
394+ pub height : u32 ,
395+ /// Deployments info, keyed by deployment name.
396+ pub deployments : std:: collections:: BTreeMap < String , DeploymentInfo > ,
397+ }
398+
399+ /// Deployment info. Returned as part of `getdeploymentinfo`.
400+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
401+ #[ serde( deny_unknown_fields) ]
402+ pub struct DeploymentInfo {
403+ /// One of "buried", "bip9".
404+ pub deployment_type : String ,
405+ /// Height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status).
406+ pub height : Option < u32 > ,
407+ /// True if the rules are enforced for the mempool and the next block.
408+ pub active : bool ,
409+ /// Status of bip9 softforks (only for "bip9" type).
410+ pub bip9 : Option < Bip9Info > ,
411+ }
412+
413+ /// Status of bip9 softforks. Returned as part of `getdeploymentinfo`.
414+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
415+ #[ serde( deny_unknown_fields) ]
416+ pub struct Bip9Info {
417+ /// The bit (0-28) in the block version field used to signal this softfork (only for "started" and "locked_in" status).
418+ pub bit : Option < u8 > ,
419+ /// The minimum median time past of a block at which the bit gains its meaning.
420+ pub start_time : i64 ,
421+ /// The median time past of a block at which the deployment is considered failed if not yet locked in.
422+ pub timeout : i64 ,
423+ /// Minimum height of blocks for which the rules may be enforced.
424+ pub min_activation_height : u32 ,
425+ /// Status of deployment at specified block (one of "defined", "started", "locked_in", "active", "failed").
426+ pub status : String ,
427+ /// Height of the first block to which the status applies.
428+ pub since : u32 ,
429+ /// Status of deployment at the next block.
430+ pub status_next : String ,
431+ /// Numeric statistics about signalling for a softfork (only for "started" and "locked_in" status).
432+ pub statistics : Option < Bip9Statistics > ,
433+ /// Indicates blocks that signalled with a # and blocks that did not with a -.
434+ pub signalling : Option < String > ,
435+ }
436+
437+ /// Numeric statistics about signalling for a softfork. Returned as part of `getdeploymentinfo`.
438+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
439+ #[ serde( deny_unknown_fields) ]
440+ pub struct Bip9Statistics {
441+ /// The length in blocks of the signalling period.
442+ pub period : u32 ,
443+ /// The number of blocks with the version bit set required to activate the feature (only for "started" status).
444+ pub threshold : Option < u32 > ,
445+ /// The number of blocks elapsed since the beginning of the current period.
446+ pub elapsed : u32 ,
447+ /// The number of blocks with the version bit set in the current period.
448+ pub count : u32 ,
449+ /// Returns false if there are not enough blocks left in this period to pass activation threshold (only for "started" status).
450+ pub possible : Option < bool > ,
451+ }
452+
387453/// Models the result of JSON-RPC method `getdifficulty`.
388454#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
389455#[ serde( deny_unknown_fields) ]
0 commit comments