Skip to content

Commit 95dbd45

Browse files
committed
use current epoch if none was provided
1 parent d912fc6 commit 95dbd45

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

tip-router-operator-cli/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,6 @@ pub enum Commands {
273273
priority_fee_distribution_program_id: Pubkey,
274274

275275
#[arg(long, env)]
276-
epoch: u64,
276+
epoch: Option<u64>,
277277
},
278278
}

tip-router-operator-cli/src/main.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,12 +552,20 @@ async fn main() -> Result<()> {
552552
priority_fee_distribution_program_id,
553553
epoch,
554554
} => {
555-
info!("Getting tip distribution stats for epoch {}...", epoch);
555+
let stats_epoch = if let Some(epoch) = epoch {
556+
epoch
557+
} else {
558+
rpc_client.get_epoch_info().await?.epoch
559+
};
560+
info!(
561+
"Getting tip distribution stats for epoch {}...",
562+
stats_epoch
563+
);
556564
get_tip_distribution_stats(
557565
&rpc_client,
558566
&tip_distribution_program_id,
559567
&priority_fee_distribution_program_id,
560-
epoch,
568+
stats_epoch,
561569
)
562570
.await?;
563571
}

0 commit comments

Comments
 (0)