diff --git a/demos/rust-cosmos-broadcaster-client/src/commands/commands.rs b/demos/rust-cosmos-broadcaster-client/src/commands/commands.rs index 5cd98586f7..69a841eaa7 100644 --- a/demos/rust-cosmos-broadcaster-client/src/commands/commands.rs +++ b/demos/rust-cosmos-broadcaster-client/src/commands/commands.rs @@ -1,31 +1,15 @@ -use std::time::Duration; -use nym_cli_commands::validator::mixnet::Mixnet; -use nym_crypto::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 nym_validator_client::nyxd::cosmwasm_client::types; use cosmrs::bank::MsgSend; -use cosmrs::rpc::{HttpClient, Id}; use cosmrs::tx::Msg; use cosmrs::{tx, AccountId, Coin, Denom}; use bip39; use bs58; use nym_sdk::mixnet::{self, MixnetClient, ReconstructedMessage}; -use serde::{Deserialize, Serialize}; -use crate::commands::reqres::{SequenceRequest, RequestTypes, ResponseTypes, SequenceRequestResponse, self, BroadcastRequest}; - - -// use super::reqres::SequenceRequestResponse; - -// type SomeError = anyhow::Error; - -// fn parse_msg(reconstructed: ReconstructedMessage) -> Result { -// let response = serde_json::from_slice(&reconstructed.message)?; -// Ok(response) -// } +use crate::commands::reqres::{SequenceRequest, ResponseTypes, self, BroadcastRequest}; pub async fn offline_sign(mnemonic: bip39::Mnemonic, to: AccountId, client: &mut MixnetClient , sp_address: Recipient) -> String { diff --git a/demos/rust-cosmos-broadcaster-client/src/commands/reqres.rs b/demos/rust-cosmos-broadcaster-client/src/commands/reqres.rs index bd190140e6..86f0ce0f42 100644 --- a/demos/rust-cosmos-broadcaster-client/src/commands/reqres.rs +++ b/demos/rust-cosmos-broadcaster-client/src/commands/reqres.rs @@ -1,6 +1,5 @@ -use cosmrs::rpc::{Id}; use serde::{Deserialize, Serialize}; -use cosmrs::{tx, AccountId, Coin, Denom, tendermint}; +use cosmrs::{AccountId, tendermint}; #[derive(Deserialize, Serialize, Debug)] pub struct SequenceRequest { diff --git a/demos/rust-cosmos-broadcaster-server/src/commands/commands.rs b/demos/rust-cosmos-broadcaster-server/src/commands/commands.rs index efa73a1053..a472ca5836 100644 --- a/demos/rust-cosmos-broadcaster-server/src/commands/commands.rs +++ b/demos/rust-cosmos-broadcaster-server/src/commands/commands.rs @@ -1,20 +1,8 @@ -// use nym_cli_commands::validator::mixnet::Mixnet; -// use nym_crypto::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::{HttpClient, Id, Client, Response}; - -// use cosmrs::tx::Msg; -use cosmrs::{tx, AccountId, Coin, Denom, tendermint}; -// use bip39; +use cosmrs::rpc::{HttpClient, Client}; +use cosmrs::{AccountId, tendermint}; use bs58; -use nym_sdk::mixnet::{self, MixnetClient}; -use serde::{Deserialize, Serialize}; -use crate::commands::reqres::{SequenceRequest, SequenceRequestResponse, BroadcastRequest, BroadcastResponse}; +use crate::commands::reqres::{SequenceRequestResponse, BroadcastResponse}; pub async fn get_sequence(validator: String, signer_address: AccountId) -> SequenceRequestResponse { diff --git a/demos/rust-cosmos-broadcaster-server/src/commands/reqres.rs b/demos/rust-cosmos-broadcaster-server/src/commands/reqres.rs index 90ed1165f1..b610d9f5bc 100644 --- a/demos/rust-cosmos-broadcaster-server/src/commands/reqres.rs +++ b/demos/rust-cosmos-broadcaster-server/src/commands/reqres.rs @@ -1,7 +1,5 @@ -// use cosmrs::rpc::{HttpClient, Id}; use serde::{Deserialize, Serialize}; -use cosmrs::{tx, AccountId, Coin, Denom, tendermint}; -use nym_validator_client::nyxd::cosmwasm_client::types::SequenceResponse; +use cosmrs::{AccountId, tendermint}; #[derive(Deserialize, Serialize, Debug)] pub struct SequenceRequest { diff --git a/demos/rust-cosmos-broadcaster-server/src/main.rs b/demos/rust-cosmos-broadcaster-server/src/main.rs index 99037c6424..eff5860085 100644 --- a/demos/rust-cosmos-broadcaster-server/src/main.rs +++ b/demos/rust-cosmos-broadcaster-server/src/main.rs @@ -1,14 +1,9 @@ -use nym_sdk::mixnet::{Recipient, MixnetClient, StoragePaths, MixnetClientBuilder, ReconstructedMessage}; -use nym_validator_client::nyxd::AccountId; +use nym_sdk::mixnet::{StoragePaths, MixnetClientBuilder, ReconstructedMessage}; use nym_bin_common::logging::setup_logging; -use std::{path::PathBuf, time::Duration}; +use std::path::PathBuf; mod commands; -use serde::{Deserialize, Serialize}; -use cosmrs::{rpc::{Id}}; -use nym_sphinx_anonymous_replies::{self, requests::{RepliableMessage, AnonymousSenderTag}}; +use nym_sphinx_anonymous_replies::{self, requests::AnonymousSenderTag}; use crate::commands::reqres; -// pull in ::reply::{MixnetAddress, MixnetMessage} -use nym_validator_client::nyxd::cosmwasm_client::types; #[tokio::main] async fn main() {