mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 02:57:57 +00:00
testing: Disable flaky lightclient tests
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -5,13 +5,23 @@
|
||||
use crate::{test_context, utils::node_runtime};
|
||||
use codec::{Compact, Encode};
|
||||
use futures::StreamExt;
|
||||
|
||||
#[cfg(lightclient)]
|
||||
use subxt::client::OnlineClientT;
|
||||
|
||||
#[cfg(fullclient)]
|
||||
use subxt::config::signed_extensions::{ChargeAssetTxPayment, CheckMortality, CheckNonce};
|
||||
#[cfg(fullclient)]
|
||||
use subxt::config::DefaultExtrinsicParamsBuilder;
|
||||
#[cfg(fullclient)]
|
||||
use subxt::config::SubstrateConfig;
|
||||
#[cfg(fullclient)]
|
||||
use subxt::utils::Era;
|
||||
|
||||
use subxt_metadata::Metadata;
|
||||
use subxt_signer::sr25519::dev;
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn block_subscriptions_are_consistent_with_eachother() -> Result<(), subxt::Error> {
|
||||
let ctx = test_context().await;
|
||||
@@ -163,6 +173,7 @@ async fn runtime_api_call() -> Result<(), subxt::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn fetch_block_and_decode_extrinsic_details() {
|
||||
let ctx = test_context().await;
|
||||
@@ -232,6 +243,7 @@ async fn fetch_block_and_decode_extrinsic_details() {
|
||||
assert!(tx.is_signed());
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn decode_signed_extensions_from_blocks() {
|
||||
let ctx = test_context().await;
|
||||
|
||||
@@ -7,7 +7,13 @@ use crate::{
|
||||
utils::{node_runtime, wait_for_blocks},
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
|
||||
#[cfg(fullclient)]
|
||||
use futures::StreamExt;
|
||||
|
||||
#[cfg(lightclient)]
|
||||
use subxt::client::OnlineClientT;
|
||||
|
||||
use subxt::{
|
||||
backend::BackendExt,
|
||||
error::{DispatchError, Error},
|
||||
@@ -18,6 +24,7 @@ use subxt_signer::sr25519::dev;
|
||||
mod legacy_rpcs;
|
||||
mod unstable_rpcs;
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn storage_fetch_raw_keys() {
|
||||
let ctx = test_context().await;
|
||||
@@ -39,6 +46,7 @@ async fn storage_fetch_raw_keys() {
|
||||
assert_eq!(len, 13)
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn storage_iter() {
|
||||
let ctx = test_context().await;
|
||||
@@ -63,6 +71,7 @@ async fn storage_iter() {
|
||||
assert_eq!(len, 13);
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn storage_child_values_same_across_backends() {
|
||||
let ctx = test_context().await;
|
||||
@@ -204,6 +213,7 @@ async fn external_signing() {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
// TODO: Investigate and fix this test failure when using the UnstableBackend.
|
||||
// (https://github.com/paritytech/subxt/issues/1308)
|
||||
#[cfg(not(feature = "unstable-backend-client"))]
|
||||
|
||||
@@ -16,6 +16,10 @@ use subxt::{
|
||||
},
|
||||
utils::AccountId32,
|
||||
};
|
||||
|
||||
#[cfg(lightclient)]
|
||||
use subxt::client::OfflineClientT;
|
||||
|
||||
use subxt_signer::sr25519::dev;
|
||||
|
||||
#[tokio::test]
|
||||
@@ -215,6 +219,7 @@ async fn chainhead_unstable_unpin() {
|
||||
assert!(rpc.chainhead_unstable_unpin(sub_id, hash).await.is_err());
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn chainspec_v1_genesishash() {
|
||||
let ctx = test_context().await;
|
||||
@@ -227,6 +232,7 @@ async fn chainspec_v1_genesishash() {
|
||||
assert_eq!(a, b);
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn chainspec_v1_chainname() {
|
||||
let ctx = test_context().await;
|
||||
@@ -239,6 +245,7 @@ async fn chainspec_v1_chainname() {
|
||||
assert_eq!(a, b);
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn chainspec_v1_properties() {
|
||||
let ctx = test_context().await;
|
||||
@@ -251,6 +258,7 @@ async fn chainspec_v1_properties() {
|
||||
assert_eq!(a, b);
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn transaction_unstable_submit_and_watch() {
|
||||
let ctx = test_context().await;
|
||||
|
||||
@@ -13,6 +13,9 @@ use subxt::{
|
||||
};
|
||||
use subxt_signer::sr25519::dev;
|
||||
|
||||
#[cfg(lightclient)]
|
||||
use subxt::client::OfflineClientT;
|
||||
|
||||
#[tokio::test]
|
||||
async fn tx_basic_transfer() -> Result<(), subxt::Error> {
|
||||
let alice = dev::alice();
|
||||
|
||||
@@ -9,10 +9,10 @@ use crate::{
|
||||
runtime_types::{pallet_contracts::wasm::Determinism, sp_weights::weight_v2::Weight},
|
||||
system,
|
||||
},
|
||||
test_context, TestContext,
|
||||
test_context, TestClient, TestConfig, TestContext,
|
||||
};
|
||||
use subxt::ext::futures::StreamExt;
|
||||
use subxt::{tx::TxProgress, utils::MultiAddress, Config, Error, OnlineClient, SubstrateConfig};
|
||||
use subxt::{tx::TxProgress, utils::MultiAddress, Config, Error};
|
||||
use subxt_signer::sr25519::{self, dev};
|
||||
|
||||
struct ContractsTestContext {
|
||||
@@ -20,8 +20,8 @@ struct ContractsTestContext {
|
||||
signer: sr25519::Keypair,
|
||||
}
|
||||
|
||||
type Hash = <SubstrateConfig as Config>::Hash;
|
||||
type AccountId = <SubstrateConfig as Config>::AccountId;
|
||||
type Hash = <TestConfig as Config>::Hash;
|
||||
type AccountId = <TestConfig as Config>::AccountId;
|
||||
|
||||
/// A dummy contract which does nothing at all.
|
||||
const CONTRACT: &str = r#"
|
||||
@@ -42,7 +42,7 @@ impl ContractsTestContext {
|
||||
Self { cxt, signer }
|
||||
}
|
||||
|
||||
fn client(&self) -> OnlineClient<SubstrateConfig> {
|
||||
fn client(&self) -> TestClient {
|
||||
self.cxt.client()
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ impl ContractsTestContext {
|
||||
&self,
|
||||
contract: AccountId,
|
||||
input_data: Vec<u8>,
|
||||
) -> Result<TxProgress<SubstrateConfig, OnlineClient<SubstrateConfig>>, Error> {
|
||||
) -> Result<TxProgress<TestConfig, TestClient>, Error> {
|
||||
tracing::info!("call: {:?}", contract);
|
||||
let call_tx = node_runtime::tx().contracts().call(
|
||||
MultiAddress::Id(contract),
|
||||
|
||||
@@ -14,6 +14,9 @@ use scale_info::{
|
||||
};
|
||||
use subxt::{Metadata, OfflineClient, SubstrateConfig};
|
||||
|
||||
#[cfg(lightclient)]
|
||||
use subxt::client::OfflineClientT;
|
||||
|
||||
async fn metadata_to_api(metadata: Metadata, ctx: &TestContext) -> OfflineClient<SubstrateConfig> {
|
||||
OfflineClient::new(
|
||||
ctx.client().genesis_hash(),
|
||||
|
||||
@@ -90,6 +90,7 @@ async fn storage_n_mapish_key_is_properly_created() -> Result<(), subxt::Error>
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error> {
|
||||
let ctx = test_context().await;
|
||||
@@ -126,6 +127,7 @@ async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(fullclient)]
|
||||
#[tokio::test]
|
||||
async fn storage_partial_lookup() -> Result<(), subxt::Error> {
|
||||
let ctx = test_context().await;
|
||||
|
||||
@@ -14,7 +14,10 @@ pub mod utils;
|
||||
#[cfg_attr(test, allow(unused_imports))]
|
||||
use utils::*;
|
||||
|
||||
#[cfg(all(test, not(feature = "unstable-light-client")))]
|
||||
#[cfg(any(
|
||||
all(test, not(feature = "unstable-light-client")),
|
||||
all(test, feature = "unstable-light-client-long-running")
|
||||
))]
|
||||
mod full_client;
|
||||
|
||||
#[cfg(all(test, feature = "unstable-light-client"))]
|
||||
|
||||
Reference in New Issue
Block a user