testing: Adjust for the new interface

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2024-03-26 18:18:55 +02:00
parent 00c4b78149
commit 03da9046c9
6 changed files with 2 additions and 18 deletions
@@ -6,9 +6,6 @@ use crate::{subxt_test, test_context};
use codec::{Compact, Encode};
use futures::StreamExt;
#[cfg(lightclient)]
use subxt::client::OnlineClientT;
#[cfg(fullclient)]
use crate::utils::node_runtime;
#[cfg(fullclient)]
@@ -11,9 +11,6 @@ use codec::{Decode, Encode};
#[cfg(fullclient)]
use futures::StreamExt;
#[cfg(lightclient)]
use subxt::client::OnlineClientT;
use subxt::{
backend::BackendExt,
error::{DispatchError, Error},
@@ -19,9 +19,6 @@ use subxt::{
SubstrateConfig,
};
#[cfg(lightclient)]
use subxt::client::OfflineClientT;
use subxt_signer::sr25519::dev;
#[subxt_test]
@@ -13,9 +13,6 @@ use subxt::{
};
use subxt_signer::sr25519::dev;
#[cfg(lightclient)]
use subxt::client::OfflineClientT;
#[subxt_test]
async fn tx_basic_transfer() -> Result<(), subxt::Error> {
let alice = dev::alice();
@@ -14,9 +14,6 @@ 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(),
@@ -228,12 +228,11 @@ async fn build_light_client<T: Config>(proc: &SubstrateNode) -> Result<OnlineCli
.await
.map_err(|err| format!("Failed to connect to node rpc at {ws_url}: {err}"))?;
// Wait for at least 3 blocks before starting the light client.
// Wait for at least 3 blocks before starting the light client.
// Otherwise, the lightclient might error with
// `"Error when retrieving the call proof: No node available for call proof query"`.
super::wait_for_number_of_blocks(&client, 4).await;
// Now, configure a light client; fetch the chain spec and modify the bootnodes.
let bootnode = format!(
"/ip4/127.0.0.1/tcp/{}/p2p/{}",
@@ -254,5 +253,5 @@ async fn build_light_client<T: Config>(proc: &SubstrateNode) -> Result<OnlineCli
.map_err(|e| format!("Light client: cannot add relay chain: {e}"))?;
// Instantiate subxt client from this.
build_unstable_client(rpc)
build_unstable_client(rpc.into()).await
}