Skip to content

Commit

Permalink
feat: accept different middlewares for contract connect (gakonst#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Apr 21, 2022
1 parent 5f1f967 commit 969d4e0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ethers-contract/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,11 @@ impl<M: Middleware> Contract<M> {
///
/// Clones `self` internally
#[must_use]
pub fn connect(&self, client: Arc<M>) -> Self
pub fn connect<N>(&self, client: Arc<N>) -> Contract<N>
where
M: Clone,
N: Clone,
{
let mut this = self.clone();
this.client = client;
this
Contract { base_contract: self.base_contract.clone(), client, address: self.address }
}

/// Returns the contract's address
Expand Down

0 comments on commit 969d4e0

Please sign in to comment.