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

Commit

Permalink
feat: add quorum provider (#409)
Browse files Browse the repository at this point in the history
* feat: add quorum provider

* feat: add quorum provider example

* fix: make compile with wasm32

* feat: normalize requests with block height

* fix: lowercase eth_call

* chore: fix doctest

* chore: remove Sync/Send requirement

Co-authored-by: Georgios Konstantopoulos <[email protected]>
  • Loading branch information
mattsse and gakonst authored Aug 29, 2021
1 parent 9df4d21 commit 824bedb
Show file tree
Hide file tree
Showing 4 changed files with 687 additions and 1 deletion.
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

0 comments on commit 824bedb

Please sign in to comment.