mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 19:15:41 +00:00
Merge branch 'master' into staking
This commit is contained in:
+4
-3
@@ -19,12 +19,13 @@ jsonrpsee = "0.1.0"
|
||||
log = "0.4.8"
|
||||
sc-network = { version = "0.8.0-rc3", default-features = false }
|
||||
sc-service = { version = "0.8.0-rc3", default-features = false }
|
||||
serde_json = "1.0.53"
|
||||
serde_json = "1.0.55"
|
||||
sp-keyring = "2.0.0-rc3"
|
||||
thiserror = "1.0.19"
|
||||
thiserror = "1.0.20"
|
||||
|
||||
[dev-dependencies]
|
||||
async-std = { version = "=1.5.0", features = ["attributes"] }
|
||||
env_logger = "0.7.1"
|
||||
node-template = { git = "https://github.com/paritytech/substrate" }
|
||||
substrate-subxt = { path = ".." }
|
||||
tempdir = "0.3.7"
|
||||
test-node = { path = "../test-node" }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
NODE_TEMPLATE=../../substrate/target/release/node-template
|
||||
NODE_TEMPLATE=../target/release/test-node
|
||||
$NODE_TEMPLATE purge-chain --dev
|
||||
$NODE_TEMPLATE build-spec --dev > dev-chain.json
|
||||
rm -rf /tmp/subxt-light-client
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
NODE_TEMPLATE=../../substrate/target/release/node-template
|
||||
NODE_TEMPLATE=../target/release/test-node
|
||||
$NODE_TEMPLATE purge-chain --chain=dev-chain.json
|
||||
rm -rf /tmp/subxt-light-client
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
NODE_TEMPLATE=../../substrate/target/release/node-template
|
||||
NODE_TEMPLATE=../target/release/test-node
|
||||
$NODE_TEMPLATE --chain=dev-chain.json --alice
|
||||
|
||||
+10
-10
@@ -60,7 +60,6 @@ use sc_service::{
|
||||
use std::{
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
task::Poll,
|
||||
};
|
||||
use thiserror::Error;
|
||||
@@ -209,7 +208,7 @@ fn start_subxt_client<C: ChainSpec + 'static, S: AbstractService>(
|
||||
impl_version: config.impl_version,
|
||||
chain_spec: Box::new(config.chain_spec),
|
||||
role: config.role.into(),
|
||||
task_executor: Arc::new(move |fut, ty| {
|
||||
task_executor: std::sync::Arc::new(move |fut, ty| {
|
||||
match ty {
|
||||
TaskType::Async => task::spawn(fut),
|
||||
TaskType::Blocking => task::spawn_blocking(|| task::block_on(fut)),
|
||||
@@ -220,7 +219,6 @@ fn start_subxt_client<C: ChainSpec + 'static, S: AbstractService>(
|
||||
max_runtime_instances: 8,
|
||||
announce_block: true,
|
||||
dev_key_seed: config.role.into(),
|
||||
base_path: None,
|
||||
|
||||
telemetry_endpoints: Default::default(),
|
||||
telemetry_external_transport: Default::default(),
|
||||
@@ -303,6 +301,7 @@ mod tests {
|
||||
KusamaRuntime as NodeTemplateRuntime,
|
||||
PairSigner,
|
||||
};
|
||||
use tempdir::TempDir;
|
||||
|
||||
#[async_std::test]
|
||||
#[ignore]
|
||||
@@ -328,17 +327,18 @@ mod tests {
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("dev-chain.json");
|
||||
let bytes = async_std::fs::read(chain_spec_path).await.unwrap();
|
||||
let chain_spec =
|
||||
node_template::chain_spec::ChainSpec::from_json_bytes(bytes).unwrap();
|
||||
test_node::chain_spec::ChainSpec::from_json_bytes(bytes).unwrap();
|
||||
let tmp = TempDir::new("subxt-").expect("failed to create tempdir");
|
||||
let config = SubxtClientConfig {
|
||||
impl_name: "substrate-subxt-light-client",
|
||||
impl_version: "0.0.1",
|
||||
author: "David Craven",
|
||||
copyright_start_year: 2020,
|
||||
db: DatabaseConfig::RocksDb {
|
||||
path: "/tmp/subxt-light-client".into(),
|
||||
path: tmp.path().into(),
|
||||
cache_size: 64,
|
||||
},
|
||||
builder: node_template::service::new_light,
|
||||
builder: test_node::service::new_light,
|
||||
chain_spec,
|
||||
role: Role::Light,
|
||||
};
|
||||
@@ -358,18 +358,18 @@ mod tests {
|
||||
#[async_std::test]
|
||||
async fn test_full_client() {
|
||||
env_logger::try_init().ok();
|
||||
let chain_spec = node_template::chain_spec::development_config();
|
||||
let tmp = TempDir::new("subxt-").expect("failed to create tempdir");
|
||||
let config = SubxtClientConfig {
|
||||
impl_name: "substrate-subxt-full-client",
|
||||
impl_version: "0.0.1",
|
||||
author: "David Craven",
|
||||
copyright_start_year: 2020,
|
||||
db: DatabaseConfig::RocksDb {
|
||||
path: "/tmp/subxt-full-client".into(),
|
||||
path: tmp.path().into(),
|
||||
cache_size: 128,
|
||||
},
|
||||
builder: node_template::service::new_full,
|
||||
chain_spec,
|
||||
builder: test_node::service::new_full,
|
||||
chain_spec: test_node::chain_spec::development_config(),
|
||||
role: Role::Authority(AccountKeyring::Alice),
|
||||
};
|
||||
let client = ClientBuilder::<NodeTemplateRuntime>::new()
|
||||
|
||||
Reference in New Issue
Block a user