diff --git a/relayer/src/chain/cosmos.rs b/relayer/src/chain/cosmos.rs index 3580d63e71..94a2e1c4fe 100644 --- a/relayer/src/chain/cosmos.rs +++ b/relayer/src/chain/cosmos.rs @@ -183,8 +183,7 @@ impl Chain for CosmosSDKChain { //println!("TxRAW {:?}", hex::encode(txraw_buf.clone())); //let signed = sign(sign_doc); - let response = - block_on(broadcast_tx(self, txraw_buf.clone())).map_err(|e| Kind::Rpc.context(e))?; + let response = block_on(broadcast_tx(self, txraw_buf)).map_err(|e| Kind::Rpc.context(e))?; Ok(response) } @@ -294,7 +293,7 @@ async fn broadcast_tx( if !response.code.is_ok() { // Fail with response log. - println!("Tx Error Response: {:?}", response.clone()); + println!("Tx Error Response: {:?}", response); return Err(Kind::Rpc.context(response.log.to_string()).into()); } diff --git a/relayer/src/keyring/store.rs b/relayer/src/keyring/store.rs index a88219b200..7deee972c6 100644 --- a/relayer/src/keyring/store.rs +++ b/relayer/src/keyring/store.rs @@ -86,16 +86,14 @@ impl KeyRingOperations for KeyRing { .map_err(|e| Kind::InvalidMnemonic.context(e))?; Ok(key) } - None => { - return Err(Kind::InvalidMnemonic - .context("invalid key file, cannot find mnemonic".to_string()))? - } + None => Err(Kind::InvalidMnemonic + .context("invalid key file, cannot find mnemonic".to_string()) + .into()), } } - None => { - return Err(Kind::InvalidMnemonic - .context("invalid key file, cannot find mnemonic".to_string()))? - } + None => Err(Kind::InvalidMnemonic + .context("invalid key file, cannot find mnemonic".to_string()) + .into()), } } @@ -139,7 +137,7 @@ impl KeyRingOperations for KeyRing { match &self { KeyRing::MemoryKeyStore { store: s } => { if !s.contains_key(&address) { - return Err(Kind::InvalidKey.into()); + Err(Kind::InvalidKey.into()) } else { let key = s.get(&address); match key { @@ -154,10 +152,7 @@ impl KeyRingOperations for KeyRing { /// Insert an entry in the key store fn insert(&mut self, addr: Vec, key: KeyEntry) -> Option { match self { - KeyRing::MemoryKeyStore { store: s } => { - let ke = s.insert(addr, key); - ke - } + KeyRing::MemoryKeyStore { store: s } => s.insert(addr, key), } } diff --git a/relayer/src/tx/connection.rs b/relayer/src/tx/connection.rs index 4add9326e6..f405c39d07 100644 --- a/relayer/src/tx/connection.rs +++ b/relayer/src/tx/connection.rs @@ -3,7 +3,6 @@ use crate::config::ChainConfig; use crate::error::{Error, Kind}; use crate::keyring::store::{KeyEntry, KeyRingOperations}; use bitcoin::hashes::hex::ToHex; -use hex; use ibc::ics03_connection::connection::Counterparty; use ibc::ics03_connection::msgs::conn_open_init::MsgConnectionOpenInit; use ibc::ics23_commitment::commitment::CommitmentPrefix;