feat: accept different middlewares for contract connect (#1159)

This commit is contained in:
Matthias Seitz 2022-04-21 17:05:23 +02:00 committed by GitHub
parent 5f1f967ec1
commit 969d4e01c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -261,13 +261,11 @@ impl<M: Middleware> Contract<M> {
/// ///
/// Clones `self` internally /// Clones `self` internally
#[must_use] #[must_use]
pub fn connect(&self, client: Arc<M>) -> Self pub fn connect<N>(&self, client: Arc<N>) -> Contract<N>
where where
M: Clone, N: Clone,
{ {
let mut this = self.clone(); Contract { base_contract: self.base_contract.clone(), client, address: self.address }
this.client = client;
this
} }
/// Returns the contract's address /// Returns the contract's address