Skip to main content

soroban_cli/commands/tx/new/
bump_sequence.rs

1use clap::Parser;
2
3use crate::{commands::tx, xdr};
4
5#[derive(Parser, Debug, Clone)]
6#[group(skip)]
7pub struct Cmd {
8    #[command(flatten)]
9    pub tx: tx::Args,
10    #[clap(flatten)]
11    pub op: Args,
12}
13
14#[derive(Debug, clap::Args, Clone)]
15pub struct Args {
16    /// Sequence number to bump to
17    #[arg(long)]
18    pub bump_to: i64,
19}
20
21impl From<&Args> for xdr::OperationBody {
22    fn from(args: &Args) -> Self {
23        xdr::OperationBody::BumpSequence(xdr::BumpSequenceOp {
24            bump_to: args.bump_to.into(),
25        })
26    }
27}
28
29impl From<&Cmd> for xdr::OperationBody {
30    fn from(cmd: &Cmd) -> Self {
31        xdr::OperationBody::BumpSequence(xdr::BumpSequenceOp {
32            bump_to: cmd.op.bump_to.into(),
33        })
34    }
35}