Skip to content

Commit 88b84c4

Browse files
Add missing operations to tx op add. (#2177)
Co-authored-by: Leigh <351529+leighmcculloch@users.noreply.github.com>
1 parent a86104d commit 88b84c4

9 files changed

Lines changed: 415 additions & 0 deletions

FULL_HELP_DOCS.md

Lines changed: 274 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::commands::tx::new::claim_claimable_balance;
2+
3+
#[derive(clap::Parser, Debug, Clone)]
4+
#[group(skip)]
5+
pub struct Cmd {
6+
#[command(flatten)]
7+
pub args: super::args::Args,
8+
#[command(flatten)]
9+
pub op: claim_claimable_balance::Cmd,
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::commands::tx::new::create_claimable_balance;
2+
3+
#[derive(clap::Parser, Debug, Clone)]
4+
#[group(skip)]
5+
pub struct Cmd {
6+
#[command(flatten)]
7+
pub args: super::args::Args,
8+
#[command(flatten)]
9+
pub op: create_claimable_balance::Cmd,
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::commands::tx::new::create_passive_sell_offer;
2+
3+
#[derive(clap::Parser, Debug, Clone)]
4+
#[group(skip)]
5+
pub struct Cmd {
6+
#[command(flatten)]
7+
pub args: super::args::Args,
8+
#[command(flatten)]
9+
pub op: create_passive_sell_offer::Cmd,
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::commands::tx::new::manage_buy_offer;
2+
3+
#[derive(clap::Parser, Debug, Clone)]
4+
#[group(skip)]
5+
pub struct Cmd {
6+
#[command(flatten)]
7+
pub args: super::args::Args,
8+
#[command(flatten)]
9+
pub op: manage_buy_offer::Cmd,
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::commands::tx::new::manage_sell_offer;
2+
3+
#[derive(clap::Parser, Debug, Clone)]
4+
#[group(skip)]
5+
pub struct Cmd {
6+
#[command(flatten)]
7+
pub args: super::args::Args,
8+
#[command(flatten)]
9+
pub op: manage_sell_offer::Cmd,
10+
}

cmd/soroban-cli/src/commands/tx/op/add/mod.rs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ mod account_merge;
77
mod args;
88
mod bump_sequence;
99
mod change_trust;
10+
mod claim_claimable_balance;
1011
mod create_account;
12+
mod create_claimable_balance;
13+
mod create_passive_sell_offer;
14+
mod manage_buy_offer;
1115
mod manage_data;
16+
mod manage_sell_offer;
17+
mod path_payment_strict_receive;
18+
mod path_payment_strict_send;
1219
mod payment;
1320
mod set_options;
1421
mod set_trustline_flags;
@@ -22,10 +29,24 @@ pub enum Cmd {
2229
BumpSequence(bump_sequence::Cmd),
2330
#[command(about = help::CHANGE_TRUST)]
2431
ChangeTrust(change_trust::Cmd),
32+
#[command(about = help::CLAIM_CLAIMABLE_BALANCE)]
33+
ClaimClaimableBalance(claim_claimable_balance::Cmd),
2534
#[command(about = help::CREATE_ACCOUNT)]
2635
CreateAccount(create_account::Cmd),
36+
#[command(about = help::CREATE_CLAIMABLE_BALANCE)]
37+
CreateClaimableBalance(create_claimable_balance::Cmd),
38+
#[command(about = help::CREATE_PASSIVE_SELL_OFFER)]
39+
CreatePassiveSellOffer(create_passive_sell_offer::Cmd),
40+
#[command(about = help::MANAGE_BUY_OFFER)]
41+
ManageBuyOffer(manage_buy_offer::Cmd),
2742
#[command(about = help::MANAGE_DATA)]
2843
ManageData(manage_data::Cmd),
44+
#[command(about = help::MANAGE_SELL_OFFER)]
45+
ManageSellOffer(manage_sell_offer::Cmd),
46+
#[command(about = help::PATH_PAYMENT_STRICT_RECEIVE)]
47+
PathPaymentStrictReceive(path_payment_strict_receive::Cmd),
48+
#[command(about = help::PATH_PAYMENT_STRICT_SEND)]
49+
PathPaymentStrictSend(path_payment_strict_send::Cmd),
2950
#[command(about = help::PAYMENT)]
3051
Payment(payment::Cmd),
3152
#[command(about = help::SET_OPTIONS)]
@@ -53,8 +74,23 @@ impl TryFrom<&Cmd> for OperationBody {
5374
Cmd::AccountMerge(account_merge::Cmd { op, .. }) => op.try_into()?,
5475
Cmd::BumpSequence(bump_sequence::Cmd { op, .. }) => op.into(),
5576
Cmd::ChangeTrust(change_trust::Cmd { op, .. }) => op.try_into()?,
77+
Cmd::ClaimClaimableBalance(claim_claimable_balance::Cmd { op, .. }) => op.try_into()?,
5678
Cmd::CreateAccount(create_account::Cmd { op, .. }) => op.try_into()?,
79+
Cmd::CreateClaimableBalance(create_claimable_balance::Cmd { op, .. }) => {
80+
op.try_into()?
81+
}
82+
Cmd::CreatePassiveSellOffer(create_passive_sell_offer::Cmd { op, .. }) => {
83+
op.try_into()?
84+
}
85+
Cmd::ManageBuyOffer(manage_buy_offer::Cmd { op, .. }) => op.try_into()?,
5786
Cmd::ManageData(manage_data::Cmd { op, .. }) => op.into(),
87+
Cmd::ManageSellOffer(manage_sell_offer::Cmd { op, .. }) => op.try_into()?,
88+
Cmd::PathPaymentStrictReceive(path_payment_strict_receive::Cmd { op, .. }) => {
89+
op.try_into()?
90+
}
91+
Cmd::PathPaymentStrictSend(path_payment_strict_send::Cmd { op, .. }) => {
92+
op.try_into()?
93+
}
5894
Cmd::Payment(payment::Cmd { op, .. }) => op.try_into()?,
5995
Cmd::SetOptions(set_options::Cmd { op, .. }) => op.try_into()?,
6096
Cmd::SetTrustlineFlags(set_trustline_flags::Cmd { op, .. }) => op.try_into()?,
@@ -81,16 +117,51 @@ impl Cmd {
81117
tx_envelope_from_input(&cmd.args.tx_xdr)?,
82118
cmd.args.source(),
83119
),
120+
Cmd::ClaimClaimableBalance(cmd) => cmd.op.tx.add_op(
121+
op,
122+
tx_envelope_from_input(&cmd.args.tx_xdr)?,
123+
cmd.args.source(),
124+
),
84125
Cmd::CreateAccount(cmd) => cmd.op.tx.add_op(
85126
op,
86127
tx_envelope_from_input(&cmd.args.tx_xdr)?,
87128
cmd.args.source(),
88129
),
130+
Cmd::CreateClaimableBalance(cmd) => cmd.op.tx.add_op(
131+
op,
132+
tx_envelope_from_input(&cmd.args.tx_xdr)?,
133+
cmd.args.source(),
134+
),
135+
Cmd::CreatePassiveSellOffer(cmd) => cmd.op.tx.add_op(
136+
op,
137+
tx_envelope_from_input(&cmd.args.tx_xdr)?,
138+
cmd.args.source(),
139+
),
140+
Cmd::ManageBuyOffer(cmd) => cmd.op.tx.add_op(
141+
op,
142+
tx_envelope_from_input(&cmd.args.tx_xdr)?,
143+
cmd.args.source(),
144+
),
89145
Cmd::ManageData(cmd) => cmd.op.tx.add_op(
90146
op,
91147
tx_envelope_from_input(&cmd.args.tx_xdr)?,
92148
cmd.args.source(),
93149
),
150+
Cmd::ManageSellOffer(cmd) => cmd.op.tx.add_op(
151+
op,
152+
tx_envelope_from_input(&cmd.args.tx_xdr)?,
153+
cmd.args.source(),
154+
),
155+
Cmd::PathPaymentStrictReceive(cmd) => cmd.op.tx.add_op(
156+
op,
157+
tx_envelope_from_input(&cmd.args.tx_xdr)?,
158+
cmd.args.source(),
159+
),
160+
Cmd::PathPaymentStrictSend(cmd) => cmd.op.tx.add_op(
161+
op,
162+
tx_envelope_from_input(&cmd.args.tx_xdr)?,
163+
cmd.args.source(),
164+
),
94165
Cmd::Payment(cmd) => cmd.op.tx.add_op(
95166
op,
96167
tx_envelope_from_input(&cmd.args.tx_xdr)?,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::commands::tx::new::path_payment_strict_receive;
2+
3+
#[derive(clap::Parser, Debug, Clone)]
4+
#[group(skip)]
5+
pub struct Cmd {
6+
#[command(flatten)]
7+
pub args: super::args::Args,
8+
#[command(flatten)]
9+
pub op: path_payment_strict_receive::Cmd,
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::commands::tx::new::path_payment_strict_send;
2+
3+
#[derive(clap::Parser, Debug, Clone)]
4+
#[group(skip)]
5+
pub struct Cmd {
6+
#[command(flatten)]
7+
pub args: super::args::Args,
8+
#[command(flatten)]
9+
pub op: path_payment_strict_send::Cmd,
10+
}

0 commit comments

Comments
 (0)