@@ -298,6 +298,7 @@ pub mod cmds {
298298 . subcommand ( QueryMetaData :: def ( ) . display_order ( 5 ) )
299299 . subcommand ( QueryTotalSupply :: def ( ) . display_order ( 5 ) )
300300 . subcommand ( QueryEffNativeSupply :: def ( ) . display_order ( 5 ) )
301+ . subcommand ( QueryStakingRewardsRate :: def ( ) . display_order ( 5 ) )
301302 // Actions
302303 . subcommand ( SignTx :: def ( ) . display_order ( 6 ) )
303304 . subcommand ( ShieldedSync :: def ( ) . display_order ( 6 ) )
@@ -373,6 +374,8 @@ pub mod cmds {
373374 Self :: parse_with_ctx ( matches, QueryTotalSupply ) ;
374375 let query_native_supply =
375376 Self :: parse_with_ctx ( matches, QueryEffNativeSupply ) ;
377+ let query_staking_rewards_rate =
378+ Self :: parse_with_ctx ( matches, QueryStakingRewardsRate ) ;
376379 let query_find_validator =
377380 Self :: parse_with_ctx ( matches, QueryFindValidator ) ;
378381 let query_result = Self :: parse_with_ctx ( matches, QueryResult ) ;
@@ -449,6 +452,7 @@ pub mod cmds {
449452 . or ( query_metadata)
450453 . or ( query_total_supply)
451454 . or ( query_native_supply)
455+ . or ( query_staking_rewards_rate)
452456 . or ( query_account)
453457 . or ( sign_tx)
454458 . or ( shielded_sync)
@@ -534,6 +538,7 @@ pub mod cmds {
534538 QueryDelegations ( QueryDelegations ) ,
535539 QueryTotalSupply ( QueryTotalSupply ) ,
536540 QueryEffNativeSupply ( QueryEffNativeSupply ) ,
541+ QueryStakingRewardsRate ( QueryStakingRewardsRate ) ,
537542 QueryFindValidator ( QueryFindValidator ) ,
538543 QueryRawBytes ( QueryRawBytes ) ,
539544 QueryProposal ( QueryProposal ) ,
@@ -2118,6 +2123,36 @@ pub mod cmds {
21182123 }
21192124 }
21202125
2126+ #[ derive( Clone , Debug ) ]
2127+ pub struct QueryStakingRewardsRate (
2128+ pub args:: QueryStakingRewardsRate < args:: CliTypes > ,
2129+ ) ;
2130+
2131+ impl SubCmd for QueryStakingRewardsRate {
2132+ const CMD : & ' static str = "staking-rewards-rate" ;
2133+
2134+ fn parse ( matches : & ArgMatches ) -> Option < Self >
2135+ where
2136+ Self : Sized ,
2137+ {
2138+ matches. subcommand_matches ( Self :: CMD ) . map ( |matches| {
2139+ QueryStakingRewardsRate ( args:: QueryStakingRewardsRate :: parse (
2140+ matches,
2141+ ) )
2142+ } )
2143+ }
2144+
2145+ fn def ( ) -> App {
2146+ App :: new ( Self :: CMD )
2147+ . about ( wrap ! (
2148+ "Query the latest estimate of the staking rewards rate \
2149+ based on the most recent minted inflation amount at the \
2150+ last epoch change."
2151+ ) )
2152+ . add_args :: < args:: QueryStakingRewardsRate < args:: CliTypes > > ( )
2153+ }
2154+ }
2155+
21212156 #[ derive( Clone , Debug ) ]
21222157 pub struct QueryFindValidator ( pub args:: QueryFindValidator < args:: CliTypes > ) ;
21232158
@@ -7157,6 +7192,32 @@ pub mod args {
71577192 }
71587193 }
71597194
7195+ impl Args for QueryStakingRewardsRate < CliTypes > {
7196+ fn parse ( matches : & ArgMatches ) -> Self {
7197+ let query = Query :: parse ( matches) ;
7198+ Self { query }
7199+ }
7200+
7201+ fn def ( app : App ) -> App {
7202+ app. add_args :: < Query < CliTypes > > ( )
7203+ }
7204+ }
7205+
7206+ impl CliToSdk < QueryStakingRewardsRate < SdkTypes > >
7207+ for QueryStakingRewardsRate < CliTypes >
7208+ {
7209+ type Error = std:: convert:: Infallible ;
7210+
7211+ fn to_sdk (
7212+ self ,
7213+ ctx : & mut Context ,
7214+ ) -> Result < QueryStakingRewardsRate < SdkTypes > , Self :: Error > {
7215+ Ok ( QueryStakingRewardsRate :: < SdkTypes > {
7216+ query : self . query . to_sdk ( ctx) ?,
7217+ } )
7218+ }
7219+ }
7220+
71607221 impl Args for QueryFindValidator < CliTypes > {
71617222 fn parse ( matches : & ArgMatches ) -> Self {
71627223 let query = Query :: parse ( matches) ;
0 commit comments