Use tokio instead of async-std (#495)

* examples: Use tokio instead of std async

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* test-runtime: Use tokio instead of std async

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Use tokio instead of std async

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* examples: Use only necessary tokio features

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2022-04-01 17:57:15 +03:00
committed by GitHub
parent cc0b1ec84a
commit 6ce9983506
25 changed files with 69 additions and 69 deletions
+9 -9
View File
@@ -47,7 +47,7 @@ fn default_validator_prefs() -> ValidatorPrefs {
}
}
#[async_std::test]
#[tokio::test]
async fn validate_with_controller_account() {
let alice = pair_signer(AccountKeyring::Alice.pair());
let ctx = test_context().await;
@@ -63,7 +63,7 @@ async fn validate_with_controller_account() {
.expect("should be successful");
}
#[async_std::test]
#[tokio::test]
async fn validate_not_possible_for_stash_account() -> Result<(), Error<DispatchError>> {
let alice_stash = pair_signer(get_from_seed("Alice//stash"));
let ctx = test_context().await;
@@ -83,7 +83,7 @@ async fn validate_not_possible_for_stash_account() -> Result<(), Error<DispatchE
Ok(())
}
#[async_std::test]
#[tokio::test]
async fn nominate_with_controller_account() {
let alice = pair_signer(AccountKeyring::Alice.pair());
let bob = pair_signer(AccountKeyring::Bob.pair());
@@ -101,7 +101,7 @@ async fn nominate_with_controller_account() {
.expect("should be successful");
}
#[async_std::test]
#[tokio::test]
async fn nominate_not_possible_for_stash_account() -> Result<(), Error<DispatchError>> {
let alice_stash = pair_signer(get_from_seed("Alice//stash"));
let bob = pair_signer(AccountKeyring::Bob.pair());
@@ -124,7 +124,7 @@ async fn nominate_not_possible_for_stash_account() -> Result<(), Error<DispatchE
Ok(())
}
#[async_std::test]
#[tokio::test]
async fn chill_works_for_controller_only() -> Result<(), Error<DispatchError>> {
let alice_stash = pair_signer(get_from_seed("Alice//stash"));
let bob_stash = pair_signer(get_from_seed("Bob//stash"));
@@ -180,7 +180,7 @@ async fn chill_works_for_controller_only() -> Result<(), Error<DispatchError>> {
Ok(())
}
#[async_std::test]
#[tokio::test]
async fn tx_bond() -> Result<(), Error<DispatchError>> {
let alice = pair_signer(AccountKeyring::Alice.pair());
let ctx = test_context().await;
@@ -222,7 +222,7 @@ async fn tx_bond() -> Result<(), Error<DispatchError>> {
Ok(())
}
#[async_std::test]
#[tokio::test]
async fn storage_history_depth() -> Result<(), Error<DispatchError>> {
let ctx = test_context().await;
let history_depth = ctx.api.storage().staking().history_depth(None).await?;
@@ -230,7 +230,7 @@ async fn storage_history_depth() -> Result<(), Error<DispatchError>> {
Ok(())
}
#[async_std::test]
#[tokio::test]
async fn storage_current_era() -> Result<(), Error<DispatchError>> {
let ctx = test_context().await;
let _current_era = ctx
@@ -243,7 +243,7 @@ async fn storage_current_era() -> Result<(), Error<DispatchError>> {
Ok(())
}
#[async_std::test]
#[tokio::test]
async fn storage_era_reward_points() -> Result<(), Error<DispatchError>> {
let cxt = test_context().await;
let current_era_result = cxt