Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #160

Merged
merged 8 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from 6 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
29 changes: 9 additions & 20 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion fe_develop_conf.json → boot-conf/develop/alice.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ws-port": 23334,
"rpc-cors": "all",
"port": 23335,
"base-path": "/tmp/darwinia-alice"
"base-path": "/tmp/darwinia-develop/alice"
}
10 changes: 10 additions & 0 deletions boot-conf/develop/bob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Darwinia-Bob",
"rpc-external": true,
"rpc-port": 23336,
"ws-external": true,
"ws-port": 23337,
"rpc-cors": "all",
"port": 23338,
"base-path": "/tmp/darwinia-develop/bob"
}
File renamed without changes.
98 changes: 49 additions & 49 deletions node/cli/res/crayfish-fir.json

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions srml/balances/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
[package]
name = "darwinia-balances"
version = "2.0.0"
authors = ["Xavier Lau <c.estlavie@icloud.com>"]
version = "0.2.0"
authors = ["Darwinia Network <hello@itering.com>"]
AurevoirXavier marked this conversation as resolved.
Show resolved Hide resolved
edition = "2018"

[dependencies]
serde = { version = "1.0.101", optional = true }
safe-mix = { version = "1.0.0", default-features = false }
# crates.io
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
substrate-keyring = { git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", optional = true }
serde = { version = "1.0.101", optional = true }

# github.com
rstd = { package = "sr-std", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
sr-primitives = { git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
support = { package = "srml-support", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
system = { package = "srml-system", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
timestamp = { package = "srml-timestamp", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }

# darwinia
darwinia-support = { path = "../support", default-features = false }

[dev-dependencies]
Expand All @@ -25,13 +27,12 @@ transaction-payment = { package = "srml-transaction-payment", git = "https://git
[features]
default = ["std"]
std = [
"serde",
"safe-mix/std",
"substrate-keyring",
"codec/std",
"serde",

"rstd/std",
"support/std",
"sr-primitives/std",
"support/std",
"system/std",
"timestamp/std",

Expand Down
2 changes: 1 addition & 1 deletion srml/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ mod mock;
#[cfg(all(feature = "std", test))]
mod tests;

pub use self::imbalances::{NegativeImbalance, PositiveImbalance};
use darwinia_support::{BalanceLock, LockIdentifier, LockableCurrency, WithdrawLock, WithdrawReason, WithdrawReasons};
use imbalances::{NegativeImbalance, PositiveImbalance};

pub trait Subtrait<I: Instance = DefaultInstance>: system::Trait + timestamp::Trait {
/// The balance of an account.
Expand Down
10 changes: 5 additions & 5 deletions srml/balances/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

//! Test utilities
use crate::{GenesisConfig, Module, Trait};
use std::cell::RefCell;

use primitives::H256;
use runtime_io;
use sr_primitives::{
testing::Header,
traits::{ConvertInto, IdentityLookup},
weights::{DispatchInfo, Weight},
Perbill,
};
use std::cell::RefCell;
use support::traits::Get;
use support::{impl_outer_origin, parameter_types};
use support::{impl_outer_origin, parameter_types, traits::Get};

use crate::*;

impl_outer_origin! {
pub enum Origin for Runtime {}
Expand Down
3 changes: 1 addition & 2 deletions srml/balances/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ use support::{
use system::RawOrigin;
use transaction_payment::ChargeTransactionPayment;

use super::*;
use crate::{mock::*, *};
use darwinia_support::{LockIdentifier, LockableCurrency, NormalLock, WithdrawLock, WithdrawReason, WithdrawReasons};
use mock::{info_from_weight, Balances, ExtBuilder, Runtime, System, Timestamp, CALL};

const ID_1: LockIdentifier = *b"1 ";
const ID_2: LockIdentifier = *b"2 ";
Expand Down
10 changes: 6 additions & 4 deletions srml/eth-backing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
[package]
name = "darwinia-eth-backing"
version = "0.1.0"
version = "0.2.0"
authors = ["Darwinia Network <[email protected]>"]
edition = "2018"

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

[dependencies]
#blake2 = { version = "0.8.1", default-features = false }
# crates.io
serde = { version = "1.0.101", optional = true }

codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }

# github.com
rstd = { package = "sr-std", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
support = { package = "srml-support", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
system = { package = "srml-system", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }

# darwinia
darwinia-support = { package = "darwinia-support", path = "../support", default-features = false }

[features]
default = ["std"]
std = [
"codec/std",
"serde/std",

"codec/std",
"rstd/std",
"support/std",
"system/std",
Expand Down
7 changes: 1 addition & 6 deletions srml/eth-backing/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
//! prototype module for bridging in ethereum poa blockcahin
//! prototype module for bridging in ethereum poa blockchain

#![recursion_limit = "128"]
#![cfg_attr(not(feature = "std"), no_std)]

// use blake2::Blake2b;
//use codec::{Decode, Encode};
use rstd::vec::Vec;
use support::{decl_event, decl_module, decl_storage, dispatch::Result, traits::Currency};
use system::ensure_signed;

use darwinia_support::LockableCurrency;
//use merkle_mountain_range::{Hash, MerkleMountainRange};

pub type Moment = u64;

Expand All @@ -19,8 +16,6 @@ pub trait Trait: system::Trait {
type Ring: LockableCurrency<Self::AccountId, Moment = Moment>;
}

// config() require `serde = { version = "1.0.101", optional = true }`
// tracking issue: https://github.com/rust-lang/rust/issues/27812
decl_storage! {
trait Store for Module<T: Trait> as EthBacking {
pub DepositPool get(deposit_pool) config(): RingBalanceOf<T>;
Expand Down
29 changes: 15 additions & 14 deletions srml/eth-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,43 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# crates.io
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true }

codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
# github.com
rlp = { package = "rlp", git = "https://github.com/darwinia-network/parity-common.git", default-features = false }
rstd = { package = "sr-std", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
system = { package = "srml-system", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
sr-primitives = { git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
support = { package = "srml-support", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }
sr-eth-primitives = { path = "../../core/sr-eth-primitives", default-features = false }
system = { package = "srml-system", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop", default-features = false }

rlp = { package = "rlp", git = "https://github.com/darwinia-network/parity-common.git", default-features = false }
# darwinia
ethash = { path = "../../core/ethash", default-features = false }
merkle-patricia-trie = { path = "../../core/merkle-patricia-trie", default-features = false }
sr-eth-primitives = { path = "../../core/sr-eth-primitives", default-features = false }

[dev-dependencies]
runtime-io = { package = "sr-io", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
primitives = { package = "substrate-primitives", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
transaction-payment = { package = "srml-transaction-payment", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
rustc-hex = "2.0"
keccak-hasher = "0.15.2"
triehash = { package = "triehash", git = "https://github.com/darwinia-network/parity-common.git" }
hex-literal = "0.2.1"
sha3 = { version = "0.8", default-features = false }
keccak-hasher = "0.15.2"
rustc-hex = "2.0"

primitives = { package = "substrate-primitives", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
runtime-io = { package = "sr-io", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }

[features]
default = ["std"]
std = [
"codec/std",
"serde/std",

"codec/std",
"rlp/std",
"rstd/std",
"sr-eth-primitives/std",
"sr-primitives/std",
"support/std",
"system/std",

"ethash/std",
"merkle-patricia-trie/std",
"rlp/std",
"sr-eth-primitives/std",
]
21 changes: 8 additions & 13 deletions srml/eth-relay/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
//! prototype module for bridging in ethereum poa blockcahin
//! prototype module for bridging in ethereum poa blockchain

#![recursion_limit = "128"]
#![cfg_attr(not(feature = "std"), no_std)]

// use blake2::Blake2b;
use codec::{Decode, Encode};
use rstd::{result, vec::Vec};
use sr_eth_primitives::{
header::EthHeader, pow::EthashPartial, pow::EthashSeal, receipt::Receipt, BlockNumber as EthBlockNumber, H256, U256,
};

use ethash::{EthereumPatch, LightDAG};

use sr_primitives::RuntimeDebug;
use support::{decl_event, decl_module, decl_storage, dispatch::Result, ensure, traits::Get};

use system::ensure_signed;

use sr_primitives::RuntimeDebug;

use ethash::{EthereumPatch, LightDAG};
use merkle_patricia_trie::{trie::Trie, MerklePatriciaTrie, Proof};
use sr_eth_primitives::{
header::EthHeader, pow::EthashPartial, pow::EthashSeal, receipt::Receipt, BlockNumber as EthBlockNumber, H256, U256,
};

type DAG = LightDAG<EthereumPatch>;

#[cfg(test)]
#[cfg(all(feature = "std", test))]
mod mock;
#[cfg(test)]
#[cfg(all(feature = "std", test))]
mod tests;

pub trait Trait: system::Trait {
Expand Down
15 changes: 5 additions & 10 deletions srml/eth-relay/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
//! Test utilities

use crate::{Module, Trait};
use primitives::H256;
use runtime_io;
use sr_primitives::{
testing::Header,
traits::IdentityLookup,
// weights::{DispatchInfo, Weight},
Perbill,
};
use std::cell::RefCell;
//use support::traits::Get;

use primitives::H256;
use sr_primitives::{testing::Header, traits::IdentityLookup, Perbill};
use support::{impl_outer_origin, parameter_types};

use crate::*;

impl_outer_origin! {
pub enum Origin for Runtime {}
}
Expand Down
Loading