@@ -17,6 +17,53 @@ use serde::{Deserialize, Serialize};
17
17
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
18
18
pub struct GetBestBlockHash ( pub BlockHash ) ;
19
19
20
+ /// Models the result of JSON-RPC method `getblock` with verbosity set to 0.
21
+ #[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
22
+ pub struct GetBlockVerbosityZero ( pub Block ) ;
23
+
24
+ /// Models the result of JSON-RPC method `getblock` with verbosity set to 1.
25
+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
26
+ pub struct GetBlockVerbosityOne {
27
+ /// The block hash (same as provided) in RPC call.
28
+ pub hash : BlockHash ,
29
+ /// The number of confirmations, or -1 if the block is not on the main chain.
30
+ pub confirmations : i32 ,
31
+ /// The block size.
32
+ pub size : usize ,
33
+ /// The block size excluding witness data.
34
+ pub stripped_size : Option < usize > , // Weight?
35
+ /// The block weight as defined in BIP-141.
36
+ pub weight : Weight ,
37
+ /// The block height or index.
38
+ pub height : usize ,
39
+ /// The block version.
40
+ pub version : block:: Version ,
41
+ /// The block version formatted in hexadecimal.
42
+ pub version_hex : String ,
43
+ /// The merkle root.
44
+ pub merkle_root : String ,
45
+ /// The transaction ids.
46
+ pub tx : Vec < Txid > ,
47
+ /// The block time expressed in UNIX epoch time.
48
+ pub time : usize ,
49
+ /// The median block time expressed in UNIX epoch time.
50
+ pub median_time : Option < usize > ,
51
+ /// The nonce.
52
+ pub nonce : u32 ,
53
+ /// The bits.
54
+ pub bits : CompactTarget ,
55
+ /// The difficulty.
56
+ pub difficulty : f64 ,
57
+ /// Expected number of hashes required to produce the chain up to this block (in hex).
58
+ pub chain_work : Work ,
59
+ /// The number of transactions in the block.
60
+ pub n_tx : u32 ,
61
+ /// The hash of the previous block (if available).
62
+ pub previous_block_hash : Option < BlockHash > ,
63
+ /// The hash of the next block (if available).
64
+ pub next_block_hash : Option < BlockHash > ,
65
+ }
66
+
20
67
/// Models the result of JSON-RPC method `getblockchaininfo`.
21
68
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
22
69
pub struct GetBlockchainInfo {
@@ -129,53 +176,6 @@ pub struct Bip9SoftforkStatistics {
129
176
pub possible : Option < bool > ,
130
177
}
131
178
132
- /// Models the result of JSON-RPC method `getblock` with verbosity set to 0.
133
- #[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
134
- pub struct GetBlockVerbosityZero ( pub Block ) ;
135
-
136
- /// Models the result of JSON-RPC method `getblock` with verbosity set to 1.
137
- #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
138
- pub struct GetBlockVerbosityOne {
139
- /// The block hash (same as provided) in RPC call.
140
- pub hash : BlockHash ,
141
- /// The number of confirmations, or -1 if the block is not on the main chain.
142
- pub confirmations : i32 ,
143
- /// The block size.
144
- pub size : usize ,
145
- /// The block size excluding witness data.
146
- pub stripped_size : Option < usize > , // Weight?
147
- /// The block weight as defined in BIP-141.
148
- pub weight : Weight ,
149
- /// The block height or index.
150
- pub height : usize ,
151
- /// The block version.
152
- pub version : block:: Version ,
153
- /// The block version formatted in hexadecimal.
154
- pub version_hex : String ,
155
- /// The merkle root.
156
- pub merkle_root : String ,
157
- /// The transaction ids.
158
- pub tx : Vec < Txid > ,
159
- /// The block time expressed in UNIX epoch time.
160
- pub time : usize ,
161
- /// The median block time expressed in UNIX epoch time.
162
- pub median_time : Option < usize > ,
163
- /// The nonce.
164
- pub nonce : u32 ,
165
- /// The bits.
166
- pub bits : CompactTarget ,
167
- /// The difficulty.
168
- pub difficulty : f64 ,
169
- /// Expected number of hashes required to produce the chain up to this block (in hex).
170
- pub chain_work : Work ,
171
- /// The number of transactions in the block.
172
- pub n_tx : u32 ,
173
- /// The hash of the previous block (if available).
174
- pub previous_block_hash : Option < BlockHash > ,
175
- /// The hash of the next block (if available).
176
- pub next_block_hash : Option < BlockHash > ,
177
- }
178
-
179
179
/// Models the result of JSON-RPC method `gettxout`.
180
180
#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
181
181
pub struct GetTxOut {
0 commit comments