Skip to content

Commit

Permalink
remove -cli, simplify u128 with clap
Browse files Browse the repository at this point in the history
  • Loading branch information
driemworks committed Oct 1, 2024
1 parent 10eba47 commit 1dfe374
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ crate-type = [
]

[[bin]]
name = "murmur-cli"
name = "murmur"

[dependencies]
subxt = "0.35.2"
Expand Down
12 changes: 3 additions & 9 deletions lib/src/bin/murmur-cli/main.rs → lib/src/bin/murmur/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ struct WalletExecuteDetails {
seed: String,
#[arg(long, short)]
to: String,
#[arg(short, long)]
amount: String
#[arg(short, long, value_parser = clap::value_parser!(u128))]
amount: u128
}

#[derive(Error, Debug)]
Expand Down Expand Up @@ -133,16 +133,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let from_ss58_sized: [u8;32] = bytes.try_into()
.map_err(|_| CLIError::InvalidRecipient)?;
let to = subxt::utils::AccountId32::from(from_ss58_sized);
let v: u128 = args.amount
.split_whitespace()
.map(|r| r.replace('_', "")
.parse()
.unwrap()
).collect::<Vec<_>>()[0];

let balance_transfer_call = Balances(etf::balances::Call::transfer_allow_death {
dest: subxt::utils::MultiAddress::<_, u32>::from(to),
value: v,
value: args.amount,
});

let store: MurmurStore = load_mmr_store(MMR_STORE_FILEPATH)?;
Expand Down

0 comments on commit 1dfe374

Please sign in to comment.