Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
chore: fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst committed Aug 29, 2021
1 parent 5f36499 commit 8d324ca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ethers-providers/src/transports/quorum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ use thiserror::Error;
/// the weighted providers return the same value.
///
/// ```no_run
/// use ethers::{types::U64, providers::{JsonRpcClient, QuorumProvider, Quorum, WeightedProvider, Http}};
/// use ethers_core::types::U64;
/// use ethers_providers::{JsonRpcClient, QuorumProvider, Quorum, WeightedProvider, Http};
/// use std::str::FromStr;
///
/// # async fn foo() -> Result<(), Box<dyn std::error::Error>> {
/// let provider1 = WeightedProvider::new(Http::from_str("http://localhost:8545")?);
/// let provider2 = WeightedProvider::with_weight(Http::from_str("http://localhost:8545")?, 2);
/// let provider3 = WeightedProvider::new(Http::from_str("http://localhost:8545")?);
/// let quorum = QuorumProvider::builder()
/// let provider = QuorumProvider::builder()
/// .add_providers([provider1, provider2, provider3])
/// .quorum(Quorum::Majority)
/// .build();
/// // the weight at which a quorum is reached,
/// assert_eq!(quorum.quorum_weight(), 4 / 2); // majority >=50%
/// assert_eq!(provider.quorum_weight(), 4 / 2); // majority >=50%
/// let block_number: U64 = provider.request("eth_blockNumber", ()).await?;
///
/// # Ok(())
Expand Down

0 comments on commit 8d324ca

Please sign in to comment.