This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ContractCall IntoFuture implement Send (#2083)
* fix(contracts): Add a failing test showing that ContractCall IntoFuture is not Send * fix(contracts): Add Send bound for IntoFuture implementation of ContractCall * chore: update CHAGELOG * chore: fmt --------- Co-authored-by: Georgios Konstantopoulos <[email protected]>
- Loading branch information
Showing
4 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use ethers_contract_derive::abigen; | ||
use ethers_core::abi::Address; | ||
use ethers_providers::Provider; | ||
use std::{ | ||
future::{Future, IntoFuture}, | ||
sync::Arc, | ||
}; | ||
|
||
#[tokio::test] | ||
async fn contract_call_into_future_is_send() { | ||
abigen!(DsProxyFactory, "ethers-middleware/contracts/DsProxyFactory.json"); | ||
let (provider, _) = Provider::mocked(); | ||
let client = Arc::new(provider); | ||
let contract = DsProxyFactory::new(Address::zero(), client); | ||
|
||
fn is_send<T: Future + Send + 'static>(future: T) -> bool { | ||
true | ||
} | ||
|
||
assert!(is_send(contract.cache().into_future())); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ pub(crate) mod common; | |
mod console; | ||
#[cfg(feature = "abigen")] | ||
mod contract; | ||
mod contract_call; | ||
|
||
fn main() {} |