diff --git a/Cargo.lock b/Cargo.lock index 4ca717d7da47f2b159b41ad367147eb6c462c472..a66e22157c2702afcafb69edcf7cf56f9847d4e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1160,6 +1160,17 @@ dependencies = [ "syn", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -2862,9 +2873,8 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726b6cb76e568aefc4cc127fdb39cb9d92c176f4df0385eaf8053f770351719c" +version = "0.8.0" +source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -2876,9 +2886,8 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bc39096d2bd470ecbd5ed96c8464e2b2c2ef7ec6f8cb9611604255608624773" +version = "0.8.0" +source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866" dependencies = [ "futures 0.3.19", "http", @@ -2897,9 +2906,8 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b863e5e86a11bfaf46bb3ab5aba184671bd62058e8e3ab741c3395904c7afbf3" +version = "0.8.0" +source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866" dependencies = [ "anyhow", "arrayvec 0.7.1", @@ -2920,9 +2928,8 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ca9f9028b3a9cd3c7c5b876f037def9368c6ba6498fd2d3162bdbece1d0ef9" +version = "0.8.0" +source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866" dependencies = [ "async-trait", "hyper", @@ -2939,9 +2946,8 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a74ecebba6051b2f745bdc286d3b5ae7c5ff4a71828f7285662acc79cdc113c" +version = "0.8.0" +source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -2951,9 +2957,8 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e169725e476234f3f96079fb9d8a6d00226db602d3fa056f044994239a490d78" +version = "0.8.0" +source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866" dependencies = [ "anyhow", "beef", @@ -2965,9 +2970,8 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c97f67449d58b8d90ad57986d12dacab8fd594759ff64eb5e6b6e84e470db977" +version = "0.8.0" +source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -7729,12 +7733,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "subxt" -version = "0.15.0" -source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#0e3e6bf872ee9e3284a48a8f450721d5855a2020" +version = "0.17.0" +source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#c292286e868dcac23315ec0fd4baeec2ef41edcc" dependencies = [ "async-trait", "bitvec 0.20.4", "chameleon", + "derivative", "frame-metadata", "futures 0.3.19", "hex", @@ -7750,13 +7755,12 @@ dependencies = [ "sp-version", "subxt-macro", "thiserror", - "url 2.2.2", ] [[package]] name = "subxt-codegen" -version = "0.2.0" -source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#0e3e6bf872ee9e3284a48a8f450721d5855a2020" +version = "0.17.0" +source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#c292286e868dcac23315ec0fd4baeec2ef41edcc" dependencies = [ "async-trait", "darling", @@ -7773,8 +7777,8 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.1.0" -source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#0e3e6bf872ee9e3284a48a8f450721d5855a2020" +version = "0.17.0" +source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#c292286e868dcac23315ec0fd4baeec2ef41edcc" dependencies = [ "async-trait", "darling", diff --git a/end2end-tests/tests/common/mod.rs b/end2end-tests/tests/common/mod.rs index 773cf7b242ff03344d592709c066cda42617c08b..e3aeb4ccc5066688629246c9669adc6e3206a19c 100644 --- a/end2end-tests/tests/common/mod.rs +++ b/end2end-tests/tests/common/mod.rs @@ -26,11 +26,14 @@ use sp_keyring::AccountKeyring; use std::io::prelude::*; use std::process::Command; use std::str::FromStr; +use subxt::rpc::{rpc_params, ClientT, SubscriptionClientT}; use subxt::{ClientBuilder, DefaultConfig, DefaultExtra}; pub type Api = node_runtime::RuntimeApi<DefaultConfig, DefaultExtra<DefaultConfig>>; pub type Client = subxt::Client<DefaultConfig>; pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>; +pub type TransactionProgress<'client> = + subxt::TransactionProgress<'client, DefaultConfig, node_runtime::DispatchError>; pub const SUDO_ACCOUNT: AccountKeyring = AccountKeyring::Alice; @@ -74,10 +77,7 @@ pub async fn create_empty_block(client: &Client) -> Result<()> { let _: Value = client .rpc() .client - .request( - "engine_createBlock", - &[Value::Bool(true), Value::Bool(false), Value::Null], - ) + .request("engine_createBlock", rpc_params![true, false, Value::Null]) .await?; Ok(()) @@ -92,16 +92,13 @@ pub async fn create_block_with_extrinsic( let ext_hash = <DefaultConfig as subxt::Config>::Hashing::hash_of(&extrinsic); // Submit and watch for transaction progress. let sub = client.rpc().watch_extrinsic(extrinsic).await?; - let watcher = subxt::TransactionProgress::new(sub, client, ext_hash); + let watcher = TransactionProgress::new(sub, client, ext_hash); // Create a non-empty block let _: Value = client .rpc() .client - .request( - "engine_createBlock", - &[Value::Bool(false), Value::Bool(false), Value::Null], - ) + .request("engine_createBlock", rpc_params![false, false, Value::Null]) .await?; // Get extrinsic events