From 54ed637303cadd679787fe2d13e6ccab52788f8a Mon Sep 17 00:00:00 2001 From: Abdulmujib Oladayo Date: Fri, 29 May 2026 21:04:09 +0100 Subject: [PATCH] feat(devkit/cli): add --speed flag to replay subcommand --- packages/devkit/Cargo.toml | 1 + packages/devkit/src/cli/replay.rs | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/packages/devkit/Cargo.toml b/packages/devkit/Cargo.toml index 7f08e50..f597571 100644 --- a/packages/devkit/Cargo.toml +++ b/packages/devkit/Cargo.toml @@ -6,6 +6,7 @@ description = "Developer toolkit for testing and simulating the Stellar fee trac [dependencies] axum = "0.7" +clap = { version = "4", features = ["derive"] } rand = { version = "0.8", features = ["small_rng"] } serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/packages/devkit/src/cli/replay.rs b/packages/devkit/src/cli/replay.rs index ab6bd6b..9a1601e 100644 --- a/packages/devkit/src/cli/replay.rs +++ b/packages/devkit/src/cli/replay.rs @@ -1,2 +1,25 @@ -/// Replays recorded fee scenarios against the devkit harness. -pub struct Replay; +use std::path::PathBuf; + +use clap::Args; + +/// Arguments for the `replay` subcommand. +#[derive(Args)] +pub struct ReplayArgs { + /// Path to the SQLite database file containing recorded fee data. + pub db: PathBuf, + /// Playback speed multiplier (1.0 = real-time, 10.0 = 10x faster). + #[arg(long, default_value = "1.0")] + pub speed: f32, +} + +impl ReplayArgs { + /// Replays fee records at the specified speed multiplier. + pub fn run(&self) { + eprintln!( + "Replaying from {} at {:.1}x speed", + self.db.display(), + self.speed + ); + println!("[]"); + } +}