File tree 3 files changed +35
-0
lines changed 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ pub mod query {
151
151
pub enum Commands {
152
152
/// Submits the given blob into a namespace.
153
153
Submit ( submit:: Params ) ,
154
+ Block ( block:: Params ) ,
154
155
}
155
156
156
157
pub mod submit {
@@ -179,4 +180,23 @@ pub mod query {
179
180
pub key_management : KeyManagementParams ,
180
181
}
181
182
}
183
+
184
+ pub mod block {
185
+ //! CLI definition for the `query block` subcommand.
186
+
187
+ use super :: SugondatRpcParams ;
188
+ use clap:: Args ;
189
+
190
+ #[ derive( Debug , Args ) ]
191
+ pub struct Params {
192
+ #[ clap( flatten) ]
193
+ pub rpc : SugondatRpcParams ,
194
+
195
+ /// The block number or hash to query.
196
+ ///
197
+ /// If the value is prefixed with `0x`, it is interpreted as a block hash. Otherwise, it
198
+ /// is interpreted as a block number.
199
+ pub block_spec : String ,
200
+ }
201
+ }
182
202
}
Original file line number Diff line number Diff line change
1
+ use anyhow:: Context ;
2
+
3
+ use super :: connect_rpc;
4
+ use crate :: cli:: query:: block:: Params ;
5
+
6
+ pub async fn run ( params : Params ) -> anyhow:: Result < ( ) > {
7
+ let Params {
8
+ rpc,
9
+ block_spec,
10
+ } = params;
11
+ drop ( ( rpc, block_spec) ) ;
12
+ Ok ( ( ) )
13
+ }
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ use crate::{
4
4
} ;
5
5
6
6
mod submit;
7
+ mod block;
7
8
8
9
pub async fn run ( params : Params ) -> anyhow:: Result < ( ) > {
9
10
match params. command {
10
11
Commands :: Submit ( params) => submit:: run ( params) . await ?,
12
+ Commands :: Block ( params) => block:: run ( params) . await ?,
11
13
}
12
14
Ok ( ( ) )
13
15
}
You can’t perform that action at this time.
0 commit comments