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

feat: add quorum provider #409

Merged
merged 7 commits into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ethers-providers/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use crate::{
ens,
pubsub::{PubsubClient, SubscriptionStream},
stream::{FilterWatcher, DEFAULT_POLL_INTERVAL},
FeeHistory, FromErr, Http as HttpProvider, JsonRpcClient, MockProvider, PendingTransaction,
FeeHistory, FromErr, Http as HttpProvider, JsonRpcClient, JsonRpcClientWrapper, MockProvider,
PendingTransaction, QuorumProvider,
};

use ethers_core::{
Expand Down Expand Up @@ -898,6 +899,13 @@ impl Provider<crate::Ipc> {
}
}

impl<T: JsonRpcClientWrapper> Provider<QuorumProvider<T>> {
/// Provider that uses a quorum
pub fn quorum(inner: QuorumProvider<T>) -> Self {
Self::new(inner)
}
}

impl Provider<MockProvider> {
/// Returns a `Provider` instantiated with an internal "mock" transport.
///
Expand Down
4 changes: 4 additions & 0 deletions ethers-providers/src/transports/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@ mod ws;
#[cfg(feature = "ws")]
pub use ws::Ws;

mod quorum;
pub(crate) use quorum::JsonRpcClientWrapper;
pub use quorum::{Quorum, QuorumProvider, WeightedProvider};

mod mock;
pub use mock::{MockError, MockProvider};
Loading