cargo +nightly fmt

This commit is contained in:
Tadeo hepperle
2023-05-10 14:26:10 +02:00
parent 213bc4c47a
commit a3419a6f44
94 changed files with 326 additions and 259 deletions
+2 -1
View File
@@ -2,13 +2,14 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use crate::{pair_signer, test_context, utils::node_runtime};
use codec::Compact;
use frame_metadata::RuntimeMetadataPrefixed;
use futures::StreamExt;
use sp_keyring::AccountKeyring;
use subxt::blocks::BlocksClient;
use crate::{pair_signer, test_context, utils::node_runtime};
// Check that we can subscribe to non-finalized blocks.
#[tokio::test]
async fn non_finalized_headers_subscription() -> Result<(), subxt::Error> {
+6 -6
View File
@@ -2,15 +2,10 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use crate::{
pair_signer, test_context, test_context_with,
utils::{node_runtime, wait_for_blocks},
};
use assert_matches::assert_matches;
use codec::{Compact, Decode, Encode};
use frame_metadata::RuntimeMetadataPrefixed;
use sp_core::storage::well_known_keys;
use sp_core::{sr25519::Pair as Sr25519Pair, Pair};
use sp_core::{sr25519::Pair as Sr25519Pair, storage::well_known_keys, Pair};
use sp_keyring::AccountKeyring;
use subxt::{
error::{DispatchError, Error, TokenError},
@@ -22,6 +17,11 @@ use subxt::{
utils::AccountId32,
};
use crate::{
pair_signer, test_context, test_context_with,
utils::{node_runtime, wait_for_blocks},
};
#[tokio::test]
async fn insert_key() {
let ctx = test_context_with(AccountKeyring::Bob).await;
@@ -2,10 +2,6 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use crate::{
node_runtime::{self, balances, runtime_types, system},
pair_signer, test_context,
};
use codec::Decode;
use sp_core::Pair;
use sp_keyring::AccountKeyring;
@@ -14,6 +10,11 @@ use subxt::{
utils::{AccountId32, MultiAddress},
};
use crate::{
node_runtime::{self, balances, runtime_types, system},
pair_signer, test_context,
};
#[tokio::test]
async fn tx_basic_transfer() -> Result<(), subxt::Error> {
let alice = pair_signer(AccountKeyring::Alice.pair());
@@ -2,7 +2,13 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use sp_core::sr25519::Pair;
use sp_keyring::AccountKeyring;
use subxt::{
tx::{PairSigner, TxProgress},
utils::MultiAddress,
Config, Error, OnlineClient, SubstrateConfig,
};
use crate::{
node_runtime::{
@@ -13,12 +19,6 @@ use crate::{
},
test_context, TestContext,
};
use sp_core::sr25519::Pair;
use subxt::{
tx::{PairSigner, TxProgress},
utils::MultiAddress,
Config, Error, OnlineClient, SubstrateConfig,
};
struct ContractsTestContext {
cxt: TestContext,
@@ -2,6 +2,11 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use assert_matches::assert_matches;
use sp_core::{sr25519, Pair};
use sp_keyring::AccountKeyring;
use subxt::error::{DispatchError, Error};
use crate::{
node_runtime::{
self,
@@ -13,10 +18,6 @@ use crate::{
},
pair_signer, test_context,
};
use assert_matches::assert_matches;
use sp_core::{sr25519, Pair};
use sp_keyring::AccountKeyring;
use subxt::error::{DispatchError, Error};
/// Helper function to generate a crypto pair from seed
fn get_from_seed(seed: &str) -> sr25519::Pair {
+2 -1
View File
@@ -2,6 +2,8 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use sp_keyring::AccountKeyring;
use crate::{
node_runtime::{
self,
@@ -10,7 +12,6 @@ use crate::{
},
pair_signer, test_context,
};
use sp_keyring::AccountKeyring;
type Call = runtime_types::kitchensink_runtime::RuntimeCall;
type BalancesCall = runtime_types::pallet_balances::pallet::Call;
@@ -2,12 +2,13 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use assert_matches::assert_matches;
use sp_keyring::AccountKeyring;
use crate::{
node_runtime::{self, system},
pair_signer, test_context,
};
use assert_matches::assert_matches;
use sp_keyring::AccountKeyring;
#[tokio::test]
async fn storage_account() -> Result<(), subxt::Error> {
+2 -3
View File
@@ -24,9 +24,6 @@ mod storage;
#[cfg(test)]
use test_runtime::node_runtime;
#[cfg(test)]
use utils::*;
// We don't use this dependency, but it's here so that we
// can enable logging easily if need be. Add this to a test
// to enable tracing for it:
@@ -34,3 +31,5 @@ use utils::*;
// tracing_subscriber::fmt::init();
#[cfg(test)]
use tracing_subscriber as _;
#[cfg(test)]
use utils::*;
@@ -2,7 +2,6 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use crate::{node_runtime, test_context, TestContext};
use frame_metadata::{
v15::{
ExtrinsicMetadata, PalletCallMetadata, PalletMetadata, PalletStorageMetadata,
@@ -16,6 +15,8 @@ use scale_info::{
};
use subxt::{Metadata, OfflineClient, SubstrateConfig};
use crate::{node_runtime, test_context, TestContext};
async fn metadata_to_api(
metadata: RuntimeMetadataV15,
ctx: &TestContext,
@@ -2,10 +2,11 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use crate::{node_runtime, pair_signer, test_context};
use sp_keyring::AccountKeyring;
use subxt::utils::AccountId32;
use crate::{node_runtime, pair_signer, test_context};
#[tokio::test]
async fn account_nonce() -> Result<(), subxt::Error> {
let ctx = test_context().await;
+2 -1
View File
@@ -2,10 +2,11 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use crate::{node_runtime, pair_signer, test_context, utils::wait_for_blocks};
use sp_keyring::AccountKeyring;
use subxt::utils::AccountId32;
use crate::{node_runtime, pair_signer, test_context, utils::wait_for_blocks};
#[tokio::test]
async fn storage_plain_lookup() -> Result<(), subxt::Error> {
let ctx = test_context().await;
@@ -2,12 +2,12 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
pub(crate) use crate::{node_runtime, TestNodeProcess};
use sp_core::sr25519::Pair;
use sp_keyring::AccountKeyring;
use subxt::{tx::PairSigner, SubstrateConfig};
pub(crate) use crate::{node_runtime, TestNodeProcess};
/// substrate node should be installed on the $PATH
const SUBSTRATE_NODE_PATH: &str = "substrate";
@@ -2,8 +2,9 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use sp_keyring::AccountKeyring;
use std::ffi::{OsStr, OsString};
use sp_keyring::AccountKeyring;
use substrate_runner::SubstrateNode;
use subxt::{Config, OnlineClient};