Skip to content

Commit 7bc48fc

Browse files
committed
refactor: remove duplication on invoke cmd
1 parent 2fee401 commit 7bc48fc

File tree

10 files changed

+475
-442
lines changed

10 files changed

+475
-442
lines changed

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mod explorer;
66
mod output;
77
mod provider;
88
mod store;
9-
mod transaction;
9+
mod tx;
1010
mod types;
1111
mod utils;
1212

@@ -53,8 +53,8 @@ enum Commands {
5353
Provider(provider::Args),
5454

5555
/// Manage Transactions
56-
#[command(alias = "tx")]
57-
Transaction(transaction::Args),
56+
#[command(alias = "transaction")]
57+
Tx(tx::Args),
5858

5959
/// Manage Wallets
6060
Wallet(wallet::Args),
@@ -124,7 +124,7 @@ async fn main() -> miette::Result<()> {
124124

125125
match cli.command {
126126
Commands::Provider(args) => provider::run(args, &mut ctx).await?,
127-
Commands::Transaction(args) => transaction::run(args, &ctx).await?,
127+
Commands::Tx(args) => tx::run(args, &ctx).await?,
128128
Commands::Wallet(args) => wallet::run(args, &mut ctx).await?,
129129
Commands::Explorer(args) => explorer::run(args, &ctx).await?,
130130
};

src/provider/types.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ use crate::{
2020
utils::Name,
2121
};
2222

23-
#[derive(Serialize, Deserialize)]
24-
pub struct TrpResponse {
25-
#[serde(with = "hex::serde")]
26-
pub tx: Vec<u8>,
27-
}
28-
2923
#[derive(Deserialize, Serialize, Debug, PartialEq, Clone)]
3024
#[serde(tag = "type")]
3125
pub struct Provider {
@@ -265,7 +259,10 @@ impl Provider {
265259
}
266260
}
267261

268-
pub async fn trp_resolve(&self, params: &ObjectParams) -> miette::Result<TrpResponse> {
262+
pub async fn trp_resolve(
263+
&self,
264+
params: &ObjectParams,
265+
) -> miette::Result<tx3_sdk::trp::TxEnvelope> {
269266
let Some(trp_url) = &self.trp_url else {
270267
bail!("missing TRP configuration for this provider")
271268
};

src/transaction/new.rs

Lines changed: 0 additions & 322 deletions
This file was deleted.

0 commit comments

Comments
 (0)