feat: accept different middlewares for contract connect (#1159)
This commit is contained in:
parent
5f1f967ec1
commit
969d4e01c0
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue