Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Lohann authored and dvc94ch committed Sep 7, 2023
1 parent cf0fd59 commit 20c32e0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 30 deletions.
26 changes: 4 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion chains/bitcoin/server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use rosetta_core::{
BlockchainClient, BlockchainConfig,
};
use serde_json::Value;
use std::str::FromStr;

pub type BitcoinMetadataParams = ();
pub type BitcoinMetadata = ();
Expand All @@ -31,7 +32,7 @@ impl BitcoinClient {
addr.to_string(),
Auth::UserPass("rosetta".into(), "rosetta".into()),
)
.await?;
.await?;
let genesis = client.get_block_hash(0).await?;
let genesis_block = BlockIdentifier {
index: 0,
Expand Down
2 changes: 1 addition & 1 deletion rosetta-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl GenericClient {
}

pub async fn from_config(config: BlockchainConfig, url: &str) -> Result<Self> {
let blockchain = Blockchain::from_str(&config.blockchain)?;
let blockchain = Blockchain::from_str(config.blockchain)?;
Ok(match blockchain {
Blockchain::Bitcoin => {
let client = BitcoinClient::from_config(config, url).await?;
Expand Down
5 changes: 1 addition & 4 deletions rosetta-client/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ impl Wallet {
}

/// Creates a new wallet from a client, url and keyfile.
pub async fn from_client(
client: GenericClient,
keyfile: Option<&Path>,
) -> Result<Self> {
pub async fn from_client(client: GenericClient, keyfile: Option<&Path>) -> Result<Self> {
let store = MnemonicStore::new(keyfile)?;
let mnemonic = store.get_or_generate_mnemonic()?;
let signer = Signer::new(&mnemonic, "")?;
Expand Down
4 changes: 2 additions & 2 deletions rosetta-docker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use futures::stream::StreamExt;
use rosetta_client::Wallet;
use rosetta_core::{BlockchainClient, BlockchainConfig};
use std::future::Future;
use std::str::FromStr;
use std::sync::Arc;
use std::time::Duration;
use tokio_retry::{strategy::ExponentialBackoff, RetryIf};
Expand Down Expand Up @@ -231,7 +230,8 @@ impl<'a> EnvBuilder<'a> {

let client = {
let retry_strategy = tokio_retry::strategy::FibonacciBackoff::from_millis(1000)
.max_delay(Duration::from_secs(5)).into_iter().take(MAX_RETRIES);
.max_delay(Duration::from_secs(5))
.take(MAX_RETRIES);
let mut result = Err(anyhow::anyhow!("failed to start connector"));
for delay in retry_strategy {
match start_connector(config.clone()).await {
Expand Down

0 comments on commit 20c32e0

Please sign in to comment.