diff --git a/demos/rust-cosmos-broadcaster-client/src/commands/commands.rs b/demos/rust-cosmos-broadcaster-client/src/commands/commands.rs index d12f8f6ebf..a2e77e8193 100644 --- a/demos/rust-cosmos-broadcaster-client/src/commands/commands.rs +++ b/demos/rust-cosmos-broadcaster-client/src/commands/commands.rs @@ -1,17 +1,15 @@ -use cosmrs::bip32::secp256k1::elliptic_curve::generic_array::sequence; use nym_sphinx_addressing::clients::Recipient; use nym_validator_client::nyxd::CosmWasmClient; use nym_validator_client::signing::direct_wallet::DirectSecp256k1HdWallet; use nym_validator_client::signing::tx_signer::TxSigner; use nym_validator_client::signing::SignerData; use cosmrs::bank::MsgSend; -use cosmrs::rpc::{self, HttpClient}; +use cosmrs::rpc::{HttpClient}; use cosmrs::tx::Msg; use cosmrs::{tx, AccountId, Coin, Denom}; use bip39; use bs58; use nym_sdk::mixnet; -// use nymsphinx::addressing::Recipient; pub async fn offline_sign(mnemonic: bip39::Mnemonic, to: AccountId) -> String { @@ -84,10 +82,14 @@ pub async fn send_tx(base58_tx: String, sp_address: Recipient) -> Option + // broadcast the tx let res = rpc::Client::broadcast_tx_commit(&broadcaster, tx_bytes.into()) .await .unwrap(); + + // send res back via SURBs */ client.send_str(sp_address, &base58_tx).await; // send as base58 encoded and it can be decoded by the SP println!("\nWaiting for reply\n"); diff --git a/demos/rust-cosmos-broadcaster-client/src/main.rs b/demos/rust-cosmos-broadcaster-client/src/main.rs index 4d0f9d2eff..83c7b1f87c 100644 --- a/demos/rust-cosmos-broadcaster-client/src/main.rs +++ b/demos/rust-cosmos-broadcaster-client/src/main.rs @@ -1,16 +1,8 @@ -use std::str::FromStr; - -use clap::{CommandFactory, Parser, Subcommand, Args}; -use cosmrs::bip32::PublicKey; +use clap::{ Parser, Subcommand, Args}; use nym_sdk::mixnet::Recipient; use nym_validator_client::nyxd::AccountId; -// use nym_cli_commands::context::{get_network_details, ClientArgs}; -use nym_crypto::asymmetric::identity; mod commands; use nym_bin_common::logging::setup_logging; -use nym_sphinx_addressing; - -// use common::nymsphinx::addressing; #[derive(Debug, Parser)] #[clap(name = "nym cosmos tx signer ")] @@ -24,7 +16,7 @@ struct Cli { // mnemonic: Option, // TODO add SP address - + #[clap(subcommand)] command: Option, }