contract: return `Arc<M>` instead of `&M` (#1731)

* return Arc<M> instead of &M

* docs
This commit is contained in:
DaniPopes 2022-09-24 21:40:08 +02:00 committed by GitHub
parent d655d22125
commit 4ed46089d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -185,9 +185,9 @@ impl<M> Contract<M> {
&self.base_contract.abi &self.base_contract.abi
} }
/// Returns a reference to the contract's client /// Returns a pointer to the contract's client
pub fn client(&self) -> &M { pub fn client(&self) -> Arc<M> {
&self.client self.client.clone()
} }
} }

View File

@ -147,8 +147,8 @@ impl<M: Middleware, C: From<Contract<M>>> ContractDeployer<M, C> {
self.deployer.abi() self.deployer.abi()
} }
/// Returns a reference to the deployer's client /// Returns a pointer to the deployer's client
pub fn client(&self) -> &M { pub fn client(&self) -> Arc<M> {
self.deployer.client() self.deployer.client()
} }
} }
@ -261,9 +261,9 @@ impl<M: Middleware> Deployer<M> {
&self.abi &self.abi
} }
/// Returns a reference to the deployer's client /// Returns a pointer to the deployer's client
pub fn client(&self) -> &M { pub fn client(&self) -> Arc<M> {
&self.client self.client.clone()
} }
} }