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

feat: accept different middlewares for contract connect #1159

Merged
merged 1 commit into from
Apr 21, 2022
Merged
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
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