diff --git a/Cargo.toml b/Cargo.toml index 05087d53d9..4326a10251 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,41 +24,41 @@ client = ["substrate-subxt-client"] [dependencies] log = "0.4.8" thiserror = "1.0.20" -futures = "0.3.5" +futures = { version = "0.3.5", package = "futures" } jsonrpsee = { version = "0.1.0", features = ["ws"] } num-traits = { version = "0.2.12", default-features = false } serde = { version = "1.0.114", features = ["derive"] } serde_json = "1.0.55" url = "2.1.1" -codec = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive", "full"] } +codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive", "full"] } -frame-metadata = { version = "11.0.0-rc3", package = "frame-metadata" } -frame-support = { version = "2.0.0-rc3", package = "frame-support" } -sp-runtime = { version = "2.0.0-rc3", package = "sp-runtime" } -sp-version = { version = "2.0.0-rc3", package = "sp-version" } -pallet-indices = { version = "2.0.0-rc3", package = "pallet-indices" } +frame-metadata = { version = "11.0.0-rc4", package = "frame-metadata" } +frame-support = { version = "2.0.0-rc4", package = "frame-support" } +sp-runtime = { version = "2.0.0-rc4", package = "sp-runtime" } +sp-version = { version = "2.0.0-rc4", package = "sp-version" } +pallet-indices = { version = "2.0.0-rc4", package = "pallet-indices" } hex = "0.4.2" -sp-rpc = { version = "2.0.0-rc3", package = "sp-rpc" } -sp-core = { version = "2.0.0-rc3", package = "sp-core" } -sc-rpc-api = { version = "0.8.0-rc3", package = "sc-rpc-api" } -sp-transaction-pool = { version = "2.0.0-rc3", package = "sp-transaction-pool" } +sp-rpc = { version = "2.0.0-rc4", package = "sp-rpc" } +sp-core = { version = "2.0.0-rc4", package = "sp-core" } +sc-rpc-api = { version = "0.8.0-rc4", package = "sc-rpc-api" } +sp-transaction-pool = { version = "2.0.0-rc4", package = "sp-transaction-pool" } substrate-subxt-client = { version = "0.1.0", path = "client", optional = true } substrate-subxt-proc-macro = { version = "0.9.0", path = "proc-macro" } -sp-std = "2.0.0-rc3" -application-crypto = { version = "2.0.0-rc3", package = "sp-application-crypto", default-features = false } -sp-finality-grandpa = { version = "2.0.0-rc3" } -sp-consensus-babe = { version = "0.8.0-rc3" } -pallet-im-online = { version = "2.0.0-rc3" } -sp-authority-discovery = { version = "2.0.0-rc3" } -pallet-staking = "2.0.0-rc3" +sp-std = "2.0.0-rc4" +application-crypto = { version = "2.0.0-rc4", package = "sp-application-crypto", default-features = false } +sp-finality-grandpa = "2.0.0-rc4" +sp-consensus-babe = "0.8.0-rc4" +pallet-im-online = "2.0.0-rc4" +sp-authority-discovery = "2.0.0-rc4" +pallet-staking = "2.0.0-rc4" [dev-dependencies] async-std = { version = "=1.5.0", features = ["attributes"] } env_logger = "0.7.1" wabt = "0.9.2" -frame-system = { version = "2.0.0-rc3", package = "frame-system" } -pallet-balances = { version = "2.0.0-rc3", package = "pallet-balances" } -sp-keyring = { version = "2.0.0-rc3", package = "sp-keyring" } +frame-system = { version = "2.0.0-rc4", package = "frame-system" } +pallet-balances = { version = "2.0.0-rc4", package = "pallet-balances" } +sp-keyring = { version = "2.0.0-rc4", package = "sp-keyring" } substrate-subxt-client = { version = "0.1.0", path = "client" } tempdir = "0.3.7" test-node = { path = "test-node" } diff --git a/client/Cargo.toml b/client/Cargo.toml index 821cced7a7..588e11392a 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -13,14 +13,14 @@ keywords = ["parity", "substrate", "blockchain"] [dependencies] async-std = "=1.5.0" -futures = { version = "0.3.5", features = ["compat"] } +futures = { version = "0.3.5", features = ["compat"], package = "futures" } futures01 = { package = "futures", version = "0.1.29" } 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 } +sc-network = { version = "0.8.0-rc4", default-features = false } +sc-service = { version = "0.8.0-rc4", default-features = false } serde_json = "1.0.55" -sp-keyring = "2.0.0-rc3" +sp-keyring = { version = "2.0.0-rc4", package = "sp-keyring" } thiserror = "1.0.20" [dev-dependencies] diff --git a/client/src/lib.rs b/client/src/lib.rs index 3fed1f10ad..70b8a3596b 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -208,18 +208,20 @@ fn start_subxt_client( impl_version: config.impl_version, chain_spec: Box::new(config.chain_spec), role: config.role.into(), - task_executor: std::sync::Arc::new(move |fut, ty| { + task_executor: (move |fut, ty| { match ty { TaskType::Async => task::spawn(fut), TaskType::Blocking => task::spawn_blocking(|| task::block_on(fut)), }; - }), + }).into(), database: config.db, keystore: KeystoreConfig::InMemory, max_runtime_instances: 8, announce_block: true, dev_key_seed: config.role.into(), + base_path: Default::default(), + informant_output_format: Default::default(), telemetry_endpoints: Default::default(), telemetry_external_transport: Default::default(), default_heap_pages: Default::default(), diff --git a/proc-macro/Cargo.toml b/proc-macro/Cargo.toml index 0a6d6d983a..2256ac0552 100644 --- a/proc-macro/Cargo.toml +++ b/proc-macro/Cargo.toml @@ -25,10 +25,10 @@ synstructure = "0.12.4" [dev-dependencies] async-std = { version = "=1.5.0", features = ["attributes"] } -codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] } +codec = { package = "parity-scale-codec", version = "1.3.1", features = ["derive"] } env_logger = "0.7.1" pretty_assertions = "0.6.1" -sp-keyring = "2.0.0-rc3" +sp-keyring = { version = "2.0.0-rc4", package = "sp-keyring" } substrate-subxt = { path = ".." } trybuild = "1.0.30" diff --git a/src/frame/system.rs b/src/frame/system.rs index f9beaebc46..930b34ec2b 100644 --- a/src/frame/system.rs +++ b/src/frame/system.rs @@ -30,6 +30,7 @@ use serde::de::DeserializeOwned; use sp_runtime::{ traits::{ AtLeast32Bit, + AtLeast32BitUnsigned, Bounded, CheckEqual, Extrinsic, @@ -67,7 +68,7 @@ pub trait System { + MaybeSerializeDeserialize + Debug + MaybeDisplay - + AtLeast32Bit + + AtLeast32BitUnsigned + Default + Bounded + Copy diff --git a/src/lib.rs b/src/lib.rs index 5c1264461d..17b7d7a738 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -248,7 +248,7 @@ impl Client { /// Get a block hash. By default returns the latest block hash pub async fn block_hash( &self, - block_number: Option>, + block_number: Option, ) -> Result, Error> { let hash = self.rpc.block_hash(block_number).await?; Ok(hash) diff --git a/src/rpc.rs b/src/rpc.rs index 81e79a4134..d640784c46 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -83,23 +83,15 @@ pub type ChainBlock = /// Wrapper for NumberOrHex to allow custom From impls #[derive(Serialize, Debug)] -#[serde(bound = "::BlockNumber: Serialize")] -pub struct BlockNumber(NumberOrHex<::BlockNumber>); +pub struct BlockNumber(NumberOrHex); -impl From::BlockNumber>> for BlockNumber -where - T: System, -{ - fn from(x: NumberOrHex<::BlockNumber>) -> Self { +impl From for BlockNumber { + fn from(x: NumberOrHex) -> Self { BlockNumber(x) } } -impl From for BlockNumber -where - T: System, - ::BlockNumber: From, -{ +impl From for BlockNumber { fn from(x: u32) -> Self { NumberOrHex::Number(x.into()).into() } @@ -159,10 +151,9 @@ impl Rpc { } /// Fetch the genesis hash - pub async fn genesis_hash(&self) -> Result { - let block_zero = Some(ListOrValue::Value(NumberOrHex::Number( - T::BlockNumber::min_value(), - ))); + pub async fn genesis_hash(&self) -> Result + { + let block_zero = Some(ListOrValue::Value(NumberOrHex::Number(0))); let params = Params::Array(vec![to_json_value(block_zero)?]); let list_or_value: ListOrValue> = self.client.request("chain_getBlockHash", params).await?; @@ -198,7 +189,7 @@ impl Rpc { /// Get a block hash, returns hash of latest block by default pub async fn block_hash( &self, - block_number: Option>, + block_number: Option, ) -> Result, Error> { let block_number = block_number.map(ListOrValue::Value); let params = Params::Array(vec![to_json_value(block_number)?]); diff --git a/src/runtimes.rs b/src/runtimes.rs index 8714b0dd59..72e6f5b4e3 100644 --- a/src/runtimes.rs +++ b/src/runtimes.rs @@ -79,7 +79,6 @@ impl sp_runtime::BoundToRuntimeAppPublic for AuthorityDiscovery { type Public = AuthorityDiscoveryId; } -#[cfg(feature = "kusama")] impl_opaque_keys! { /// Substrate base runtime keys pub struct BasicSessionKeys { @@ -96,7 +95,6 @@ impl_opaque_keys! { } } -#[cfg(feature = "kusama")] impl_opaque_keys! { /// Polkadot/Kusama runtime keys pub struct SessionKeys { @@ -124,9 +122,7 @@ use crate::{ AccountData, Balances, }, - contracts::Contracts, sudo::Sudo, - system::System, }, session::Session, staking::Staking, @@ -235,6 +231,12 @@ impl Balances for NodeTemplateRuntime { type Balance = u128; } +impl Session for NodeTemplateRuntime { + type SessionIndex = u32; + type ValidatorId = ::AccountId; + type Keys = BasicSessionKeys; +} + impl Sudo for NodeTemplateRuntime {} /// Concrete type definitions compatible with those for kusama, v0.7 @@ -243,17 +245,14 @@ impl Sudo for NodeTemplateRuntime {} /// /// Main difference is `type Address = AccountId`. /// Also the contracts module is not part of the kusama runtime. -#[cfg(feature = "kusama")] #[derive(Debug, Clone, Eq, PartialEq)] pub struct KusamaRuntime; -#[cfg(feature = "kusama")] impl Runtime for KusamaRuntime { type Signature = MultiSignature; type Extra = DefaultExtra; } -#[cfg(feature = "kusama")] impl System for KusamaRuntime { type Index = u32; type BlockNumber = u32; @@ -266,14 +265,12 @@ impl System for KusamaRuntime { type AccountData = AccountData<::Balance>; } -#[cfg(feature = "kusama")] impl Session for KusamaRuntime { type SessionIndex = u32; type ValidatorId = ::AccountId; type Keys = SessionKeys; } -#[cfg(feature = "kusama")] impl Staking for KusamaRuntime { type NominatorIndex = u32; type ValidatorIndex = u16; diff --git a/src/signer.rs b/src/signer.rs index ebbcd41654..f192d6563a 100644 --- a/src/signer.rs +++ b/src/signer.rs @@ -56,6 +56,7 @@ pub trait Signer { } /// Extrinsic signer using a private key. +#[derive(Debug)] pub struct PairSigner { account_id: T::AccountId, nonce: Option, diff --git a/src/subscription.rs b/src/subscription.rs index 6208ce6f7b..c1dd36d91f 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -33,6 +33,7 @@ use crate::{ /// Event subscription simplifies filtering a storage change set stream for /// events of interest. +#[allow(missing_debug_implementations)] pub struct EventSubscription { subscription: Subscription>, decoder: EventsDecoder, diff --git a/test-node/Cargo.toml b/test-node/Cargo.toml index 9691a2053d..7e5a9fe6ae 100644 --- a/test-node/Cargo.toml +++ b/test-node/Cargo.toml @@ -13,30 +13,30 @@ repository = "https://github.com/paritytech/substrate/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -futures = "0.3.5" +futures = { version = "0.3.5", package = "futures" } log = "0.4.8" structopt = "0.3.15" parking_lot = "0.11.0" -sc-cli = { version = "0.8.0-rc3", features = ["wasmtime"] } -sp-core = "2.0.0-rc3" -sc-executor = { version = "0.8.0-rc3", features = ["wasmtime"] } -sc-service = { version = "0.8.0-rc3", features = ["wasmtime"] } -sp-inherents = "2.0.0-rc3" -sc-transaction-pool = "2.0.0-rc3" -sp-transaction-pool = "2.0.0-rc3" -sc-network = "0.8.0-rc3" -sc-consensus-aura = "0.8.0-rc3" -sp-consensus-aura = "0.8.0-rc3" -sp-consensus = "0.8.0-rc3" -sc-consensus = "0.8.0-rc3" -sc-finality-grandpa = "0.8.0-rc3" -sp-finality-grandpa = "2.0.0-rc3" -sc-client-api = "2.0.0-rc3" -sp-runtime = "2.0.0-rc3" -sc-basic-authorship = "0.8.0-rc3" +sc-cli = { version = "0.8.0-rc4", features = ["wasmtime"] } +sp-core = { version = "2.0.0-rc4", package = "sp-core" } +sc-executor = { version = "0.8.0-rc4", features = ["wasmtime"] } +sc-service = { version = "0.8.0-rc4", features = ["wasmtime"] } +sp-inherents = "2.0.0-rc4" +sc-transaction-pool = "2.0.0-rc4" +sp-transaction-pool = { version = "2.0.0-rc4", package = "sp-transaction-pool" } +sc-network = "0.8.0-rc4" +sc-consensus-aura = "0.8.0-rc4" +sp-consensus-aura = "0.8.0-rc4" +sp-consensus = "0.8.0-rc4" +sc-consensus = "0.8.0-rc4" +sc-finality-grandpa = "0.8.0-rc4" +sp-finality-grandpa = "2.0.0-rc4" +sc-client-api = "2.0.0-rc4" +sp-runtime = { version = "2.0.0-rc4", package = "sp-runtime" } +sc-basic-authorship = "0.8.0-rc4" test-node-runtime = { version = "2.0.0-rc3", path = "runtime" } [build-dependencies] -substrate-build-script-utils = "2.0.0-rc3" +substrate-build-script-utils = "2.0.0-rc4" diff --git a/test-node/runtime/Cargo.toml b/test-node/runtime/Cargo.toml index f5c3a9e6fc..90767f8b08 100644 --- a/test-node/runtime/Cargo.toml +++ b/test-node/runtime/Cargo.toml @@ -13,32 +13,32 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] } -aura = { version = "2.0.0-rc3", default-features = false, package = "pallet-aura" } -balances = { version = "2.0.0-rc3", default-features = false, package = "pallet-balances" } -frame-support = { version = "2.0.0-rc3", default-features = false } -grandpa = { version = "2.0.0-rc3", default-features = false, package = "pallet-grandpa" } -randomness-collective-flip = { version = "2.0.0-rc3", default-features = false, package = "pallet-randomness-collective-flip" } -sudo = { version = "2.0.0-rc3", default-features = false, package = "pallet-sudo" } -system = { version = "2.0.0-rc3", default-features = false, package = "frame-system" } -timestamp = { version = "2.0.0-rc3", default-features = false, package = "pallet-timestamp" } -transaction-payment = { version = "2.0.0-rc3", default-features = false, package = "pallet-transaction-payment" } -frame-executive = { version = "2.0.0-rc3", default-features = false } +aura = { version = "2.0.0-rc4", default-features = false, package = "pallet-aura" } +balances = { version = "2.0.0-rc4", default-features = false, package = "pallet-balances" } +frame-support = { version = "2.0.0-rc4", default-features = false, package = "frame-support" } +grandpa = { version = "2.0.0-rc4", default-features = false, package = "pallet-grandpa" } +randomness-collective-flip = { version = "2.0.0-rc4", default-features = false, package = "pallet-randomness-collective-flip" } +sudo = { version = "2.0.0-rc4", default-features = false, package = "pallet-sudo" } +system = { version = "2.0.0-rc4", default-features = false, package = "frame-system" } +timestamp = { version = "2.0.0-rc4", default-features = false, package = "pallet-timestamp" } +transaction-payment = { version = "2.0.0-rc4", default-features = false, package = "pallet-transaction-payment" } +frame-executive = { version = "2.0.0-rc4", default-features = false } serde = { version = "1.0.114", optional = true, features = ["derive"] } -sp-api = { version = "2.0.0-rc3", default-features = false } -sp-block-builder = { default-features = false, version = "2.0.0-rc3" } -sp-consensus-aura = { version = "0.8.0-rc3", default-features = false } -sp-core = { version = "2.0.0-rc3", default-features = false } -sp-inherents = { default-features = false, version = "2.0.0-rc3" } -sp-io = { version = "2.0.0-rc3", default-features = false } -sp-offchain = { version = "2.0.0-rc3", default-features = false } -sp-runtime = { version = "2.0.0-rc3", default-features = false } -sp-session = { version = "2.0.0-rc3", default-features = false } -sp-std = { version = "2.0.0-rc3", default-features = false } -sp-transaction-pool = { version = "2.0.0-rc3", default-features = false } -sp-version = { version = "2.0.0-rc3", default-features = false } +sp-api = { version = "2.0.0-rc4", default-features = false } +sp-block-builder = { default-features = false, version = "2.0.0-rc4" } +sp-consensus-aura = { version = "0.8.0-rc4", default-features = false } +sp-core = { version = "2.0.0-rc4", default-features = false, package = "sp-core" } +sp-inherents = { default-features = false, version = "2.0.0-rc4" } +sp-io = { version = "2.0.0-rc4", default-features = false } +sp-offchain = { version = "2.0.0-rc4", default-features = false } +sp-runtime = { version = "2.0.0-rc4", default-features = false, package = "sp-runtime" } +sp-session = { version = "2.0.0-rc4", default-features = false } +sp-std = { version = "2.0.0-rc4", default-features = false } +sp-transaction-pool = { version = "2.0.0-rc4", default-features = false, package = "sp-transaction-pool" } +sp-version = { version = "2.0.0-rc4", default-features = false, package = "sp-version" } [build-dependencies] -wasm-builder-runner = { version = "1.0.5", package = "substrate-wasm-builder-runner" } +wasm-builder-runner = { version = "1.0.6", package = "substrate-wasm-builder-runner" } [features] default = ["std"] diff --git a/test-node/src/service.rs b/test-node/src/service.rs index 599f149f66..abeb2c8e3a 100644 --- a/test-node/src/service.rs +++ b/test-node/src/service.rs @@ -145,7 +145,7 @@ pub fn new_full(config: Configuration) -> Result>; Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) })? - .build()?; + .build_light()?; if role.is_authority() { let proposer = sc_basic_authorship::ProposerFactory::new( @@ -177,13 +177,13 @@ pub fn new_full(config: Configuration) -> Result Result Result>; Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) })? - .build() + .build_light() }