Include a copy of ValidatorId

This avoids needing to depend on Polkadot.
This commit is contained in:
Demi M. Obenour
2020-06-09 14:19:26 -04:00
parent 06bc4ab977
commit 6ccfc9c0b1
2 changed files with 26 additions and 18 deletions
+16 -17
View File
@@ -17,8 +17,8 @@ keywords = ["parity", "substrate", "blockchain"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
[features] [features]
kusama = []
default = ["kusama"] default = ["kusama"]
kusama = ["polkadot"]
[dependencies] [dependencies]
log = "0.4" log = "0.4"
@@ -30,24 +30,23 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
url = "2.1" url = "2.1"
codec = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive", "full"] } codec = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive", "full"] }
frame-metadata = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master" }
hex = "0.4.0" hex = "0.4.0"
sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-subxt-proc-macro = { version = "0.8.0", path = "proc-macro" } substrate-subxt-proc-macro = { version = "0.8.0", path = "proc-macro" }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-std = "2.0.0-rc3"
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" } application-crypto = { version = "2.0.0-rc3", package = "sp-application-crypto" }
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = "2.0.0-rc3"
pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-rpc = "2.0.0-rc3"
sp-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-indices = "2.0.0-rc3"
polkadot = { git = "https://github.com/paritytech/polkadot", branch = "master", optional = true, default-features = false, features = ["std"], package = "polkadot-primitives" } sp-runtime = "2.0.0-rc3"
sp-version = "2.0.0-rc3"
sc-rpc-api = "0.8.0-rc3"
sp-finality-grandpa = "2.0.0-rc3"
sp-consensus-babe = "0.8.0-rc3"
pallet-im-online = "2.0.0-rc3"
sp-authority-discovery = "2.0.0-rc3"
frame-metadata = "11.0.0-rc3"
frame-support = "2.0.0-rc3"
sp-transaction-pool = "2.0.0-rc3"
[dev-dependencies] [dev-dependencies]
async-std = { version = "1.5.0", features = ["attributes"] } async-std = { version = "1.5.0", features = ["attributes"] }
+10 -1
View File
@@ -49,11 +49,19 @@ impl sp_runtime::BoundToRuntimeAppPublic for Grandpa {
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
#[cfg(feature = "kusama")]
mod validator_app {
use application_crypto::{app_crypto, sr25519};
app_crypto!(sr25519, sp_core::crypto::KeyTypeId(*b"para"));
}
/// Parachain marker struct /// Parachain marker struct
#[cfg(feature = "kusama")] #[cfg(feature = "kusama")]
pub struct Parachains; pub struct Parachains;
#[cfg(feature = "kusama")]
impl sp_runtime::BoundToRuntimeAppPublic for Parachains { impl sp_runtime::BoundToRuntimeAppPublic for Parachains {
type Public = polkadot::parachain::ValidatorId; type Public = validator_app::Public;
} }
/// Authority discovery marker struct /// Authority discovery marker struct
@@ -62,6 +70,7 @@ impl sp_runtime::BoundToRuntimeAppPublic for AuthorityDiscovery {
type Public = AuthorityDiscoveryId; type Public = AuthorityDiscoveryId;
} }
#[cfg(feature = "kusama")]
impl_opaque_keys! { impl_opaque_keys! {
/// Substrate base runtime keys /// Substrate base runtime keys
pub struct BasicSessionKeys { pub struct BasicSessionKeys {