Skip to content

Commit

Permalink
companion: for #281
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed Sep 14, 2020
1 parent 32c7369 commit b2b17a7
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 6 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

58 changes: 54 additions & 4 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,33 @@ pub fn crab_build_spec_genesis() -> CrabGenesisConfig {
}),
darwinia_ethereum_relay: Some(crab_runtime::EthereumRelayConfig {
genesis_header_info: (
0,
b"A\x94\x10#h\t#\xe0\xfeMt\xa3K\xda\xc8\x14\x1f%@\xe3\xae\x90b7\x18\xe4}f\xd1\xcaJ-".into(),
vec![
249, 2, 20, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 29, 204, 77, 232, 222, 199, 93, 122, 171,
133, 181, 103, 182, 204, 212, 26, 211, 18, 69, 27, 148, 138, 116, 19, 240, 161,
66, 253, 64, 212, 147, 71, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 160, 215, 248, 151, 79, 181, 172, 120, 217, 172, 9, 155, 154, 213,
1, 139, 237, 194, 206, 10, 114, 218, 209, 130, 122, 23, 9, 218, 48, 88, 15, 5,
68, 160, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248,
110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33,
160, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110,
91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 185, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".into()
),
dags_merkle_roots_loader: crab_runtime::DagsMerkleRootsLoader::from_file(
Expand Down Expand Up @@ -503,8 +528,33 @@ pub fn crab_testnet_genesis(
}),
darwinia_ethereum_relay: Some(crab_runtime::EthereumRelayConfig {
genesis_header_info: (
0,
b"A\x94\x10#h\t#\xe0\xfeMt\xa3K\xda\xc8\x14\x1f%@\xe3\xae\x90b7\x18\xe4}f\xd1\xcaJ-".into(),
vec![
249, 2, 20, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 29, 204, 77, 232, 222, 199, 93, 122, 171,
133, 181, 103, 182, 204, 212, 26, 211, 18, 69, 27, 148, 138, 116, 19, 240, 161,
66, 253, 64, 212, 147, 71, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 160, 215, 248, 151, 79, 181, 172, 120, 217, 172, 9, 155, 154, 213,
1, 139, 237, 194, 206, 10, 114, 218, 209, 130, 122, 23, 9, 218, 48, 88, 15, 5,
68, 160, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248,
110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33,
160, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110,
91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 185, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 4, 0,
0, 0, 0, 128, 130, 19, 136, 128, 128, 160, 17, 187, 232, 219, 78, 52, 123, 78,
140, 147, 124, 28, 131, 112, 228, 181, 237, 51, 173, 179, 219, 105, 203, 219,
122, 56, 225, 229, 11, 27, 130, 250, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, 0,
0, 0, 66,
],
b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".into()
),
dags_merkle_roots_loader: crab_runtime::DagsMerkleRootsLoader::from_file(
Expand Down
1 change: 1 addition & 0 deletions runtime/crab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ darwinia-support = { default-features = false, git = "https:/
darwinia-treasury = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
# darwinia primitives
darwinia-primitives = { default-features = false, path = "../../primitives" }
ethereum-primitives = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
# darwinia runtime
darwinia-runtime-common = { default-features = false, path = "../common" }
# substrate frame
Expand Down
6 changes: 5 additions & 1 deletion runtime/crab/darwinia_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@
"header_hash": "H256"
},
"EthereumReceiptProofThing": "(EthereumHeader, EthereumReceiptProof, MMRProof)",
"MMRProof": "Vec<H256>",
"MMRProof": {
"member_leaf_index": "u64",
"last_leaf_index": "u64",
"proof": "Vec<H256>"
},
"__[pallet.claims]__": {},
"OtherSignature": {
"_enum": {
Expand Down
6 changes: 5 additions & 1 deletion runtime/crab/polkadot_compatible_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@
"header_hash": "H256"
},
"EthereumReceiptProofThing": "(EthereumHeader, EthereumReceiptProof, MMRProof)",
"MMRProof": "Vec<H256>",
"MMRProof": {
"member_leaf_index": "u64",
"last_leaf_index": "u64",
"proof": "Vec<H256>"
},
"__[pallet.claims]__": {},
"OtherSignature": {
"_enum": {
Expand Down
3 changes: 3 additions & 0 deletions runtime/crab/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ use darwinia_primitives::*;
use darwinia_runtime_common::*;
use darwinia_staking::EraIndex;
use darwinia_staking_rpc_runtime_api::RuntimeDispatchInfo as StakingRuntimeDispatchInfo;
use ethereum_primitives::EthereumNetworkType;

/// The address format for describing accounts.
pub type Address = AccountId;
Expand Down Expand Up @@ -769,10 +770,12 @@ type EnsureRootOrHalfTechnicalComittee = EnsureOneOf<
>;
parameter_types! {
pub const EthereumRelayModuleId: ModuleId = ModuleId(*b"da/ethrl");
pub const EthereumNetwork: EthereumNetworkType = EthereumNetworkType::Ropsten;
}
impl darwinia_ethereum_relay::Trait for Runtime {
type ModuleId = EthereumRelayModuleId;
type Event = Event;
type EthereumNetwork = EthereumNetwork;
type Call = Call;
type Currency = Ring;
type RelayerGame = EthereumRelayerGame;
Expand Down

0 comments on commit b2b17a7

Please sign in to comment.