Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Feb 15, 2022
1 parent 5a854e6 commit 1ff611c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
15 changes: 8 additions & 7 deletions rpc/src/client/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,14 @@ where
ClientRequest::Block { height } => {
serde_json::to_string_pretty(&client.block(height).await?).map_err(Error::serde)?
}
ClientRequest::BlockByHash { hash } => {
serde_json::to_string_pretty(
&client.block_by_hash(
tendermint::Hash::from_str(&hash).map_err(|e| Error::parse(e.to_string()))?
).await?
).map_err(Error::serde)?
}
ClientRequest::BlockByHash { hash } => serde_json::to_string_pretty(
&client
.block_by_hash(
tendermint::Hash::from_str(&hash).map_err(|e| Error::parse(e.to_string()))?,
)
.await?,
)
.map_err(Error::serde)?,
ClientRequest::Blockchain { min, max } => {
serde_json::to_string_pretty(&client.blockchain(min, max).await?)
.map_err(Error::serde)?
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/endpoint/block_by_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
use serde::{Deserialize, Serialize};

use tendermint::Hash;
use tendermint::block::{self, Block};
use tendermint::Hash;

/// Get information about a specific block by its hash
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
Expand Down
12 changes: 8 additions & 4 deletions rpc/tests/kvstore_fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ fn outgoing_fixtures() {
}
"block_by_hash" => {
// First, get the hash at height 1.
let wrapped =
serde_json::from_str::<RequestWrapper<endpoint::block_by_hash::Request>>(&content)
.unwrap();
let wrapped = serde_json::from_str::<
RequestWrapper<endpoint::block_by_hash::Request>,
>(&content)
.unwrap();
assert_eq!(
wrapped.params().hash.unwrap().to_string(),
"00112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF"
Expand Down Expand Up @@ -484,7 +485,10 @@ fn incoming_fixtures() {
}
"block_by_hash" => {
let result = endpoint::block::Response::from_string(content).unwrap();
assert_eq!(result.block_id.hash.to_string(), "BCF3DB412E80A396D10BF5B5E6D3E63D3B06DEB25AA958BCB8CE18D023838042");
assert_eq!(
result.block_id.hash.to_string(),
"BCF3DB412E80A396D10BF5B5E6D3E63D3B06DEB25AA958BCB8CE18D023838042"
);
}
"block_search" => {
let result = endpoint::block_search::Response::from_string(content).unwrap();
Expand Down

0 comments on commit 1ff611c

Please sign in to comment.