Skip to content

Commit

Permalink
Develop (#160)
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
aurexav authored Dec 11, 2019
2 parents cb31bec + 0d89dd0 commit c5e0807
Show file tree
Hide file tree
Showing 21 changed files with 156 additions and 178 deletions.
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.
2 changes: 1 addition & 1 deletion core/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "darwinia-cli"
version = "0.1.0"
authors = ["Darwinia Network <hello@itering.com>"]
authors = ["Darwinia Network <hello@darwinia.network>"]
description = "Darwinia CLI interface."
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion node/cli/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn main() -> Result<(), darwinia_cli::error::Error> {
commit: env!("VERGEN_SHA_SHORT"),
version: env!("CARGO_PKG_VERSION"),
executable_name: "darwinia",
author: "Darwinia Network <hello@itering.com>",
author: ["Darwinia Network <hello@darwinia.network>"],
description: "Darwinia poc-1 node",
support_url: "https://github.com/darwinia-network/darwinia/issues/new",
};
Expand Down
98 changes: 49 additions & 49 deletions node/cli/res/crayfish-fir.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "node-runtime"
version = "0.2.0"
authors = ["Darwinia Network <hello@itering.com>"]
authors = ["Darwinia Network <hello@darwinia.network>"]
edition = "2018"

[dependencies]
Expand Down
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 <[email protected]>"]
version = "0.2.0"
authors = ["Darwinia Network <[email protected]>"]
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
Loading

0 comments on commit c5e0807

Please sign in to comment.