mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 14:01:02 +00:00
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:
@@ -24,20 +24,20 @@ use crate::{
|
||||
};
|
||||
use sp_keyring::AccountKeyring;
|
||||
|
||||
#[async_std::test]
|
||||
#[tokio::test]
|
||||
async fn storage_plain_lookup() -> Result<(), subxt::Error<DispatchError>> {
|
||||
let ctx = test_context().await;
|
||||
|
||||
// Look up a plain value. Wait long enough that we don't get the genesis block data,
|
||||
// because it may have no storage associated with it.
|
||||
async_std::task::sleep(std::time::Duration::from_secs(6)).await;
|
||||
tokio::time::sleep(std::time::Duration::from_secs(6)).await;
|
||||
let entry = ctx.api.storage().timestamp().now(None).await?;
|
||||
assert!(entry > 0);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[async_std::test]
|
||||
#[tokio::test]
|
||||
async fn storage_map_lookup() -> Result<(), subxt::Error<DispatchError>> {
|
||||
let ctx = test_context().await;
|
||||
|
||||
@@ -65,7 +65,7 @@ async fn storage_map_lookup() -> Result<(), subxt::Error<DispatchError>> {
|
||||
// Here we create a key that looks a bit like a StorageNMap key, but should in fact be
|
||||
// treated as a StorageKey (ie we should hash both values together with one hasher, rather
|
||||
// than hash both values separately, or ignore the second value).
|
||||
#[async_std::test]
|
||||
#[tokio::test]
|
||||
async fn storage_n_mapish_key_is_properly_created(
|
||||
) -> Result<(), subxt::Error<DispatchError>> {
|
||||
use codec::Encode;
|
||||
@@ -100,7 +100,7 @@ async fn storage_n_mapish_key_is_properly_created(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[async_std::test]
|
||||
#[tokio::test]
|
||||
async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error<DispatchError>> {
|
||||
let ctx = test_context().await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user