From 1882ada5f8133f174879881c9cf66fc1a48e461c Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Sat, 5 Sep 2020 16:55:22 +0800 Subject: [PATCH] companion: for #259 --- Cargo.lock | 62 +++++++++++++++++------------------ runtime/crab/src/constants.rs | 2 +- runtime/crab/src/lib.rs | 5 ++- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6732f807d..72734b125 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" [[package]] name = "array-bytes" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "sp-std 2.0.0-rc6", ] @@ -250,9 +250,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59386c3aa61f4e14c4ddda1a6744c119b4bf278ec9f866d3c20bc5728ee0eb97" +checksum = "21279cfaa4f47df10b1816007e738ca3747ef2ee53ffc51cdbf57a8bb266fee3" dependencies = [ "concurrent-queue", "event-listener", @@ -1196,7 +1196,7 @@ dependencies = [ [[package]] name = "darwinia-balances" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-balances-rpc-runtime-api", "darwinia-support", @@ -1211,7 +1211,7 @@ dependencies = [ [[package]] name = "darwinia-balances-rpc" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-balances-rpc-runtime-api", "jsonrpc-core", @@ -1226,7 +1226,7 @@ dependencies = [ [[package]] name = "darwinia-balances-rpc-runtime-api" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-support", "parity-scale-codec", @@ -1238,7 +1238,7 @@ dependencies = [ [[package]] name = "darwinia-claims" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "array-bytes", "darwinia-support", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "darwinia-cli" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "sc-cli", "sc-client-api", @@ -1293,7 +1293,7 @@ dependencies = [ [[package]] name = "darwinia-elections-phragmen" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-support", "frame-support", @@ -1308,7 +1308,7 @@ dependencies = [ [[package]] name = "darwinia-ethereum-backing" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "array-bytes", "darwinia-support", @@ -1326,7 +1326,7 @@ dependencies = [ [[package]] name = "darwinia-ethereum-relay" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "array-bytes", "blake2-rfc", @@ -1350,7 +1350,7 @@ dependencies = [ [[package]] name = "darwinia-header-mmr" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "ckb-merkle-mountain-range", "darwinia-header-mmr-rpc-runtime-api", @@ -1366,7 +1366,7 @@ dependencies = [ [[package]] name = "darwinia-header-mmr-rpc" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-header-mmr-rpc-runtime-api", "jsonrpc-core", @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "darwinia-header-mmr-rpc-runtime-api" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-support", "parity-scale-codec", @@ -1405,7 +1405,7 @@ dependencies = [ [[package]] name = "darwinia-relay-primitives" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "frame-support", "parity-scale-codec", @@ -1416,7 +1416,7 @@ dependencies = [ [[package]] name = "darwinia-relayer-game" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-relay-primitives", "darwinia-support", @@ -1528,7 +1528,7 @@ dependencies = [ [[package]] name = "darwinia-staking" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-staking-rpc-runtime-api", "darwinia-support", @@ -1551,7 +1551,7 @@ dependencies = [ [[package]] name = "darwinia-staking-rpc" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-staking-rpc-runtime-api", "jsonrpc-core", @@ -1566,7 +1566,7 @@ dependencies = [ [[package]] name = "darwinia-staking-rpc-runtime-api" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-support", "parity-scale-codec", @@ -1578,7 +1578,7 @@ dependencies = [ [[package]] name = "darwinia-support" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "ethereum-primitives", "frame-support", @@ -1592,7 +1592,7 @@ dependencies = [ [[package]] name = "darwinia-treasury" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "darwinia-support", "frame-support", @@ -1848,7 +1848,7 @@ dependencies = [ [[package]] name = "ethereum-primitives" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "array-bytes", "ethash", @@ -3013,9 +3013,9 @@ dependencies = [ [[package]] name = "jsonrpc-derive" -version = "14.2.1" +version = "14.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fadf6945e227246825a583514534d864554e9f23d80b3c77d034b10983db5ef" +checksum = "d0e77e8812f02155b85a677a96e1d16b60181950c0636199bc4528524fba98dc" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3691,9 +3691,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b34178653005c1181711c333f0e5604a14a1b5115c814fd42304bdd16245e0" +checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ "cc", "pkg-config", @@ -3870,7 +3870,7 @@ checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" [[package]] name = "merkle-patricia-trie" version = "1.0.0-alpha.3" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#23420e21058a7cae11b0bc911db6d13baffcfaa1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#af67af0748019e125a6b069af84e2a933f32b0ba" dependencies = [ "hashbrown 0.8.2", "keccak-hash", @@ -4975,9 +4975,9 @@ checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e" [[package]] name = "polling" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53c5afb3e8bc82c2780a807374bda0fb8886904d8e9d51e6f4f3743fb1dd27fb" +checksum = "b1e9fa0ab21ed700cf0c4ebec57ae5496bec942a0aef9545562979a9f75b97aa" dependencies = [ "cfg-if", "libc", @@ -5108,9 +5108,9 @@ checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" [[package]] name = "proc-macro2" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" +checksum = "175c513d55719db99da20232b06cda8bab6b83ec2d04e3283edf0213c37c1a29" dependencies = [ "unicode-xid", ] diff --git a/runtime/crab/src/constants.rs b/runtime/crab/src/constants.rs index ab79ed743..d7ef636a2 100644 --- a/runtime/crab/src/constants.rs +++ b/runtime/crab/src/constants.rs @@ -102,7 +102,7 @@ pub mod relay { impl AdjustableRelayerGame for EthereumRelayerGameAdjustor { type Moment = BlockNumber; type Balance = Balance; - type TcBlockNumber = ::BlockNumber; + type TcBlockNumber = <::HeaderThing as HeaderThing>::Number; fn challenge_time(round: Round) -> Self::Moment { match round { diff --git a/runtime/crab/src/lib.rs b/runtime/crab/src/lib.rs index 32872a207..c8273bbab 100644 --- a/runtime/crab/src/lib.rs +++ b/runtime/crab/src/lib.rs @@ -107,6 +107,7 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, + darwinia_ethereum_relay::CheckEthereumRelayHeaderHash, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; @@ -748,7 +749,7 @@ parameter_types! { impl darwinia_ethereum_backing::Trait for Runtime { type ModuleId = EthBackingModuleId; type Event = Event; - type DetermineAccountId = darwinia_ethereum_backing::AccountIdDeterminator; + type RedeemAccountId = AccountId; type EthereumRelay = EthereumRelay; type OnDepositRedeem = Staking; type RingCurrency = Ring; @@ -763,6 +764,7 @@ parameter_types! { impl darwinia_ethereum_relay::Trait for Runtime { type ModuleId = EthereumRelayModuleId; type Event = Event; + type Call = Call; type Currency = Ring; type RelayerGame = EthereumRelayerGame; type ApproveOrigin = ApproveOrigin; @@ -894,6 +896,7 @@ where frame_system::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), pallet_transaction_payment::ChargeTransactionPayment::::from(tip), + darwinia_ethereum_relay::CheckEthereumRelayHeaderHash::::new(), ); let raw_payload = SignedPayload::new(call, extra) .map_err(|e| {