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

Commit

Permalink
Move Bridge Pallet into FRAME (#4373)
Browse files Browse the repository at this point in the history
* Move `bridge` crate into `frame` folder

* Make `bridge` pallet compile after `the-big-reorg`
  • Loading branch information
HCastano authored Dec 17, 2019
1 parent 4f7397d commit 296d8a4
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 74 deletions.
50 changes: 18 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ members = [
"frame/authorship",
"frame/babe",
"frame/balances",
"frame/bridge",
"frame/collective",
"frame/contracts",
"frame/contracts/rpc",
Expand Down
37 changes: 37 additions & 0 deletions frame/bridge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "pallet-bridge"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
fg_primitives = { package = "sp-finality-grandpa", path = "../../primitives/finality-grandpa" }
hash-db = { version = "0.15.2", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
session = { package = "pallet-session", path = "../session", default-features = false }
serde = { version = "1.0", optional = true }
sp-runtime = { path = "../../primitives/runtime", default-features = false }
state-machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
sp-trie = { path = "../../primitives/trie", default-features = false }

[dev-dependencies]
sp-io = { path = "../../primitives/io", default-features = false }

[features]
default = ["std"]
std = [
"serde",
"codec/std",
"session/std",
"primitives/std",
"support/std",
"system/std",
"sp-runtime/std",
"sp-trie/std",
"sp-io/std",
]
10 changes: 5 additions & 5 deletions srml/bridge/src/lib.rs → frame/bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ mod storage_proof;
use crate::storage_proof::StorageProofChecker;
use codec::{Encode, Decode};
use fg_primitives::{AuthorityId, AuthorityWeight};
use sr_primitives::traits::Header;
use sp_runtime::traits::Header;
use state_machine::StorageProof;
use support::{
decl_error, decl_module, decl_storage,
Expand Down Expand Up @@ -138,7 +138,7 @@ impl<T: Trait> Module<T> {
validator_set: &Vec<(AuthorityId, AuthorityWeight)>,
) -> Result<(), Error> {

let checker = <StorageProofChecker<<T::Hashing as sr_primitives::traits::Hash>::Hasher>>::new(
let checker = <StorageProofChecker<<T::Hashing as sp_runtime::traits::Hash>::Hasher>>::new(
*state_root,
proof.clone()
)?;
Expand Down Expand Up @@ -190,7 +190,7 @@ mod tests {
use super::*;

use primitives::{Blake2Hasher, H256, Public};
use sr_primitives::{
use sp_runtime::{
Perbill, traits::{Header as HeaderT, IdentityLookup}, testing::Header, generic::Digest,
};
use support::{assert_ok, assert_err, impl_outer_origin, parameter_types};
Expand Down Expand Up @@ -222,7 +222,7 @@ mod tests {
type BlockNumber = u64;
type Call = ();
type Hash = H256;
type Hashing = sr_primitives::traits::BlakeTwo256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = DummyAuthorityId;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
Expand All @@ -236,7 +236,7 @@ mod tests {

impl Trait for Test {}

fn new_test_ext() -> runtime_io::TestExternalities {
fn new_test_ext() -> sp_io::TestExternalities {
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
GenesisConfig {
num_bridges: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use hash_db::{Hasher, HashDB, EMPTY_PREFIX};
use state_machine::StorageProof;
use trie::{MemoryDB, Trie, trie_types::TrieDB};
use sp_trie::{MemoryDB, Trie, trie_types::TrieDB};

use crate::Error;

Expand Down
36 changes: 0 additions & 36 deletions srml/bridge/Cargo.toml

This file was deleted.

0 comments on commit 296d8a4

Please sign in to comment.