Get substrate dependencies from crates io (#387)

* get Substrate dependencies from crates.io

* removing unused dependencies

* cargo fmt --all

* remove commented dependencies

* remove commented dependencies again

* try to fix compilation
This commit is contained in:
Svyatoslav Nikolsky
2020-09-30 15:26:13 +03:00
committed by Bastian Köcher
parent f43e405b5e
commit 07a514e9f7
26 changed files with 281 additions and 1170 deletions
+11 -36
View File
@@ -8,45 +8,22 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
# Bridge dependencies
bp-message-dispatch = { path = "../../primitives/message-dispatch", default-features = false }
bp-runtime = { path = "../../primitives/runtime", default-features = false }
# Substrate Based Dependencies
[dependencies.frame-support]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Substrate Dependencies
[dependencies.frame-system]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
frame-support = { version = "2.0", default-features = false }
frame-system = { version = "2.0", default-features = false }
sp-std = { version = "2.0", default-features = false }
sp-runtime = { version = "2.0", default-features = false }
[dependencies.sp-std]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-core]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-io]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dev-dependencies]
sp-core = "2.0"
sp-io = "2.0"
[features]
default = ["std"]
@@ -55,8 +32,6 @@ std = [
"bp-runtime/std",
"frame-support/std",
"frame-system/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]
+17 -40
View File
@@ -7,57 +7,31 @@ edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
bp-currency-exchange = { path = "../../primitives/currency-exchange", default-features = false }
bp-header-chain = { path = "../../primitives/header-chain", default-features = false }
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false }
serde = { version = "1.0", optional = true }
# Substrate Based Dependencies
[dependencies.frame-support]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Bridge dependencies
[dependencies.frame-system]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
bp-currency-exchange = { path = "../../primitives/currency-exchange", default-features = false }
bp-header-chain = { path = "../../primitives/header-chain", default-features = false }
[dependencies.sp-std]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Substrate Dependencies
[dependencies.sp-runtime]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
frame-benchmarking = { version = "2.0", default-features = false, optional = true }
frame-support = { version = "2.0", default-features = false }
frame-system = { version = "2.0", default-features = false }
sp-runtime = { version = "2.0", default-features = false }
sp-std = { version = "2.0", default-features = false, optional = true }
[dependencies.frame-benchmarking]
optional = true
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dev-dependencies.sp-core]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dev-dependencies.sp-io]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dev-dependencies]
sp-core = "2.0"
sp-io = "2.0"
[features]
default = ["std"]
std = [
"bp-currency-exchange/std",
"bp-header-chain/std",
"codec/std",
"frame-benchmarking/std",
"frame-support/std",
@@ -66,4 +40,7 @@ std = [
"sp-runtime/std",
"sp-std/std",
]
runtime-benchmarks = ["frame-benchmarking"]
runtime-benchmarks = [
"frame-benchmarking",
"sp-std",
]
@@ -7,9 +7,6 @@ edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
# General dependencies
codec = { package = "parity-scale-codec", version = "1.3.4" }
ethereum-types = "0.9.2"
finality-grandpa = "0.12.3"
@@ -20,30 +17,12 @@ log = "0.4.11"
rialto-runtime = { path = "../../../bin/rialto-runtime" }
[dependencies.sp-blockchain]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
# Substrate Dependencies
[dependencies.sp-finality-grandpa]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dependencies.sc-finality-grandpa]
version = "0.8.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
sc-finality-grandpa = "0.8"
sp-blockchain = "2.0"
sp-finality-grandpa = "2.0"
sp-runtime = "2.0"
[dev-dependencies]
hex = "0.4"
[dev-dependencies.sp-core]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
sp-core = "2.0"
+10 -44
View File
@@ -7,58 +7,24 @@ edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
bp-eth-poa = { path = "../../primitives/ethereum-poa", default-features = false }
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false }
hex-literal = "0.3"
libsecp256k1 = { version = "0.3.4", default-features = false, features = ["hmac"], optional = true }
serde = { version = "1.0", optional = true }
# Substrate Based Dependencies
[dependencies.frame-support]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Bridge dependencies
[dependencies.frame-system]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
bp-eth-poa = { path = "../../primitives/ethereum-poa", default-features = false }
[dependencies.sp-std]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Substrate Dependencies
[dependencies.sp-io]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
frame-benchmarking = { version = "2.0", default-features = false, optional = true }
frame-support = { version = "2.0", default-features = false }
frame-system = { version = "2.0", default-features = false }
sp-io = { version = "2.0", default-features = false }
sp-runtime = { version = "2.0", default-features = false }
sp-std = { version = "2.0", default-features = false }
[dependencies.sp-runtime]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-benchmarking]
optional = true
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.libsecp256k1]
optional = true
version = "0.3.4"
default-features = false
features = ["hmac"]
# Dev Dependencies
[dev-dependencies]
bp-eth-poa = { path = "../../primitives/ethereum-poa", features = ["std"] }
libsecp256k1 = { version = "0.3.4", features = ["hmac"] }
[features]
+11 -35
View File
@@ -7,54 +7,30 @@ edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
bp-message-dispatch = { path = "../../primitives/message-dispatch", default-features = false }
bp-message-lane = { path = "../../primitives/message-lane", default-features = false }
bp-runtime = { path = "../../primitives/runtime", default-features = false }
codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
# Substrate Based Dependencies
# Bridge dependencies
[dependencies.frame-support]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
bp-message-lane = { path = "../../primitives/message-lane", default-features = false }
[dependencies.frame-system]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Substrate Dependencies
[dependencies.sp-std]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
frame-support = { version = "2.0", default-features = false }
frame-system = { version = "2.0", default-features = false }
sp-runtime = { version = "2.0", default-features = false }
sp-std = { version = "2.0", default-features = false }
[dev-dependencies.sp-core]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dev-dependencies.sp-io]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dev-dependencies.sp-runtime]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dev-dependencies]
sp-core = "2.0"
sp-io = "2.0"
[features]
default = ["std"]
std = [
"bp-message-dispatch/std",
"bp-message-lane/std",
"bp-runtime/std",
"codec/std",
"frame-support/std",
"frame-system/std",
"sp-runtime/std",
"sp-std/std",
]
+10 -38
View File
@@ -7,50 +7,22 @@ edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
bp-runtime = { path = "../../../primitives/runtime" }
bp-message-lane = { path = "../../../primitives/message-lane" }
derive_more = "0.99.2"
futures = { version = "0.3.5", features = ["compat"] }
jsonrpc-core = "15.0.0"
jsonrpc-core-client = "15.0.0"
jsonrpc-derive = "15.0.0"
# Substrate Based Dependencies
# Bridge dependencies
[dependencies.sc-client-api]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
bp-runtime = { path = "../../../primitives/runtime" }
bp-message-lane = { path = "../../../primitives/message-lane" }
[dependencies.sp-blockchain]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
# Substrate Dependencies
[dependencies.sp-core]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-state-machine]
version = "0.8.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-trie]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dev-dependencies]
async-std = "1.6.5"
[dev-dependencies.substrate-test-runtime-client]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
sc-client-api = "2.0"
sp-blockchain = "2.0"
sp-core = "2.0"
sp-runtime = "2.0"
sp-state-machine = "0.8"
sp-trie = "2.0"
@@ -175,75 +175,3 @@ fn unwrap_or_best<Block: BlockT>(backend: &impl BackendT<Block>, block: Option<B
fn blockchain_err(err: BlockchainError) -> Error {
Error::Client(Box::new(err))
}
#[cfg(test)]
mod tests {
use super::*;
use sp_core::Blake2Hasher;
use sp_runtime::{codec::Decode, traits::Header as HeaderT};
use substrate_test_runtime_client::{
runtime::Block, Backend, DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt,
};
const TEST_INSTANCE: InstanceId = [0, 0, 0, 1];
const TEST_LANE: LaneId = [0, 0, 0, 1];
fn test_key() -> StorageKey {
StorageKey(sp_core::storage::well_known_keys::CODE.to_vec())
}
struct TestRuntimeAdapter;
impl Runtime for TestRuntimeAdapter {
fn message_key(&self, instance: &InstanceId, _lane: &LaneId, _nonce: MessageNonce) -> Option<StorageKey> {
if *instance == TEST_INSTANCE {
Some(test_key())
} else {
None
}
}
fn inbound_lane_data_key(&self, instance: &InstanceId, _lane: &LaneId) -> Option<StorageKey> {
if *instance == TEST_INSTANCE {
Some(test_key())
} else {
None
}
}
}
fn test_handler() -> MessageLaneRpcHandler<Block, Backend, TestRuntimeAdapter> {
let builder = TestClientBuilder::new();
let (_, backend) = builder.build_with_backend();
MessageLaneRpcHandler::new(backend, Arc::new(TestRuntimeAdapter))
}
#[test]
fn storage_proof_is_actually_generated() {
// the only thing we actually care here is that RPC actually generates storage proof
// that can be verified from runtime
// proof is generated by RPC
let handler = test_handler();
let proof = handler
.prove_messages(TEST_INSTANCE, TEST_LANE, 1, 3, None)
.wait()
.unwrap();
// proof is then relayed + checked by runtime (sp_trie supports no_std)
// (storage root is known to underlying bridge pallet)
let root = *handler
.backend
.blockchain()
.header(BlockId::Number(0))
.unwrap()
.unwrap()
.state_root();
let proof = StorageProof::new(Decode::decode(&mut &proof[..]).unwrap());
let trie_db = proof.into_memory_db::<Blake2Hasher>();
let checked_storage_value =
sp_trie::read_trie_value::<sp_trie::Layout<_>, _>(&trie_db, &root, &test_key().0).unwrap();
assert!(checked_storage_value.is_some());
}
}
@@ -9,49 +9,17 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
# Substrate Based Dependencies
# Substrate Dependencies
[dependencies.frame-support]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
frame-support = { version = "2.0", default-features = false }
frame-system = { version = "2.0", default-features = false }
pallet-session = { version = "2.0", default-features = false }
sp-staking = { version = "2.0", default-features = false }
sp-std = { version = "2.0", default-features = false }
[dependencies.frame-system]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-session]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-core]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-staking]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-std]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dev-dependencies]
sp-core = "2.0"
sp-runtime = "2.0"
[features]
default = ["std"]
@@ -60,8 +28,6 @@ std = [
"frame-support/std",
"frame-system/std",
"pallet-session/std",
"sp-core/std",
"sp-runtime/std",
"sp-staking/std",
"sp-std/std",
]
+15 -68
View File
@@ -8,79 +8,26 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bp-header-chain = { path = "../../primitives/header-chain", default-features = false }
codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
finality-grandpa = { version = "0.12.3", default-features = false }
hash-db = { version = "0.15.2", default-features = false }
serde = { version = "1.0", optional = true }
num-traits = { version = "0.2", default-features = false }
serde = { version = "1.0", optional = true }
[dependencies.codec]
package = "parity-scale-codec"
version = "1.3.1"
default-features = false
features = ["derive"]
# Substrate Dependencies
# Substrate Based Dependencies
frame-support = { version = "2.0", default-features = false }
frame-system = { version = "2.0", default-features = false }
sp-finality-grandpa = { version = "2.0", default-features = false }
sp-runtime = { version = "2.0", default-features = false }
sp-std = { version = "2.0", default-features = false }
sp-trie = { version = "2.0", default-features = false }
[dependencies.frame-support]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-system]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-finality-grandpa]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-std]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-trie]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Dev Dependencies
[dev-dependencies.sp-io]
version = "2.0.0"
tag = 'v2.0.0'
git = "https://github.com/paritytech/substrate/"
[dev-dependencies.sp-core]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dev-dependencies.sp-keyring]
version = "2.0.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dev-dependencies.sp-state-machine]
version = "0.8.0"
tag = 'v2.0.0'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dev-dependencies]
sp-core = "2.0"
sp-io = "2.0"
sp-keyring = "2.0"
sp-state-machine = "0.8"
[features]
default = ["std"]
@@ -89,11 +36,11 @@ std = [
"finality-grandpa/std",
"frame-support/std",
"frame-system/std",
"hash-db/std",
"num-traits/std",
"serde",
"sp-finality-grandpa/std",
"sp-runtime/std",
"sp-std/std",
"sp-trie/std",
"sp-io/std",
]