Skip to content

Commit

Permalink
Fix clippy (informalsystems#350)
Browse files Browse the repository at this point in the history
Looks good
  • Loading branch information
ancazamfir authored Oct 30, 2020
1 parent 36d4096 commit 1a58252
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
5 changes: 2 additions & 3 deletions relayer/src/chain/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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());
}

Expand Down
21 changes: 8 additions & 13 deletions relayer/src/keyring/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}

Expand Down Expand Up @@ -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 {
Expand All @@ -154,10 +152,7 @@ impl KeyRingOperations for KeyRing {
/// Insert an entry in the key store
fn insert(&mut self, addr: Vec<u8>, key: KeyEntry) -> Option<KeyEntry> {
match self {
KeyRing::MemoryKeyStore { store: s } => {
let ke = s.insert(addr, key);
ke
}
KeyRing::MemoryKeyStore { store: s } => s.insert(addr, key),
}
}

Expand Down
1 change: 0 additions & 1 deletion relayer/src/tx/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a58252

Please sign in to comment.