Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Substrate.from() #426

Merged
merged 7 commits into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,326 changes: 1,253 additions & 1,073 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion availability-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ polkadot-primitives = { path = "../primitives" }
parking_lot = "0.9.0"
log = "0.4.6"
codec = { package = "parity-scale-codec", version = "~1.0.0", default-features = false, features = ["derive"] }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
kvdb = { git = "https://github.com/paritytech/parity-common", rev="616b40150ded71f57f650067fcbc5c99d7c343e6" }
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="616b40150ded71f57f650067fcbc5c99d7c343e6" }
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="616b40150ded71f57f650067fcbc5c99d7c343e6" }
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ tokio = "0.1.7"
futures = "0.1.17"
exit-future = "0.1"
structopt = "0.2"
cli = { package = "substrate-cli", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
cli = { package = "substrate-cli", git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
service = { package = "polkadot-service", path = "../service" }
10 changes: 5 additions & 5 deletions collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ edition = "2018"
[dependencies]
futures = "0.1.17"
futures03 = { package = "futures-preview", version = "0.3.0-alpha.17", features = ["compat"] }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
consensus_common = { package = "substrate-consensus-common", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
consensus_common = { package = "substrate-consensus-common", git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
polkadot-runtime = { path = "../runtime" }
polkadot-primitives = { path = "../primitives" }
polkadot-cli = { path = "../cli" }
Expand All @@ -22,4 +22,4 @@ log = "0.4"
tokio = "0.1.7"

[dev-dependencies]
keyring = { package = "substrate-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
keyring = { package = "substrate-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
4 changes: 2 additions & 2 deletions erasure-coding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ edition = "2018"
primitives = { package = "polkadot-primitives", path = "../primitives" }
reed_solomon = { package = "reed-solomon-erasure", git = "https://github.com/paritytech/reed-solomon-erasure" }
codec = { package = "parity-scale-codec", version = "~1.0.0", default-features = false, features = ["derive"] }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
trie = { package = "substrate-trie", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
trie = { package = "substrate-trie", git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
2 changes: 1 addition & 1 deletion executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ description = "Polkadot node implementation in Rust."
edition = "2018"

[dependencies]
substrate-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
polkadot-runtime = { path = "../runtime" }
10 changes: 5 additions & 5 deletions network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ av_store = { package = "polkadot-availability-store", path = "../availability-st
polkadot-validation = { path = "../validation" }
polkadot-primitives = { path = "../primitives" }
codec = { package = "parity-scale-codec", version = "~1.0.0", default-features = false, features = ["derive"] }
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
futures = "0.1"
log = "0.4"
exit-future = "0.1.4"
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }

[dev-dependencies]
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
2 changes: 1 addition & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ codec = { package = "parity-scale-codec", version = "1.0.5", default-features =
wasmi = { version = "0.4.3", optional = true }
derive_more = { version = "0.14", optional = true }
serde = { version = "1.0", default-features = false, features = [ "derive" ] }
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", branch = "polkadot-testing", default-features = false }
lazy_static = { version = "1.3.0", optional = true }
parking_lot = { version = "0.7.1", optional = true }
log = { version = "0.4.6", optional = true }
Expand Down
16 changes: 8 additions & 8 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ edition = "2018"
[dependencies]
serde = { version = "1.0", optional = true, features = ["derive"] }
parity-scale-codec = { version = "1.0.5", default-features = false, features = ["bit-vec", "derive"] }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
application-crypto = { package = "substrate-application-crypto", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
substrate-client = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sr-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
runtime_primitives = { package = "sr-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
application-crypto = { package = "substrate-application-crypto", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
substrate-client = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
sr-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
runtime_primitives = { package = "sr-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
polkadot-parachain = { path = "../parachain", default-features = false }
bitvec = { version = "0.14.0", default-features = false, features = ["alloc"] }
babe = { package = "srml-babe", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
babe = { package = "srml-babe", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }

[dev-dependencies]
substrate-serializer = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-serializer = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
pretty_assertions = "0.5.1"

[features]
Expand Down
17 changes: 17 additions & 0 deletions primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,20 @@ pub type BlockId = generic::BlockId<Block>;

/// Opaque, encoded, unchecked extrinsic.
pub use runtime_primitives::OpaqueExtrinsic as UncheckedExtrinsic;

/// Custom validity errors used in Polkadot while validating transactions.
#[repr(u8)]
pub enum ValidityError {
/// The ethereum signature is invalid.
InvalidEthereumSignature = 0,
/// The signer has no claim.
SignerHasNoClaim = 1,
/// No permission to execute the call.
NoPermission = 2,
}

impl From<ValidityError> for u8 {
fn from(err: ValidityError) -> Self {
err as u8
}
}
79 changes: 41 additions & 38 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,60 @@ build = "build.rs"

[dependencies]
bitvec = { version = "0.14.0", default-features = false, features = ["alloc"] }
rustc-hex = { version = "2.0.1", default-features = false }
codec = { package = "parity-scale-codec", version = "~1.0.0", default-features = false, features = ["derive"] }
log = { version = "0.3", optional = true }
rustc-hex = { version = "2.0.1", default-features = false }
safe-mix = { version = "1.0", default-features = false}
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
safe-mix = { version = "1.0", default-features = false}

babe-primitives = { package = "substrate-consensus-babe-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
inherents = { package = "substrate-inherents", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
offchain-primitives = { package = "substrate-offchain-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
sr-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
sr-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
sr-staking-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
substrate-serializer = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
substrate-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
version = { package = "sr-version", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }

authorship = { package = "srml-authorship", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
babe = { package = "srml-babe", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
balances = { package = "srml-balances", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
collective = { package = "srml-collective", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
democracy = { package = "srml-democracy", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
elections = { package = "srml-elections", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
executive = { package = "srml-executive", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
finality-tracker = { package = "srml-finality-tracker", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
grandpa = { package = "srml-grandpa", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
im-online = { package = "srml-im-online", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
indices = { package = "srml-indices", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
membership = { package = "srml-membership", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
offences = { package = "srml-offences", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
session = { package = "srml-session", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
srml-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
staking = { package = "srml-staking", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
sudo = { package = "srml-sudo", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
system = { package = "srml-system", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
timestamp = { package = "srml-timestamp", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }
treasury = { package = "srml-treasury", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-testing" }

primitives = { package = "polkadot-primitives", path = "../primitives", default-features = false }
codec = { package = "parity-scale-codec", version = "~1.0.0", default-features = false, features = ["derive"] }
substrate-serializer = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
rstd = { package = "sr-std", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sr-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
srml-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
substrate-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
inherents = { package = "substrate-inherents", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
offchain-primitives = { package = "substrate-offchain-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
authorship = { package = "srml-authorship", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
balances = { package = "srml-balances", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
collective = { package = "srml-collective", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
elections = { package = "srml-elections", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
democracy = { package = "srml-democracy", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
executive = { package = "srml-executive", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
finality-tracker = { package = "srml-finality-tracker", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
grandpa = { package = "srml-grandpa", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
im-online = { package = "srml-im-online", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
indices = { package = "srml-indices", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
membership = { package = "srml-membership", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
offences = { package = "srml-offences", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sr-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sr-staking-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
session = { package = "srml-session", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
staking = { package = "srml-staking", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sudo = { package = "srml-sudo", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
system = { package = "srml-system", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
timestamp = { package = "srml-timestamp", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
treasury = { package = "srml-treasury", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
version = { package = "sr-version", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
babe = { package = "srml-babe", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
babe-primitives = { package = "substrate-consensus-babe-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
substrate-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }

[dev-dependencies]
hex-literal = "0.2.0"
libsecp256k1 = "0.2.1"
tiny-keccak = "1.4.2"
keyring = { package = "substrate-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
keyring = { package = "substrate-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
substrate-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-testing" }
trie-db = "0.15"
serde_json = "1.0"

[build-dependencies]
wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.0.1" }
wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.0.2" }

[features]
default = ["std"]
Expand Down
4 changes: 2 additions & 2 deletions runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
use wasm_builder_runner::{build_current_project, WasmBuilderSource};

fn main() {
build_current_project("wasm_binary.rs", WasmBuilderSource::Crates("1.0.3"));
}
build_current_project("wasm_binary.rs", WasmBuilderSource::Crates("1.0.5"));
}
Loading