From be5de9da1ad977b381510fceb0bbbea5f1abf6a1 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 2 Sep 2022 11:54:14 +0100 Subject: [PATCH] Remove unnecessary async and fix latest substrate changes --- subxt/src/tx/tx_client.rs | 5 ++--- testing/integration-tests/src/client/mod.rs | 2 +- .../integration-tests/src/frame/contracts.rs | 17 ++++++++++++----- testing/integration-tests/src/frame/sudo.rs | 9 +++++++-- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/subxt/src/tx/tx_client.rs b/subxt/src/tx/tx_client.rs index 47ba2ee94b..7e686ebdc5 100644 --- a/subxt/src/tx/tx_client.rs +++ b/subxt/src/tx/tx_client.rs @@ -84,7 +84,7 @@ impl> TxClient { } /// Creates an unsigned extrinsic without submitting it. - pub async fn create_unsigned( + pub fn create_unsigned( &self, call: &Call, ) -> Result, Error> @@ -121,7 +121,7 @@ impl> TxClient { } /// Creates a raw signed extrinsic without submitting it. - pub async fn create_signed_with_nonce( + pub fn create_signed_with_nonce( &self, call: &Call, signer: &(dyn Signer + Send + Sync), @@ -234,7 +234,6 @@ where }; self.create_signed_with_nonce(call, signer, account_nonce, other_params) - .await } /// Creates and signs an extrinsic and submits it to the chain. Passes default parameters diff --git a/testing/integration-tests/src/client/mod.rs b/testing/integration-tests/src/client/mod.rs index 25a9bf8615..b8aa43f535 100644 --- a/testing/integration-tests/src/client/mod.rs +++ b/testing/integration-tests/src/client/mod.rs @@ -227,7 +227,7 @@ async fn unsigned_extrinsic_is_same_shape_as_polkadotjs() { 12345, ); - let actual_tx = api.tx().create_unsigned(&tx).await.unwrap(); + let actual_tx = api.tx().create_unsigned(&tx).unwrap(); let actual_tx_bytes = actual_tx.encoded(); diff --git a/testing/integration-tests/src/frame/contracts.rs b/testing/integration-tests/src/frame/contracts.rs index bc8ec88b27..31cc84c0e3 100644 --- a/testing/integration-tests/src/frame/contracts.rs +++ b/testing/integration-tests/src/frame/contracts.rs @@ -8,6 +8,7 @@ use crate::{ node_runtime::{ self, contracts::events, + runtime_types::frame_support::weights::weight_v2::Weight, system, }, test_context, @@ -58,7 +59,9 @@ impl ContractsTestContext { let instantiate_tx = node_runtime::tx().contracts().instantiate_with_code( 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit + Weight { + ref_time: 500_000_000_000, + }, // gas_limit None, // storage_deposit_limit code, vec![], // data @@ -100,7 +103,9 @@ impl ContractsTestContext { // call instantiate extrinsic let instantiate_tx = node_runtime::tx().contracts().instantiate( 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit + Weight { + ref_time: 500_000_000_000, + }, // gas_limit None, // storage_deposit_limit code_hash, data, @@ -131,9 +136,11 @@ impl ContractsTestContext { tracing::info!("call: {:?}", contract); let call_tx = node_runtime::tx().contracts().call( MultiAddress::Id(contract), - 0, // value - 500_000_000, // gas_limit - None, // storage_deposit_limit + 0, // value + Weight { + ref_time: 500_000_000, + }, // gas_limit + None, // storage_deposit_limit input_data, ); diff --git a/testing/integration-tests/src/frame/sudo.rs b/testing/integration-tests/src/frame/sudo.rs index 8be70ea2bb..fd5c91a50e 100644 --- a/testing/integration-tests/src/frame/sudo.rs +++ b/testing/integration-tests/src/frame/sudo.rs @@ -5,7 +5,10 @@ use crate::{ node_runtime::{ self, - runtime_types, + runtime_types::{ + self, + frame_support::weights::weight_v2::Weight, + }, sudo, }, pair_signer, @@ -54,7 +57,9 @@ async fn test_sudo_unchecked_weight() -> Result<(), subxt::Error> { dest: bob, value: 10_000, }); - let tx = node_runtime::tx().sudo().sudo_unchecked_weight(call, 0); + let tx = node_runtime::tx() + .sudo() + .sudo_unchecked_weight(call, Weight { ref_time: 0 }); let found_event = api .tx()