@@ -15,6 +15,8 @@ use crate::crypto_helper::{encode_bech32, KESPeriod, OpCert, SerDeShelleyFileFor
15
15
use crate :: entities:: { BlockNumber , ChainPoint , Epoch , SlotNumber , StakeDistribution } ;
16
16
use crate :: { CardanoNetwork , StdResult } ;
17
17
18
+ const CARDANO_ERA : & str = "latest" ;
19
+
18
20
/// `CliRunner` trait defines the asynchronous methods
19
21
/// for interaction with the Cardano CLI.
20
22
#[ async_trait]
@@ -66,7 +68,7 @@ impl CardanoCliRunner {
66
68
fn command_for_utxo ( & self , address : & str , out_file : PathBuf ) -> Command {
67
69
let mut command = self . get_command ( ) ;
68
70
command
69
- . arg ( "latest" )
71
+ . arg ( CARDANO_ERA )
70
72
. arg ( "query" )
71
73
. arg ( "utxo" )
72
74
. arg ( "--address" )
@@ -80,7 +82,10 @@ impl CardanoCliRunner {
80
82
81
83
fn command_for_stake_distribution ( & self ) -> Command {
82
84
let mut command = self . get_command ( ) ;
83
- command. arg ( "latest" ) . arg ( "query" ) . arg ( "stake-distribution" ) ;
85
+ command
86
+ . arg ( CARDANO_ERA )
87
+ . arg ( "query" )
88
+ . arg ( "stake-distribution" ) ;
84
89
self . post_config_command ( & mut command) ;
85
90
86
91
command
@@ -89,7 +94,7 @@ impl CardanoCliRunner {
89
94
fn command_for_stake_snapshot ( & self , stake_pool_id : & str ) -> Command {
90
95
let mut command = self . get_command ( ) ;
91
96
command
92
- . arg ( "latest" )
97
+ . arg ( CARDANO_ERA )
93
98
. arg ( "query" )
94
99
. arg ( "stake-snapshot" )
95
100
. arg ( "--stake-pool-id" )
@@ -102,7 +107,7 @@ impl CardanoCliRunner {
102
107
fn command_for_stake_snapshot_all_pools ( & self ) -> Command {
103
108
let mut command = self . get_command ( ) ;
104
109
command
105
- . arg ( "latest" )
110
+ . arg ( CARDANO_ERA )
106
111
. arg ( "query" )
107
112
. arg ( "stake-snapshot" )
108
113
. arg ( "--all-stake-pools" ) ;
@@ -113,15 +118,15 @@ impl CardanoCliRunner {
113
118
114
119
fn command_for_epoch ( & self ) -> Command {
115
120
let mut command = self . get_command ( ) ;
116
- command. arg ( "latest" ) . arg ( "query" ) . arg ( "tip" ) ;
121
+ command. arg ( CARDANO_ERA ) . arg ( "query" ) . arg ( "tip" ) ;
117
122
self . post_config_command ( & mut command) ;
118
123
119
124
command
120
125
}
121
126
122
127
fn command_for_chain_point ( & self ) -> Command {
123
128
let mut command = self . get_command ( ) ;
124
- command. arg ( "latest" ) . arg ( "query" ) . arg ( "tip" ) ;
129
+ command. arg ( CARDANO_ERA ) . arg ( "query" ) . arg ( "tip" ) ;
125
130
self . post_config_command ( & mut command) ;
126
131
127
132
command
@@ -130,7 +135,7 @@ impl CardanoCliRunner {
130
135
fn command_for_kes_period ( & self , opcert_file : & str ) -> Command {
131
136
let mut command = self . get_command ( ) ;
132
137
command
133
- . arg ( "latest" )
138
+ . arg ( CARDANO_ERA )
134
139
. arg ( "query" )
135
140
. arg ( "kes-period-info" )
136
141
. arg ( "--op-cert-file" )
0 commit comments