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
|
||||
#[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
|
||||
|
|
Loading…
Reference in New Issue