Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary async and fix latest substrate changes #645

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions subxt/src/tx/tx_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
}

/// Creates an unsigned extrinsic without submitting it.
pub async fn create_unsigned<Call>(
pub fn create_unsigned<Call>(
&self,
call: &Call,
) -> Result<SubmittableExtrinsic<T, C>, Error>
Expand Down Expand Up @@ -121,7 +121,7 @@ impl<T: Config, C: OfflineClientT<T>> TxClient<T, C> {
}

/// Creates a raw signed extrinsic without submitting it.
pub async fn create_signed_with_nonce<Call>(
pub fn create_signed_with_nonce<Call>(
&self,
call: &Call,
signer: &(dyn Signer<T> + Send + Sync),
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testing/integration-tests/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
17 changes: 12 additions & 5 deletions testing/integration-tests/src/frame/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::{
node_runtime::{
self,
contracts::events,
runtime_types::frame_support::weights::weight_v2::Weight,
system,
},
test_context,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
);

Expand Down
9 changes: 7 additions & 2 deletions testing/integration-tests/src/frame/sudo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
use crate::{
node_runtime::{
self,
runtime_types,
runtime_types::{
self,
frame_support::weights::weight_v2::Weight,
},
sudo,
},
pair_signer,
Expand Down Expand Up @@ -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()
Expand Down