Skip to content
Snippets Groups Projects
Commit 03642e19 authored by Éloïs's avatar Éloïs
Browse files

deps: upgrade subxt

parent a1dc9fd3
No related branches found
No related tags found
1 merge request!30Substrate monthly 2022 02
...@@ -1160,6 +1160,17 @@ dependencies = [ ...@@ -1160,6 +1160,17 @@ dependencies = [
"syn", "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]] [[package]]
name = "derive_more" name = "derive_more"
version = "0.99.17" version = "0.99.17"
...@@ -2862,9 +2873,8 @@ dependencies = [ ...@@ -2862,9 +2873,8 @@ dependencies = [
[[package]] [[package]]
name = "jsonrpsee" name = "jsonrpsee"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866"
checksum = "726b6cb76e568aefc4cc127fdb39cb9d92c176f4df0385eaf8053f770351719c"
dependencies = [ dependencies = [
"jsonrpsee-client-transport", "jsonrpsee-client-transport",
"jsonrpsee-core", "jsonrpsee-core",
...@@ -2876,9 +2886,8 @@ dependencies = [ ...@@ -2876,9 +2886,8 @@ dependencies = [
[[package]] [[package]]
name = "jsonrpsee-client-transport" name = "jsonrpsee-client-transport"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866"
checksum = "6bc39096d2bd470ecbd5ed96c8464e2b2c2ef7ec6f8cb9611604255608624773"
dependencies = [ dependencies = [
"futures 0.3.19", "futures 0.3.19",
"http", "http",
...@@ -2897,9 +2906,8 @@ dependencies = [ ...@@ -2897,9 +2906,8 @@ dependencies = [
[[package]] [[package]]
name = "jsonrpsee-core" name = "jsonrpsee-core"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866"
checksum = "b863e5e86a11bfaf46bb3ab5aba184671bd62058e8e3ab741c3395904c7afbf3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arrayvec 0.7.1", "arrayvec 0.7.1",
...@@ -2920,9 +2928,8 @@ dependencies = [ ...@@ -2920,9 +2928,8 @@ dependencies = [
[[package]] [[package]]
name = "jsonrpsee-http-client" name = "jsonrpsee-http-client"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866"
checksum = "b7ca9f9028b3a9cd3c7c5b876f037def9368c6ba6498fd2d3162bdbece1d0ef9"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"hyper", "hyper",
...@@ -2939,9 +2946,8 @@ dependencies = [ ...@@ -2939,9 +2946,8 @@ dependencies = [
[[package]] [[package]]
name = "jsonrpsee-proc-macros" name = "jsonrpsee-proc-macros"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866"
checksum = "1a74ecebba6051b2f745bdc286d3b5ae7c5ff4a71828f7285662acc79cdc113c"
dependencies = [ dependencies = [
"proc-macro-crate 1.1.0", "proc-macro-crate 1.1.0",
"proc-macro2", "proc-macro2",
...@@ -2951,9 +2957,8 @@ dependencies = [ ...@@ -2951,9 +2957,8 @@ dependencies = [
[[package]] [[package]]
name = "jsonrpsee-types" name = "jsonrpsee-types"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866"
checksum = "e169725e476234f3f96079fb9d8a6d00226db602d3fa056f044994239a490d78"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"beef", "beef",
...@@ -2965,9 +2970,8 @@ dependencies = [ ...@@ -2965,9 +2970,8 @@ dependencies = [
[[package]] [[package]]
name = "jsonrpsee-ws-client" name = "jsonrpsee-ws-client"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/librelois/jsonrpsee/?branch=duniter-monthly-2022-01#b038aa331e0cd10723512eeb22c8049357606866"
checksum = "c97f67449d58b8d90ad57986d12dacab8fd594759ff64eb5e6b6e84e470db977"
dependencies = [ dependencies = [
"jsonrpsee-client-transport", "jsonrpsee-client-transport",
"jsonrpsee-core", "jsonrpsee-core",
...@@ -7729,12 +7733,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" ...@@ -7729,12 +7733,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
[[package]] [[package]]
name = "subxt" name = "subxt"
version = "0.15.0" version = "0.17.0"
source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#0e3e6bf872ee9e3284a48a8f450721d5855a2020" source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#c292286e868dcac23315ec0fd4baeec2ef41edcc"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bitvec 0.20.4", "bitvec 0.20.4",
"chameleon", "chameleon",
"derivative",
"frame-metadata", "frame-metadata",
"futures 0.3.19", "futures 0.3.19",
"hex", "hex",
...@@ -7750,13 +7755,12 @@ dependencies = [ ...@@ -7750,13 +7755,12 @@ dependencies = [
"sp-version", "sp-version",
"subxt-macro", "subxt-macro",
"thiserror", "thiserror",
"url 2.2.2",
] ]
[[package]] [[package]]
name = "subxt-codegen" name = "subxt-codegen"
version = "0.2.0" version = "0.17.0"
source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#0e3e6bf872ee9e3284a48a8f450721d5855a2020" source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#c292286e868dcac23315ec0fd4baeec2ef41edcc"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"darling", "darling",
...@@ -7773,8 +7777,8 @@ dependencies = [ ...@@ -7773,8 +7777,8 @@ dependencies = [
[[package]] [[package]]
name = "subxt-macro" name = "subxt-macro"
version = "0.1.0" version = "0.17.0"
source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#0e3e6bf872ee9e3284a48a8f450721d5855a2020" source = "git+https://github.com/librelois/subxt.git?branch=duniter-monthly-2022-01#c292286e868dcac23315ec0fd4baeec2ef41edcc"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"darling", "darling",
......
...@@ -26,11 +26,14 @@ use sp_keyring::AccountKeyring; ...@@ -26,11 +26,14 @@ use sp_keyring::AccountKeyring;
use std::io::prelude::*; use std::io::prelude::*;
use std::process::Command; use std::process::Command;
use std::str::FromStr; use std::str::FromStr;
use subxt::rpc::{rpc_params, ClientT, SubscriptionClientT};
use subxt::{ClientBuilder, DefaultConfig, DefaultExtra}; use subxt::{ClientBuilder, DefaultConfig, DefaultExtra};
pub type Api = node_runtime::RuntimeApi<DefaultConfig, DefaultExtra<DefaultConfig>>; pub type Api = node_runtime::RuntimeApi<DefaultConfig, DefaultExtra<DefaultConfig>>;
pub type Client = subxt::Client<DefaultConfig>; pub type Client = subxt::Client<DefaultConfig>;
pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>; 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; pub const SUDO_ACCOUNT: AccountKeyring = AccountKeyring::Alice;
...@@ -74,10 +77,7 @@ pub async fn create_empty_block(client: &Client) -> Result<()> { ...@@ -74,10 +77,7 @@ pub async fn create_empty_block(client: &Client) -> Result<()> {
let _: Value = client let _: Value = client
.rpc() .rpc()
.client .client
.request( .request("engine_createBlock", rpc_params![true, false, Value::Null])
"engine_createBlock",
&[Value::Bool(true), Value::Bool(false), Value::Null],
)
.await?; .await?;
Ok(()) Ok(())
...@@ -92,16 +92,13 @@ pub async fn create_block_with_extrinsic( ...@@ -92,16 +92,13 @@ pub async fn create_block_with_extrinsic(
let ext_hash = <DefaultConfig as subxt::Config>::Hashing::hash_of(&extrinsic); let ext_hash = <DefaultConfig as subxt::Config>::Hashing::hash_of(&extrinsic);
// Submit and watch for transaction progress. // Submit and watch for transaction progress.
let sub = client.rpc().watch_extrinsic(extrinsic).await?; 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 // Create a non-empty block
let _: Value = client let _: Value = client
.rpc() .rpc()
.client .client
.request( .request("engine_createBlock", rpc_params![false, false, Value::Null])
"engine_createBlock",
&[Value::Bool(false), Value::Bool(false), Value::Null],
)
.await?; .await?;
// Get extrinsic events // Get extrinsic events
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment