From 34238eb57715aba97d03120ba832393550199024 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 29 Mar 2021 10:34:43 -0600 Subject: [PATCH 01/11] Bump substrate, cumulus, and polkadot --- Cargo.lock | 428 +++++++++++++++++++++++++---------------------------- 1 file changed, 205 insertions(+), 223 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b5b6a50e1..5b6a3e273f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1181,7 +1181,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1205,7 +1205,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "async-trait", "dyn-clone", @@ -1230,7 +1230,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-relay-chain" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1255,7 +1255,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "derive_more", "futures 0.3.13", @@ -1279,7 +1279,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "cumulus-client-collator", "cumulus-client-consensus-common", @@ -1304,7 +1304,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", @@ -1333,7 +1333,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec", @@ -1348,7 +1348,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -1366,7 +1366,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2024,7 +2024,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", ] @@ -2100,7 +2100,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "3.1.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -2119,7 +2119,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "Inflector", "chrono", @@ -2142,7 +2142,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -2155,7 +2155,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -2171,7 +2171,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "serde", @@ -2182,7 +2182,7 @@ dependencies = [ [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "bitflags", "frame-metadata", @@ -2208,7 +2208,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2220,7 +2220,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -2232,7 +2232,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "proc-macro2", "quote", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "impl-trait-for-tuples 0.2.1", @@ -2259,7 +2259,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-api", @@ -2268,7 +2268,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "parity-scale-codec", @@ -3384,7 +3384,7 @@ dependencies = [ [[package]] name = "kusama-runtime" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "frame-executive", @@ -4184,8 +4184,9 @@ dependencies = [ [[package]] name = "metered-channel" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ + "derive_more", "futures 0.3.13", "futures-timer 3.0.2", ] @@ -4806,12 +4807,6 @@ dependencies = [ "parking_lot 0.11.1", ] -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - [[package]] name = "opaque-debug" version = "0.2.3" @@ -4865,7 +4860,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -4881,7 +4876,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -4896,7 +4891,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-benchmarking", "frame-support", @@ -4920,7 +4915,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-benchmarking", "frame-support", @@ -4935,7 +4930,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -4949,7 +4944,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -4965,7 +4960,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-benchmarking", "frame-support", @@ -4980,7 +4975,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4999,7 +4994,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5138,7 +5133,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5160,7 +5155,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5176,7 +5171,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5195,7 +5190,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5211,7 +5206,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5225,7 +5220,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5240,7 +5235,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5254,7 +5249,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5270,7 +5265,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5285,7 +5280,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5298,7 +5293,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "enumflags2", "frame-support", @@ -5313,7 +5308,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5329,7 +5324,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5349,7 +5344,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5363,7 +5358,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-election-provider-support", "frame-support", @@ -5386,7 +5381,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -5397,7 +5392,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5411,7 +5406,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5429,7 +5424,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5443,7 +5438,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5459,7 +5454,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", @@ -5476,7 +5471,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5487,7 +5482,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5502,7 +5497,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-support", "frame-system", @@ -5517,7 +5512,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "enumflags2", "frame-support", @@ -5531,7 +5526,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#10887b728c563329845192915069a094b3f06139" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -6001,7 +5996,7 @@ checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" [[package]] name = "polkadot-approval-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "polkadot-node-network-protocol", @@ -6015,7 +6010,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "parity-scale-codec", @@ -6029,7 +6024,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "lru", @@ -6051,18 +6046,17 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", - "futures-timer 3.0.2", "lru", + "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.3", - "streamunordered", "thiserror", "tracing", ] @@ -6070,7 +6064,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "frame-benchmarking-cli", "futures 0.3.13", @@ -6090,7 +6084,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "always-assert", "futures 0.3.13", @@ -6100,6 +6094,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", + "sp-core", + "sp-runtime", "thiserror", "tracing", ] @@ -6107,7 +6103,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "0.7.30" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -6119,7 +6115,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -6132,7 +6128,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "polkadot-node-network-protocol", @@ -6146,11 +6142,12 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "async-trait", "futures 0.3.13", "parity-scale-codec", + "parking_lot 0.11.1", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-primitives", @@ -6163,7 +6160,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "polkadot-erasure-coding", @@ -6179,7 +6176,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "derive_more", @@ -6208,7 +6205,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "futures 0.3.13", @@ -6229,7 +6226,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "futures 0.3.13", @@ -6247,7 +6244,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "polkadot-node-subsystem", @@ -6262,7 +6259,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-selection" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "polkadot-node-primitives", @@ -6277,7 +6274,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "parity-scale-codec", @@ -6293,7 +6290,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "polkadot-node-subsystem", @@ -6306,7 +6303,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-proposer" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -6331,7 +6328,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "futures 0.3.13", @@ -6346,7 +6343,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "memory-lru", @@ -6363,7 +6360,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "async-std", "lazy_static", @@ -6380,7 +6377,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "parity-scale-codec", @@ -6389,12 +6386,13 @@ dependencies = [ "polkadot-primitives", "sc-network", "strum", + "thiserror", ] [[package]] name = "polkadot-node-primitives" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "futures 0.3.13", "parity-scale-codec", @@ -6412,7 +6410,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "async-std", "async-trait", @@ -6442,7 +6440,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "async-trait", "futures 0.3.13", @@ -6468,12 +6466,11 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "async-trait", "futures 0.3.13", "futures-timer 3.0.2", - "oorandom", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -6485,7 +6482,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "derive_more", "futures 0.3.13", @@ -6509,24 +6506,10 @@ dependencies = [ "thiserror", ] -[[package]] -name = "polkadot-pov-distribution" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" -dependencies = [ - "futures 0.3.13", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "thiserror", - "tracing", -] - [[package]] name = "polkadot-primitives" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "frame-system", @@ -6556,7 +6539,7 @@ dependencies = [ [[package]] name = "polkadot-procmacro-subsystem-dispatch-gen" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "assert_matches", "proc-macro2", @@ -6567,7 +6550,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "jsonrpc-core 15.1.0", "pallet-transaction-payment-rpc", @@ -6597,7 +6580,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "frame-executive", @@ -6664,7 +6647,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "frame-support", @@ -6701,7 +6684,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "derive_more", @@ -6738,7 +6721,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "0.8.3" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "frame-benchmarking", "frame-system-rpc-runtime-api", @@ -6771,7 +6754,6 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-parachain", - "polkadot-pov-distribution", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime", @@ -6822,7 +6804,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "arrayvec 0.5.2", "futures 0.3.13", @@ -6839,7 +6821,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -6849,7 +6831,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "frame-election-provider-support", @@ -6904,7 +6886,7 @@ dependencies = [ [[package]] name = "polkadot-test-service" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "frame-benchmarking", "frame-system", @@ -7664,7 +7646,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "env_logger 0.8.3", "hex-literal", @@ -7753,7 +7735,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "frame-executive", "frame-support", @@ -7938,7 +7920,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "async-trait", "derive_more", @@ -7966,7 +7948,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -7989,7 +7971,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8005,7 +7987,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec", @@ -8026,7 +8008,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8037,7 +8019,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "chrono", "fdlimit", @@ -8075,7 +8057,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "fnv", @@ -8109,7 +8091,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "blake2-rfc", "hash-db", @@ -8139,7 +8121,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "sc-client-api", "sp-blockchain", @@ -8150,7 +8132,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "fork-tree", @@ -8196,7 +8178,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "futures 0.3.13", @@ -8220,7 +8202,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8233,7 +8215,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "assert_matches", "derive_more", @@ -8267,7 +8249,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -8294,7 +8276,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "log", "sc-client-api", @@ -8308,7 +8290,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "lazy_static", @@ -8337,7 +8319,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "parity-scale-codec", @@ -8353,7 +8335,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "log", "parity-scale-codec", @@ -8368,7 +8350,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "log", "parity-scale-codec", @@ -8386,7 +8368,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "dyn-clone", @@ -8425,7 +8407,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "finality-grandpa", @@ -8449,7 +8431,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-warp-sync" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "futures 0.3.13", @@ -8470,7 +8452,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "ansi_term 0.12.1", "futures 0.3.13", @@ -8488,7 +8470,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "async-trait", "derive_more", @@ -8508,7 +8490,7 @@ dependencies = [ [[package]] name = "sc-light" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "hash-db", "lazy_static", @@ -8527,7 +8509,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "async-std", "async-trait", @@ -8580,7 +8562,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -8597,7 +8579,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "bytes 0.5.6", "fnv", @@ -8625,7 +8607,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "libp2p", @@ -8638,7 +8620,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8647,7 +8629,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "hash-db", @@ -8681,7 +8663,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "futures 0.3.13", @@ -8705,7 +8687,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.1.31", "jsonrpc-core 15.1.0", @@ -8723,7 +8705,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "directories", "exit-future 0.2.0", @@ -8786,7 +8768,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "log", "parity-scale-codec", @@ -8801,7 +8783,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", @@ -8821,7 +8803,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "chrono", "futures 0.3.13", @@ -8841,7 +8823,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8868,7 +8850,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8879,7 +8861,7 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "futures 0.3.13", @@ -8901,7 +8883,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "futures-diagnose", @@ -9327,7 +9309,7 @@ dependencies = [ [[package]] name = "sp-allocator" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "log", "sp-core", @@ -9339,7 +9321,7 @@ dependencies = [ [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "hash-db", "log", @@ -9356,7 +9338,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -9368,7 +9350,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "serde", @@ -9380,7 +9362,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "integer-sqrt", "num-traits", @@ -9393,7 +9375,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-api", @@ -9405,7 +9387,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -9416,7 +9398,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-api", @@ -9428,7 +9410,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "log", @@ -9446,7 +9428,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "serde", "serde_json", @@ -9455,7 +9437,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -9481,7 +9463,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-api", @@ -9497,7 +9479,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "merlin", "parity-scale-codec", @@ -9518,7 +9500,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -9528,7 +9510,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9540,7 +9522,7 @@ dependencies = [ [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "base58", "blake2-rfc", @@ -9584,7 +9566,7 @@ dependencies = [ [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -9593,7 +9575,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "proc-macro2", "quote", @@ -9603,7 +9585,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "environmental", "parity-scale-codec", @@ -9614,7 +9596,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "finality-grandpa", "log", @@ -9631,7 +9613,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "parking_lot 0.11.1", @@ -9643,7 +9625,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "hash-db", @@ -9667,7 +9649,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "lazy_static", "sp-core", @@ -9678,7 +9660,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "async-trait", "derive_more", @@ -9695,7 +9677,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "serde", @@ -9708,7 +9690,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9719,7 +9701,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "sp-api", "sp-core", @@ -9729,7 +9711,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "backtrace", ] @@ -9737,7 +9719,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "serde", "sp-core", @@ -9746,7 +9728,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "either", "hash256-std-hasher", @@ -9767,7 +9749,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec", @@ -9784,7 +9766,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -9796,7 +9778,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "serde", "serde_json", @@ -9805,7 +9787,7 @@ dependencies = [ [[package]] name = "sp-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-api", @@ -9818,7 +9800,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -9828,7 +9810,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "hash-db", "log", @@ -9850,12 +9832,12 @@ dependencies = [ [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9868,7 +9850,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "log", "sp-core", @@ -9881,7 +9863,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "parity-scale-codec", "sp-api", @@ -9894,7 +9876,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "log", "parity-scale-codec", @@ -9907,7 +9889,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "derive_more", "futures 0.3.13", @@ -9923,7 +9905,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "hash-db", "memory-db", @@ -9937,7 +9919,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "futures-core", @@ -9949,7 +9931,7 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9961,7 +9943,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec", @@ -10132,7 +10114,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "platforms", ] @@ -10140,7 +10122,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.13", @@ -10163,7 +10145,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "async-std", "derive_more", @@ -10177,7 +10159,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.1.31", "futures 0.3.13", @@ -10205,7 +10187,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "cfg-if 1.0.0", "frame-support", @@ -10246,7 +10228,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "futures 0.3.13", "parity-scale-codec", @@ -10283,7 +10265,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "ansi_term 0.12.1", "atty", @@ -10944,7 +10926,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#1404f2af4cbe90d35b4c8a1405a9452feb789adc" +source = "git+https://github.com/paritytech/substrate?branch=rococo-v1#401c24e8a62cdf058882b0e92815faef966d9fa1" dependencies = [ "frame-try-runtime", "log", @@ -11577,7 +11559,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "0.8.29" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "bitvec", "frame-executive", @@ -11736,7 +11718,7 @@ dependencies = [ [[package]] name = "xcm" version = "0.8.22" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "parity-scale-codec", ] @@ -11744,7 +11726,7 @@ dependencies = [ [[package]] name = "xcm-builder" version = "0.8.22" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "frame-support", "parity-scale-codec", @@ -11760,7 +11742,7 @@ dependencies = [ [[package]] name = "xcm-executor" version = "0.8.22" -source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#0c9d4c9289e017b7589cc5f761d38545b833e1df" +source = "git+https://github.com/paritytech/polkadot?branch=rococo-v1#b64741e6df8b3dd060ec3829534902704b5ce6f8" dependencies = [ "frame-support", "impl-trait-for-tuples 0.2.1", From 8d914f8ecc137e0255c2f97d34b689ee47971477 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 29 Mar 2021 11:49:56 -0600 Subject: [PATCH 02/11] Update Cumulus to latest rococo-v1 --- Cargo.lock | 55 +++++++++++++++---------------- client/rpc-core/txpool/Cargo.toml | 2 +- node/Cargo.toml | 18 +++++----- runtime/Cargo.toml | 6 ++-- runtime/account/Cargo.toml | 2 +- runtime/precompiles/Cargo.toml | 12 +++---- 6 files changed, 46 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b6a3e273f..bde1f6b611 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,7 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] name = "Inflector" version = "0.11.4" @@ -1181,7 +1179,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1205,7 +1203,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "async-trait", "dyn-clone", @@ -1230,7 +1228,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-relay-chain" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1255,7 +1253,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "derive_more", "futures 0.3.13", @@ -1279,7 +1277,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "cumulus-client-collator", "cumulus-client-consensus-common", @@ -1304,7 +1302,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", @@ -1333,7 +1331,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec", @@ -1348,7 +1346,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -1366,7 +1364,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -1841,7 +1839,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "derive_more", "fc-db", @@ -1865,7 +1863,7 @@ dependencies = [ [[package]] name = "fc-db" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "kvdb", "kvdb-rocksdb", @@ -1879,7 +1877,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "fc-consensus", "fc-db", @@ -1897,7 +1895,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "ethereum", "ethereum-types", @@ -1925,7 +1923,6 @@ dependencies = [ "sc-network", "sc-rpc", "sc-service", - "sc-transaction-graph", "sha3 0.8.2", "sp-api", "sp-blockchain", @@ -1938,7 +1935,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "ethereum-types", "jsonrpc-core 15.1.0", @@ -2042,7 +2039,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "ethereum", "parity-scale-codec", @@ -2056,7 +2053,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "0.8.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "evm", "impl-trait-for-tuples 0.1.3", @@ -2069,7 +2066,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "ethereum", "ethereum-types", @@ -2085,7 +2082,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "ethereum", "ethereum-types", @@ -5009,7 +5006,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "ethereum", "ethereum-types", @@ -5047,7 +5044,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "evm", "evm-gasometer", @@ -5071,7 +5068,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#4f958255b40cf05b155bf0256ee2f033a6b3a383" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "evm", "fp-evm", @@ -5083,7 +5080,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "evm", "fp-evm", @@ -5097,7 +5094,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "evm", "fp-evm", @@ -5109,7 +5106,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#4f958255b40cf05b155bf0256ee2f033a6b3a383" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "evm", "fp-evm", @@ -5121,7 +5118,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#c6d3c7acc7aa33d69f3adba0752104cfbbc04482" +source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" dependencies = [ "evm", "fp-evm", @@ -5526,7 +5523,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#a8bf0e1a7f8901ebeb2df480c12128aa845f22ee" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" dependencies = [ "cumulus-primitives-core", "frame-support", diff --git a/client/rpc-core/txpool/Cargo.toml b/client/rpc-core/txpool/Cargo.toml index 1738c1bef7..b076efe0c8 100644 --- a/client/rpc-core/txpool/Cargo.toml +++ b/client/rpc-core/txpool/Cargo.toml @@ -16,4 +16,4 @@ jsonrpc-derive = "14.0.3" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } diff --git a/node/Cargo.toml b/node/Cargo.toml index 0ea8e4b19c..f5c2672bc4 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -70,16 +70,16 @@ pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrat sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1" } sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1" } -evm = { package = "pallet-evm", git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -ethereum = { package = "pallet-ethereum", git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +evm = { package = "pallet-evm", git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +ethereum = { package = "pallet-ethereum", git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -fc-consensus = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -fp-consensus = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -fc-rpc = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -fp-rpc = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -fc-db = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -fc-mapping-sync = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fc-consensus = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fp-consensus = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fc-rpc = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fp-rpc = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fc-db = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fc-mapping-sync = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } # Cumulus dependencies cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "rococo-v1" } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index e209351ba7..f4eaea98ba 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -44,11 +44,11 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } diff --git a/runtime/account/Cargo.toml b/runtime/account/Cargo.toml index 185618c4f5..a7da632c85 100644 --- a/runtime/account/Cargo.toml +++ b/runtime/account/Cargo.toml @@ -24,7 +24,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", default-features = sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } [features] diff --git a/runtime/precompiles/Cargo.toml b/runtime/precompiles/Cargo.toml index f50a2f849a..baf1fa668a 100644 --- a/runtime/precompiles/Cargo.toml +++ b/runtime/precompiles/Cargo.toml @@ -13,12 +13,12 @@ rustc-hex = { version = "2.0.1", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } -pallet-evm-precompile-bn128 = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } -pallet-evm-precompile-dispatch = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } -pallet-evm-precompile-modexp = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } -pallet-evm-precompile-simple = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } -pallet-evm-precompile-sha3fips = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } +pallet-evm-precompile-bn128 = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } +pallet-evm-precompile-dispatch = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } +pallet-evm-precompile-modexp = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } +pallet-evm-precompile-simple = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } +pallet-evm-precompile-sha3fips = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } [features] default = [ "std" ] From 8d8c51d835fa79709526cea8f24072f063d139eb Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 29 Mar 2021 12:06:27 -0600 Subject: [PATCH 03/11] Update frontier --- Cargo.lock | 33 ++++++++++++++++--------------- client/rpc-core/txpool/Cargo.toml | 2 +- node/Cargo.toml | 18 ++++++++--------- runtime/Cargo.toml | 6 +++--- runtime/account/Cargo.toml | 2 +- runtime/precompiles/Cargo.toml | 12 +++++------ 6 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bde1f6b611..c91b2d2fd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1839,7 +1839,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "derive_more", "fc-db", @@ -1863,7 +1863,7 @@ dependencies = [ [[package]] name = "fc-db" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "kvdb", "kvdb-rocksdb", @@ -1877,7 +1877,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "fc-consensus", "fc-db", @@ -1895,7 +1895,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "ethereum", "ethereum-types", @@ -1923,6 +1923,7 @@ dependencies = [ "sc-network", "sc-rpc", "sc-service", + "sc-transaction-graph", "sha3 0.8.2", "sp-api", "sp-blockchain", @@ -1935,7 +1936,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "ethereum-types", "jsonrpc-core 15.1.0", @@ -2039,7 +2040,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "ethereum", "parity-scale-codec", @@ -2053,7 +2054,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "0.8.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "evm", "impl-trait-for-tuples 0.1.3", @@ -2066,7 +2067,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "ethereum", "ethereum-types", @@ -2082,7 +2083,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "ethereum", "ethereum-types", @@ -5006,7 +5007,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "0.1.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "ethereum", "ethereum-types", @@ -5044,7 +5045,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "evm", "evm-gasometer", @@ -5068,7 +5069,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "evm", "fp-evm", @@ -5080,7 +5081,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "evm", "fp-evm", @@ -5094,7 +5095,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "evm", "fp-evm", @@ -5106,7 +5107,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "evm", "fp-evm", @@ -5118,7 +5119,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "3.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-substrate-401c24e#06a47050af470b7b080dcd61f3c8500df0dda0e4" +source = "git+https://github.com/purestake/frontier?branch=notlesh-moonbeam-v0.7#453c0c25ba16b667fd173f04151a167b493ec11d" dependencies = [ "evm", "fp-evm", diff --git a/client/rpc-core/txpool/Cargo.toml b/client/rpc-core/txpool/Cargo.toml index b076efe0c8..1738c1bef7 100644 --- a/client/rpc-core/txpool/Cargo.toml +++ b/client/rpc-core/txpool/Cargo.toml @@ -16,4 +16,4 @@ jsonrpc-derive = "14.0.3" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } diff --git a/node/Cargo.toml b/node/Cargo.toml index f5c2672bc4..0ea8e4b19c 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -70,16 +70,16 @@ pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrat sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1" } sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1" } -evm = { package = "pallet-evm", git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -ethereum = { package = "pallet-ethereum", git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +evm = { package = "pallet-evm", git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +ethereum = { package = "pallet-ethereum", git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } -fc-consensus = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -fp-consensus = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -fc-rpc = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -fp-rpc = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -fc-db = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -fc-mapping-sync = { git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +fc-consensus = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fp-consensus = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fc-rpc = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fp-rpc = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fc-db = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fc-mapping-sync = { git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } # Cumulus dependencies cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "rococo-v1" } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index f4eaea98ba..e209351ba7 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -44,11 +44,11 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } -fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "notlesh-substrate-401c24e" } +pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } +fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "notlesh-moonbeam-v0.7" } pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } diff --git a/runtime/account/Cargo.toml b/runtime/account/Cargo.toml index a7da632c85..185618c4f5 100644 --- a/runtime/account/Cargo.toml +++ b/runtime/account/Cargo.toml @@ -24,7 +24,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", default-features = sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } [features] diff --git a/runtime/precompiles/Cargo.toml b/runtime/precompiles/Cargo.toml index baf1fa668a..f50a2f849a 100644 --- a/runtime/precompiles/Cargo.toml +++ b/runtime/precompiles/Cargo.toml @@ -13,12 +13,12 @@ rustc-hex = { version = "2.0.1", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } -pallet-evm-precompile-bn128 = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } -pallet-evm-precompile-dispatch = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } -pallet-evm-precompile-modexp = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } -pallet-evm-precompile-simple = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } -pallet-evm-precompile-sha3fips = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-substrate-401c24e" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-evm-precompile-bn128 = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-evm-precompile-dispatch = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-evm-precompile-modexp = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-evm-precompile-simple = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-evm-precompile-sha3fips = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } [features] default = [ "std" ] From 941a7aacdb72d8f4015d48de24580a254fd7fb58 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 29 Mar 2021 12:24:00 -0600 Subject: [PATCH 04/11] Pass keypair, not just pubkey to build_polkadot_full_node() --- node/src/service.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/src/service.rs b/node/src/service.rs index e7a9913c0f..69e9be97e8 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -47,7 +47,7 @@ use sc_service::{ error::Error as ServiceError, BasePath, Configuration, PartialComponents, Role, TFullBackend, TFullClient, TaskManager, }; -use sp_core::{Pair, H160, H256}; +use sp_core::{H160, H256}; use sp_runtime::traits::BlakeTwo256; use sp_trie::PrefixedMemoryDB; use std::{ @@ -225,7 +225,7 @@ where let polkadot_full_node = cumulus_client_service::build_polkadot_full_node( polkadot_config, - collator_key.public(), + collator_key.clone(), telemetry_worker_handle, ) .map_err(|e| match e { From a0cfbcaee1cfc224f065096a905d6bd27ff4613f Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Mon, 29 Mar 2021 20:25:41 -0700 Subject: [PATCH 05/11] rm token dealer --- pallets/token-dealer/Cargo.toml | 31 ------ pallets/token-dealer/src/lib.rs | 171 -------------------------------- 2 files changed, 202 deletions(-) delete mode 100644 pallets/token-dealer/Cargo.toml delete mode 100644 pallets/token-dealer/src/lib.rs diff --git a/pallets/token-dealer/Cargo.toml b/pallets/token-dealer/Cargo.toml deleted file mode 100644 index 1bbc4e6942..0000000000 --- a/pallets/token-dealer/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -authors = ["Parity Technologies "] -edition = "2018" -name = "cumulus-token-dealer" -version = "0.6.0" - -[dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } - -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } - -# Cumulus dependencies -cumulus-upward-message = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "rococo-v1" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "rococo-v1" } - -# Polkadot dependencies -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "rococo-v1", default-features = false } - -[features] -default = ["std"] -std = [ - "codec/std", - "cumulus-upward-message/std", - "cumulus-primitives-core/std", - "sp-runtime/std", - "frame-support/std", - "frame-system/std", - "polkadot-parachain/std", -] diff --git a/pallets/token-dealer/src/lib.rs b/pallets/token-dealer/src/lib.rs deleted file mode 100644 index 0ec620c092..0000000000 --- a/pallets/token-dealer/src/lib.rs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2019-2021 PureStake Inc. -// This file is part of Moonbeam. - -// Moonbeam is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Moonbeam is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . - -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::{ - decl_event, decl_module, dispatch::DispatchResult, - traits::{Currency, ExistenceRequirement, WithdrawReason}, -}; -use frame_system::ensure_signed; - -use codec::{Decode, Encode}; -use cumulus_primitives::{ - relay_chain::DownwardMessage, - xcmp::{XCMPMessageHandler, XCMPMessageSender}, - DownwardMessageHandler, ParaId, UpwardMessageOrigin, UpwardMessageSender, -}; -use cumulus_upward_message::BalancesMessage; -use polkadot_parachain::primitives::AccountIdConversion; - -#[derive(Encode, Decode)] -pub enum XCMPMessage { - /// Transfer tokens to the given account from the Parachain account. - TransferToken(XAccountId, XBalance), -} - -type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; - -type RelayAccountId = sp_runtime::AccountId32; - -/// Configuration trait of this pallet. -pub trait Trait: frame_system::Trait { - /// Event type used by the runtime. - type Event: From> + Into<::Event>; - - /// The sender of upward messages. - type UpwardMessageSender: UpwardMessageSender; - - /// The upward message type used by the Parachain runtime. - type UpwardMessage: codec::Codec + BalancesMessage>; - - /// Currency of the runtime. - type Currency: Currency; - - /// The sender of XCMP messages. - type XCMPMessageSender: XCMPMessageSender>>; -} - -decl_event! { - pub enum Event where - AccountId = ::AccountId, - Balance = BalanceOf - { - /// Transferred tokens to the account on the relay chain. - TransferredTokensToRelayChain(RelayAccountId, Balance), - /// Transferred tokens to the account on request from the relay chain. - TransferredTokensFromRelayChain(AccountId, Balance), - /// Transferred tokens to the account from the given parachain account. - TransferredTokensViaXCMP(ParaId, AccountId, Balance, DispatchResult), - } -} - -decl_module! { - pub struct Module for enum Call where origin: T::Origin, system = frame_system { - /// Transfer `amount` of tokens on the relay chain from the Parachain account to - /// the given `dest` account. - #[weight = 10] - fn transfer_tokens_to_relay_chain(origin, dest: RelayAccountId, amount: BalanceOf) { - let who = ensure_signed(origin)?; - - let _ = T::Currency::withdraw( - &who, - amount, - WithdrawReason::Transfer.into(), - ExistenceRequirement::AllowDeath, - )?; - - let msg = ::UpwardMessage::transfer(dest.clone(), amount.clone()); - ::UpwardMessageSender::send_upward_message(&msg, UpwardMessageOrigin::Signed) - .expect("Should not fail; qed"); - - Self::deposit_event(Event::::TransferredTokensToRelayChain(dest, amount)); - } - - /// Transfer `amount` of tokens to another parachain. - #[weight = 10] - fn transfer_tokens_to_parachain_chain( - origin, - para_id: u32, - dest: T::AccountId, - amount: BalanceOf, - ) { - //TODO we don't make sure that the parachain has some tokens on the other parachain. - let who = ensure_signed(origin)?; - - let _ = T::Currency::withdraw( - &who, - amount, - WithdrawReason::Transfer.into(), - ExistenceRequirement::AllowDeath, - )?; - - T::XCMPMessageSender::send_xcmp_message( - para_id.into(), - &XCMPMessage::TransferToken(dest, amount), - ).expect("Should not fail; qed"); - } - - fn deposit_event() = default; - } -} - -/// This is a hack to convert from one generic type to another where we are sure that both are the -/// same type/use the same encoding. -fn convert_hack(input: &impl Encode) -> O { - input.using_encoded(|e| Decode::decode(&mut &e[..]).expect("Must be compatible; qed")) -} - -impl DownwardMessageHandler for Module { - fn handle_downward_message(msg: &DownwardMessage) { - match msg { - DownwardMessage::TransferInto(dest, amount, _) => { - let dest = convert_hack(&dest); - let amount: BalanceOf = convert_hack(amount); - - let _ = T::Currency::deposit_creating(&dest, amount.clone()); - - Self::deposit_event(Event::::TransferredTokensFromRelayChain(dest, amount)); - } - _ => {} - } - } -} - -impl XCMPMessageHandler>> for Module { - fn handle_xcmp_message(src: ParaId, msg: &XCMPMessage>) { - match msg { - XCMPMessage::TransferToken(dest, amount) => { - let para_account = src.clone().into_account(); - - let res = T::Currency::transfer( - ¶_account, - dest, - amount.clone(), - ExistenceRequirement::AllowDeath, - ); - - Self::deposit_event(Event::::TransferredTokensViaXCMP( - src, - dest.clone(), - amount.clone(), - res, - )); - } - } - } -} From 0c0224326949cfb7274fde1ee938019c8926bd2e Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Tue, 30 Mar 2021 10:11:38 -0700 Subject: [PATCH 06/11] pulse --- Cargo.lock | 60 +++ moonbeam-types-bundle/index.ts | 14 + pallets/token-factory/Cargo.toml | 43 ++ pallets/token-factory/contract/bytecode.txt | 1 + pallets/token-factory/contract/contract.sol | 44 ++ pallets/token-factory/src/lib.rs | 518 ++++++++++++++++++++ pallets/token-factory/src/mock.rs | 203 ++++++++ pallets/token-factory/src/tests.rs | 172 +++++++ pallets/xtransfer/Cargo.toml | 35 ++ pallets/xtransfer/src/adapter.rs | 136 +++++ pallets/xtransfer/src/lib.rs | 513 +++++++++++++++++++ pallets/xtransfer/src/support.rs | 90 ++++ runtime/Cargo.toml | 14 + runtime/src/lib.rs | 121 ++++- 14 files changed, 1953 insertions(+), 11 deletions(-) create mode 100644 pallets/token-factory/Cargo.toml create mode 100644 pallets/token-factory/contract/bytecode.txt create mode 100644 pallets/token-factory/contract/contract.sol create mode 100644 pallets/token-factory/src/lib.rs create mode 100644 pallets/token-factory/src/mock.rs create mode 100644 pallets/token-factory/src/tests.rs create mode 100644 pallets/xtransfer/Cargo.toml create mode 100644 pallets/xtransfer/src/adapter.rs create mode 100644 pallets/xtransfer/src/lib.rs create mode 100644 pallets/xtransfer/src/support.rs diff --git a/Cargo.lock b/Cargo.lock index c91b2d2fd9..63a09e0976 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1328,6 +1328,21 @@ dependencies = [ "trie-db", ] +[[package]] +name = "cumulus-pallet-xcm-handler" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=rococo-v1#9d89ed653217203810822483ae86fd8867f59620" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "sp-std", + "xcm", + "xcm-executor", +] + [[package]] name = "cumulus-primitives-core" version = "0.1.0" @@ -4447,6 +4462,7 @@ dependencies = [ "account", "author-inherent", "cumulus-pallet-parachain-system", + "cumulus-pallet-xcm-handler", "cumulus-primitives-core", "fp-rpc", "frame-executive", @@ -4472,6 +4488,7 @@ dependencies = [ "parachain-info", "parachain-staking", "parity-scale-codec", + "polkadot-parachain", "precompiles", "serde", "sp-api", @@ -4486,6 +4503,11 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder 4.0.0", + "token-factory", + "xcm", + "xcm-builder", + "xcm-executor", + "xtransfer", ] [[package]] @@ -10492,6 +10514,28 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "token-factory" +version = "0.1.0" +dependencies = [ + "ethereum-types", + "fp-evm", + "frame-support", + "frame-system", + "hex-literal", + "pallet-balances", + "pallet-evm", + "pallet-sudo", + "pallet-timestamp", + "parity-scale-codec", + "rustc-hex", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "tokio" version = "0.1.22" @@ -11754,6 +11798,22 @@ dependencies = [ "xcm", ] +[[package]] +name = "xtransfer" +version = "0.1.0" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-core", + "sp-runtime", + "sp-std", + "token-factory", + "xcm", + "xcm-executor", +] + [[package]] name = "yamux" version = "0.8.1" diff --git a/moonbeam-types-bundle/index.ts b/moonbeam-types-bundle/index.ts index 0bba0eeaee..9672b472a2 100644 --- a/moonbeam-types-bundle/index.ts +++ b/moonbeam-types-bundle/index.ts @@ -210,6 +210,20 @@ export const moonbeamDefinitions = { nominators: "Vec", total: "Balance", }, + TokenId: { + _enum: ["DOT", "KSM", "ACA", "AUSD"], + }, + EvmCall: { + _enum: ["Register", "Mint", "Burn", "TotalIssuance", "BalanceOf"], + }, + AccountId32: "[u8; 32]", + ChainId: { + _enum: ["RelayChain", { Para: "u32" }], + }, + XCurrencyId: { + chain_id: "ChainId", + currency_id: "Vec", + }, SystemInherentData: { validation_data: "PersistedValidationData", relay_chain_state: "StorageProof", diff --git a/pallets/token-factory/Cargo.toml b/pallets/token-factory/Cargo.toml new file mode 100644 index 0000000000..366729cda5 --- /dev/null +++ b/pallets/token-factory/Cargo.toml @@ -0,0 +1,43 @@ +[package] +authors = ["PureStake"] +edition = "2018" +name = "token-factory" +version = "0.1.0" +description = "sudo control ERC20 issuance in the EVM" + +[dependencies] +ethereum-types = { version = "0.11.0", default-features = false } +fp-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } +hex-literal = { version = "0.3.1" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "notlesh-moonbeam-v0.7" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } +parity-scale-codec = { version = "2.0.0", default-features = false, features = ["derive"] } +rustc-hex = { version = "2.1.0", default-features = false } +serde = { version = "1.0.101", optional = true } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } + +[features] +default = ["std"] +std = [ + "ethereum-types/std", + "parity-scale-codec/std", + "frame-support/std", + "frame-system/std", + "pallet-balances/std", + "pallet-evm/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "rustc-hex/std", + "serde", + "sp-runtime/std", + "sp-std/std", + "sp-core/std", + "sp-io/std", +] \ No newline at end of file diff --git a/pallets/token-factory/contract/bytecode.txt b/pallets/token-factory/contract/bytecode.txt new file mode 100644 index 0000000000..3bec98fd54 --- /dev/null +++ b/pallets/token-factory/contract/bytecode.txt @@ -0,0 +1 @@ +60806040523480156200001157600080fd5b50604051620024913803806200249183398181016040528101906200003791906200024f565b818160006200004b6200012560201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3508160049080519060200190620001019291906200012d565b5080600590805190602001906200011a9291906200012d565b505050505062000432565b600033905090565b8280546200013b9062000357565b90600052602060002090601f0160209004810192826200015f5760008555620001ab565b82601f106200017a57805160ff1916838001178555620001ab565b82800160010185558215620001ab579182015b82811115620001aa5782518255916020019190600101906200018d565b5b509050620001ba9190620001be565b5090565b5b80821115620001d9576000816000905550600101620001bf565b5090565b6000620001f4620001ee84620002eb565b620002c2565b9050828152602081018484840111156200020d57600080fd5b6200021a84828562000321565b509392505050565b600082601f8301126200023457600080fd5b815162000246848260208601620001dd565b91505092915050565b600080604083850312156200026357600080fd5b600083015167ffffffffffffffff8111156200027e57600080fd5b6200028c8582860162000222565b925050602083015167ffffffffffffffff811115620002aa57600080fd5b620002b88582860162000222565b9150509250929050565b6000620002ce620002e1565b9050620002dc82826200038d565b919050565b6000604051905090565b600067ffffffffffffffff821115620003095762000308620003f2565b5b620003148262000421565b9050602081019050919050565b60005b838110156200034157808201518184015260208101905062000324565b8381111562000351576000848401525b50505050565b600060028204905060018216806200037057607f821691505b60208210811415620003875762000386620003c3565b5b50919050565b620003988262000421565b810181811067ffffffffffffffff82111715620003ba57620003b9620003f2565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b61204f80620004426000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063715018a6116100a25780639dc29fac116100715780639dc29fac146102cf578063a457c2d7146102eb578063a9059cbb1461031b578063dd62ed3e1461034b578063f2fde38b1461037b57610116565b8063715018a61461026d57806379cc6790146102775780638da5cb5b1461029357806395d89b41146102b157610116565b8063313ce567116100e9578063313ce567146101b757806339509351146101d557806340c10f191461020557806342966c681461022157806370a082311461023d57610116565b806306fdde031461011b578063095ea7b31461013957806318160ddd1461016957806323b872dd14610187575b600080fd5b610123610397565b604051610130919061186d565b60405180910390f35b610153600480360381019061014e9190611596565b610429565b6040516101609190611852565b60405180910390f35b610171610447565b60405161017e9190611a2f565b60405180910390f35b6101a1600480360381019061019c9190611547565b610451565b6040516101ae9190611852565b60405180910390f35b6101bf610552565b6040516101cc9190611a4a565b60405180910390f35b6101ef60048036038101906101ea9190611596565b61055b565b6040516101fc9190611852565b60405180910390f35b61021f600480360381019061021a9190611596565b610607565b005b61023b600480360381019061023691906115d2565b610691565b005b610257600480360381019061025291906114e2565b6106a5565b6040516102649190611a2f565b60405180910390f35b6102756106ee565b005b610291600480360381019061028c9190611596565b610828565b005b61029b6108ac565b6040516102a89190611837565b60405180910390f35b6102b96108d5565b6040516102c6919061186d565b60405180910390f35b6102e960048036038101906102e49190611596565b610967565b005b61030560048036038101906103009190611596565b6109f1565b6040516103129190611852565b60405180910390f35b61033560048036038101906103309190611596565b610ae5565b6040516103429190611852565b60405180910390f35b6103656004803603810190610360919061150b565b610b03565b6040516103729190611a2f565b60405180910390f35b610395600480360381019061039091906114e2565b610b8a565b005b6060600480546103a690611b93565b80601f01602080910402602001604051908101604052809291908181526020018280546103d290611b93565b801561041f5780601f106103f45761010080835404028352916020019161041f565b820191906000526020600020905b81548152906001019060200180831161040257829003601f168201915b5050505050905090565b600061043d610436610d33565b8484610d3b565b6001905092915050565b6000600354905090565b600061045e848484610f06565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a9610d33565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610529576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105209061192f565b60405180910390fd5b61054685610535610d33565b85846105419190611ad7565b610d3b565b60019150509392505050565b60006012905090565b60006105fd610568610d33565b848460026000610576610d33565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105f89190611a81565b610d3b565b6001905092915050565b61060f610d33565b73ffffffffffffffffffffffffffffffffffffffff1661062d6108ac565b73ffffffffffffffffffffffffffffffffffffffff1614610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a9061194f565b60405180910390fd5b61068d8282611188565b5050565b6106a261069c610d33565b826112dd565b50565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106f6610d33565b73ffffffffffffffffffffffffffffffffffffffff166107146108ac565b73ffffffffffffffffffffffffffffffffffffffff161461076a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107619061194f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600061083b83610836610d33565b610b03565b905081811015610880576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108779061196f565b60405180910390fd5b61089d8361088c610d33565b84846108989190611ad7565b610d3b565b6108a783836112dd565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600580546108e490611b93565b80601f016020809104026020016040519081016040528092919081815260200182805461091090611b93565b801561095d5780601f106109325761010080835404028352916020019161095d565b820191906000526020600020905b81548152906001019060200180831161094057829003601f168201915b5050505050905090565b61096f610d33565b73ffffffffffffffffffffffffffffffffffffffff1661098d6108ac565b73ffffffffffffffffffffffffffffffffffffffff16146109e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109da9061194f565b60405180910390fd5b6109ed82826112dd565b5050565b60008060026000610a00610d33565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610abd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab4906119ef565b60405180910390fd5b610ada610ac8610d33565b858584610ad59190611ad7565b610d3b565b600191505092915050565b6000610af9610af2610d33565b8484610f06565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92610d33565b73ffffffffffffffffffffffffffffffffffffffff16610bb06108ac565b73ffffffffffffffffffffffffffffffffffffffff1614610c06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfd9061194f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6d906118cf565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da2906119cf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e12906118ef565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610ef99190611a2f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6d906119af565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fe6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fdd9061188f565b60405180910390fd5b610ff18383836114b3565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106f9061190f565b60405180910390fd5b81816110849190611ad7565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111169190611a81565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161117a9190611a2f565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ef90611a0f565b60405180910390fd5b611204600083836114b3565b80600360008282546112169190611a81565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461126c9190611a81565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516112d19190611a2f565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113449061198f565b60405180910390fd5b611359826000836114b3565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d7906118af565b60405180910390fd5b81816113ec9190611ad7565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600360008282546114419190611ad7565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516114a69190611a2f565b60405180910390a3505050565b505050565b6000813590506114c781611feb565b92915050565b6000813590506114dc81612002565b92915050565b6000602082840312156114f457600080fd5b6000611502848285016114b8565b91505092915050565b6000806040838503121561151e57600080fd5b600061152c858286016114b8565b925050602061153d858286016114b8565b9150509250929050565b60008060006060848603121561155c57600080fd5b600061156a868287016114b8565b935050602061157b868287016114b8565b925050604061158c868287016114cd565b9150509250925092565b600080604083850312156115a957600080fd5b60006115b7858286016114b8565b92505060206115c8858286016114cd565b9150509250929050565b6000602082840312156115e457600080fd5b60006115f2848285016114cd565b91505092915050565b61160481611b0b565b82525050565b61161381611b1d565b82525050565b600061162482611a65565b61162e8185611a70565b935061163e818560208601611b60565b61164781611c23565b840191505092915050565b600061165f602383611a70565b915061166a82611c34565b604082019050919050565b6000611682602283611a70565b915061168d82611c83565b604082019050919050565b60006116a5602683611a70565b91506116b082611cd2565b604082019050919050565b60006116c8602283611a70565b91506116d382611d21565b604082019050919050565b60006116eb602683611a70565b91506116f682611d70565b604082019050919050565b600061170e602883611a70565b915061171982611dbf565b604082019050919050565b6000611731602083611a70565b915061173c82611e0e565b602082019050919050565b6000611754602483611a70565b915061175f82611e37565b604082019050919050565b6000611777602183611a70565b915061178282611e86565b604082019050919050565b600061179a602583611a70565b91506117a582611ed5565b604082019050919050565b60006117bd602483611a70565b91506117c882611f24565b604082019050919050565b60006117e0602583611a70565b91506117eb82611f73565b604082019050919050565b6000611803601f83611a70565b915061180e82611fc2565b602082019050919050565b61182281611b49565b82525050565b61183181611b53565b82525050565b600060208201905061184c60008301846115fb565b92915050565b6000602082019050611867600083018461160a565b92915050565b600060208201905081810360008301526118878184611619565b905092915050565b600060208201905081810360008301526118a881611652565b9050919050565b600060208201905081810360008301526118c881611675565b9050919050565b600060208201905081810360008301526118e881611698565b9050919050565b60006020820190508181036000830152611908816116bb565b9050919050565b60006020820190508181036000830152611928816116de565b9050919050565b6000602082019050818103600083015261194881611701565b9050919050565b6000602082019050818103600083015261196881611724565b9050919050565b6000602082019050818103600083015261198881611747565b9050919050565b600060208201905081810360008301526119a88161176a565b9050919050565b600060208201905081810360008301526119c88161178d565b9050919050565b600060208201905081810360008301526119e8816117b0565b9050919050565b60006020820190508181036000830152611a08816117d3565b9050919050565b60006020820190508181036000830152611a28816117f6565b9050919050565b6000602082019050611a446000830184611819565b92915050565b6000602082019050611a5f6000830184611828565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611a8c82611b49565b9150611a9783611b49565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611acc57611acb611bc5565b5b828201905092915050565b6000611ae282611b49565b9150611aed83611b49565b925082821015611b0057611aff611bc5565b5b828203905092915050565b6000611b1682611b29565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611b7e578082015181840152602081019050611b63565b83811115611b8d576000848401525b50505050565b60006002820490506001821680611bab57607f821691505b60208210811415611bbf57611bbe611bf4565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611ff481611b0b565b8114611fff57600080fd5b50565b61200b81611b49565b811461201657600080fd5b5056fea2646970667358221220ebdfee37207c65b6959cdf9a6ebf426763546f84e56c8cb909bf2b3b640eaea464736f6c634300080200330000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \ No newline at end of file diff --git a/pallets/token-factory/contract/contract.sol b/pallets/token-factory/contract/contract.sol new file mode 100644 index 0000000000..d963d5fc76 --- /dev/null +++ b/pallets/token-factory/contract/contract.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/access/Ownable.sol"; +import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/token/ERC20/extensions/ERC20Burnable.sol"; + +/** + * @dev {ERC20} token, including: + * + * The account that deploys the contract can mint and burn. + */ +contract ERC20MinterBurner is Ownable, ERC20Burnable { + /** + * @dev + * + * See {ERC20-constructor}. + */ + constructor(string memory name, string memory symbol) ERC20(name, symbol) {} + + /** + * @dev Creates `amount` new tokens for `to`. + * + * See {ERC20-_mint}. + * + * Requirements: + * + * - the caller must be the account that deployed the contract + */ + function mint(address to, uint256 amount) public virtual onlyOwner { + _mint(to, amount); + } + + /** + * @dev Burns `amount` tokens from `from` + * + * See {ERC20Burnable-_burn}. + * + * Requirements: + * + * - the caller must be the account that deployed the contract + */ + function burn(address from, uint256 amount) public virtual onlyOwner { + _burn(from, amount); + } +} diff --git a/pallets/token-factory/src/lib.rs b/pallets/token-factory/src/lib.rs new file mode 100644 index 0000000000..9c2407c512 --- /dev/null +++ b/pallets/token-factory/src/lib.rs @@ -0,0 +1,518 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Pallet for registering, minting, and burning ERC20 tokens (in EVM from runtime) + +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::pallet; + +pub use pallet::*; + +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; + +#[pallet] +pub mod pallet { + use ethereum_types::BigEndianHash; + use fp_evm::ExecutionInfo; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use pallet_evm::{AddressMapping, ExitReason, Runner}; + use parity_scale_codec::{Decode, Encode, FullCodec}; + use rustc_hex::FromHex; + #[cfg(feature = "std")] + use serde::{Deserialize, Serialize}; + use sp_core::{H160, H256, U256}; + use sp_runtime::{ + traits::{AtLeast32BitUnsigned, Convert, MaybeSerializeDeserialize, Zero}, + DispatchError, RuntimeDebug, SaturatedConversion, + }; + use sp_std::{convert::TryFrom, fmt::Debug, vec::Vec}; + + /// ERC20PresetMinterBurner contract bytecode + const CONTRACT_BYTECODE: &str = include_str!("../contract/bytecode.txt"); + + #[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord)] + #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] + #[non_exhaustive] + /// The name and unique ID for each token registered in `token-factory` + pub enum Ticker { + DOT = 0, + KSM = 1, + ACA = 2, + AUSD = 3, + } + + impl TryFrom for Ticker { + type Error = (); + + fn try_from(v: u8) -> Result { + match v { + 0 => Ok(Ticker::DOT), + 1 => Ok(Ticker::KSM), + 2 => Ok(Ticker::ACA), + 3 => Ok(Ticker::AUSD), + _ => Err(()), + } + } + } + + #[derive(sp_runtime::RuntimeDebug, PartialEq, Eq)] + /// The supported currency types + pub enum CurrencyId { + /// The local instance of `balances` pallet, default GLMR + Native, + /// Token registered in `token-factory` pallet + Token(Ticker), + } + + impl TryFrom> for CurrencyId { + type Error = (); + fn try_from(v: Vec) -> Result { + match v.as_slice() { + b"GLMR" => Ok(CurrencyId::Native), + b"DOT" => Ok(CurrencyId::Token(Ticker::DOT)), + b"KSM" => Ok(CurrencyId::Token(Ticker::KSM)), + b"ACA" => Ok(CurrencyId::Token(Ticker::ACA)), + b"AUSD" => Ok(CurrencyId::Token(Ticker::AUSD)), + _ => Err(()), + } + } + } + + impl From for Vec { + fn from(c: CurrencyId) -> Vec { + match c { + CurrencyId::Native => b"GLMR".to_vec(), + CurrencyId::Token(Ticker::DOT) => b"DOT".to_vec(), + CurrencyId::Token(Ticker::KSM) => b"KSM".to_vec(), + CurrencyId::Token(Ticker::ACA) => b"ACA".to_vec(), + CurrencyId::Token(Ticker::AUSD) => b"AUSD".to_vec(), + } + } + } + + #[test] + fn currency_as_vec() { + let expect: CurrencyId = CurrencyId::try_from([71, 76, 77, 82].to_vec()).unwrap(); + assert_eq!(expect, CurrencyId::Native); + let expect: CurrencyId = CurrencyId::try_from([68, 79, 84].to_vec()).unwrap(); + assert_eq!(expect, CurrencyId::Token(Ticker::DOT)); + let expect: CurrencyId = CurrencyId::try_from([75, 83, 77].to_vec()).unwrap(); + assert_eq!(expect, CurrencyId::Token(Ticker::KSM)); + let expect: CurrencyId = CurrencyId::try_from([65, 67, 65].to_vec()).unwrap(); + assert_eq!(expect, CurrencyId::Token(Ticker::ACA)); + let expect: CurrencyId = CurrencyId::try_from([65, 85, 83, 68].to_vec()).unwrap(); + assert_eq!(expect, CurrencyId::Token(Ticker::AUSD)); + } + + /// The ERC token factory pallet + #[pallet::pallet] + pub struct Pallet(PhantomData); + + /// Configuration trait of this pallet. + #[pallet::config] + pub trait Config: frame_system::Config + pallet_evm::Config + pallet_sudo::Config { + /// Overarching event type + type Event: From> + IsType<::Event>; + /// Balances type + type Balance: Parameter + + Member + + AtLeast32BitUnsigned + + Default + + Copy + + MaybeSerializeDeserialize + + Into; + /// Token identifier + type TokenId: Clone + Copy + FullCodec + Debug + PartialEq + Ord + MaybeSerializeDeserialize; + /// Convert from AccountId to H160, is identity map for Moonbeam + type AccountToH160: Convert; + } + + #[pallet::error] + pub enum Error { + /// TokenID is already claimed + IdClaimed, + /// TokenID does not exist so cannot interact with it + IdNotClaimed, + /// Not enough balance to burn + NotEnoughBalanceToBurn, + } + + #[derive(PartialEq, Clone, Copy, Encode, Decode, sp_runtime::RuntimeDebug)] + pub enum EvmCall { + Register, + Mint, + Burn, + TotalIssuance, + BalanceOf, + } + + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { + /// Token register success [token_id, contract_address] + Registered(T::TokenId, H160), + /// Mint token success. [token_id, who, amount] + Minted(T::TokenId, T::AccountId, T::Balance), + /// Burn token success. [token_id, who, amount] + Burned(T::TokenId, T::AccountId, T::Balance), + /// Destroy all tokens success. [token_id, amount] + DestroyedAll(T::TokenId, T::Balance), + /// Call failed with exit reason [call, reason] + EvmCallFailed(EvmCall, ExitReason), + } + + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::storage] + #[pallet::getter(fn nonce)] + pub type Nonce = StorageValue<_, U256, ValueQuery>; + + #[pallet::storage] + #[pallet::getter(fn tokens)] + pub type Tokens = StorageValue<_, Vec, ValueQuery>; + + #[pallet::storage] + #[pallet::getter(fn contract_address)] + pub type ContractAddress = + StorageMap<_, Twox64Concat, T::TokenId, H160, OptionQuery>; + + #[pallet::genesis_config] + pub struct GenesisConfig { + pub nonce: U256, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self { + nonce: U256::zero(), + } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + >::put(self.nonce); + } + } + + #[pallet::call] + impl Pallet { + #[pallet::weight(0)] + pub fn register_token(origin: OriginFor, id: T::TokenId) -> DispatchResultWithPostInfo { + frame_system::ensure_root(origin)?; + ensure!(!Self::exists(&id), Error::::IdClaimed); + let contract = FromHex::from_hex(CONTRACT_BYTECODE) + .expect("Static smart contract is formatted incorrectly (should be hex)"); + let mut nonce = >::get(); + // deploy contract with sudo as MINTER_ROLE and BURNER_ROLE (without minting) + match T::Runner::create( + // from: H160 + Self::sudo_caller(), + // input: Vec + contract, + // value: U256 + U256::zero(), + // gas limit: U256 + U256::from(0x10000000).low_u64(), + // gas price: U256 + Some(U256::from(1)), + // nonce: Option + Some(nonce), + // config: EvmConfig + T::config(), + )? { + ExecutionInfo { + exit_reason: ExitReason::Succeed(_), + value: address, + .. + } => { + // insert contract + >::insert(&id, address.clone()); + // add to tokens + >::mutate(|list| { + if let Err(loc) = list.binary_search(&id) { + list.insert(loc, id.clone()); + } + }); + Self::deposit_event(Event::Registered(id, address)); + } + ExecutionInfo { + exit_reason: reason, + .. + } => { + Self::deposit_event(Event::EvmCallFailed(EvmCall::Register, reason)); + } + } + // increment nonce + nonce += U256::from(1); + >::put(nonce); + Ok(().into()) + } + + #[pallet::weight(0)] + pub fn destroy_all(origin: OriginFor, id: T::TokenId) -> DispatchResultWithPostInfo { + frame_system::ensure_root(origin)?; + let amount_destroyed = Self::total_issuance(id)?; + // clear storage and free id, tokens associated with the contract are no longer + // recognized by the cross-chain transfer system + >::remove(&id); + >::mutate(|list| { + if let Ok(loc) = list.binary_search(&id) { + list.remove(loc); + } + }); + Self::deposit_event(Event::DestroyedAll(id, amount_destroyed)); + Ok(().into()) + } + } + + impl Pallet { + fn sudo_caller() -> H160 { + T::AccountToH160::convert(>::key()) + } + } + + /// Isolates behavior for minting/burning tokens from registration + pub trait TokenMinter { + fn exists(id: &Id) -> bool; + // setters + fn mint(id: Id, who: Account, amount: Balance) -> DispatchResultWithPostInfo; + fn burn(id: Id, who: Account, amount: Balance) -> DispatchResultWithPostInfo; + // getters + fn total_issuance(id: Id) -> Result; + fn balance_of(id: Id, who: Account) -> Result; + } + + impl TokenMinter for Pallet { + fn exists(id: &T::TokenId) -> bool { + >::get(id).is_some() + } + fn mint(id: T::TokenId, who: H160, amount: T::Balance) -> DispatchResultWithPostInfo { + let address = >::get(&id).ok_or(Error::::IdNotClaimed)?; + let mut nonce = >::get(); + let mut input = hex_literal::hex!("40c10f19").to_vec(); + // append address + input.extend_from_slice(H256::from(who.clone()).as_bytes()); + // append amount + input.extend_from_slice( + H256::from_uint(&U256::from(amount.saturated_into::())).as_bytes(), + ); + // call evm + match T::Runner::call( + // source: H160 + Self::sudo_caller(), + // target + address, + // input: Vec + input, + // value: U256 + U256::zero(), + // gas limit: U256 + U256::from(0x10000000).low_u64(), + // gas price: U256 + Some(U256::from(1)), + // nonce: Option + Some(nonce), + // config: EvmConfig + T::config(), + )? { + ExecutionInfo { + exit_reason: ExitReason::Succeed(_), + .. + } => { + Self::deposit_event(Event::Minted( + id, + T::AddressMapping::into_account_id(who), + amount, + )); + } + ExecutionInfo { + exit_reason: reason, + .. + } => { + Self::deposit_event(Event::EvmCallFailed(EvmCall::Mint, reason)); + } + } + // increment nonce + nonce += U256::from(1); + >::put(nonce); + Ok(().into()) + } + fn burn(id: T::TokenId, who: H160, amount: T::Balance) -> DispatchResultWithPostInfo { + let address = >::get(&id).ok_or(Error::::IdNotClaimed)?; + // check that `who` has at least `amount` of `id` token + let balance = Self::balance_of(id, who)?; + let amount_to_burn = if amount > balance { balance } else { amount }; + ensure!( + amount_to_burn > T::Balance::zero(), + Error::::NotEnoughBalanceToBurn + ); + let mut nonce = >::get(); + let mut input = hex_literal::hex!("9dc29fac").to_vec(); + // append address + input.extend_from_slice(H256::from(who.clone()).as_bytes()); + // append amount + input.extend_from_slice( + H256::from_uint(&U256::from(amount_to_burn.saturated_into::())).as_bytes(), + ); + match T::Runner::call( + // source: H160 + Self::sudo_caller(), + // target + address, + // input: Vec + input, + // value: U256 + U256::zero(), + // gas limit: U256 + U256::from(0x10000000).low_u64(), + // gas price: U256 + Some(U256::from(1)), + // nonce: Option + Some(nonce), + // config: EvmConfig + T::config(), + )? { + ExecutionInfo { + exit_reason: ExitReason::Succeed(_), + .. + } => { + Self::deposit_event(Event::Burned( + id, + T::AddressMapping::into_account_id(who), + amount_to_burn, + )); + } + ExecutionInfo { + exit_reason: reason, + .. + } => { + Self::deposit_event(Event::EvmCallFailed(EvmCall::Burn, reason)); + } + } + // increment nonce + nonce += U256::from(1); + >::put(nonce); + Ok(().into()) + } + /// Gets total issuance for the given token if it exists in local evm instance + fn total_issuance(id: T::TokenId) -> Result { + let address = >::get(id).ok_or(Error::::IdNotClaimed)?; + let mut nonce = >::get(); + // first 4 bytes of hex output of Sha3("totalSupply()") + let input = hex_literal::hex!("18160ddd").to_vec(); + match T::Runner::call( + // source: H160 + Self::sudo_caller(), + // target + address, + // input: Vec + input, + // value: U256 + U256::zero(), + // gas limit: U256 + U256::from(0x10000000).low_u64(), + // gas price: U256 + Some(U256::from(1)), + // nonce: Option + Some(nonce), + // config: EvmConfig + T::config(), + ) { + Ok(ExecutionInfo { + exit_reason: ExitReason::Succeed(_), + value: result, + .. + }) => { + // increment nonce + nonce += U256::from(1); + >::put(nonce); + let value = U256::from(result.as_slice()).saturated_into::(); + Ok(value.saturated_into::()) + } + Ok(ExecutionInfo { + exit_reason: reason, + .. + }) => { + // increment nonce + nonce += U256::from(1); + >::put(nonce); + Self::deposit_event(Event::EvmCallFailed(EvmCall::TotalIssuance, reason)); + Ok(T::Balance::zero()) + } + Err(e) => Err(e.into()), + } + } + /// Gets token balance for the account + fn balance_of(id: T::TokenId, who: H160) -> Result { + let address = >::get(id).ok_or(Error::::IdNotClaimed)?; + let mut nonce = >::get(); + // first 4 bytes of hex output of Sha3("balanceOf(address)") + let mut input = hex_literal::hex!("70a08231").to_vec(); + // append address + input.extend_from_slice(H256::from(who).as_bytes()); + match T::Runner::call( + // source: H160 + Self::sudo_caller(), + // target + address, + // input: Vec + input, + // value: U256 + U256::zero(), + // gas limit: U256 + U256::from(0x10000000).low_u64(), + // gas price: U256 + Some(U256::from(1)), + // nonce: Option + Some(nonce), + // config: EvmConfig + T::config(), + ) { + Ok(ExecutionInfo { + exit_reason: ExitReason::Succeed(_), + value: result, + .. + }) => { + // increment nonce + nonce += U256::from(1); + >::put(nonce); + let value = U256::from(result.as_slice()).saturated_into::(); + return Ok(value.saturated_into::()); + } + Ok(ExecutionInfo { + exit_reason: reason, + .. + }) => { + // increment nonce + nonce += U256::from(1); + >::put(nonce); + Self::deposit_event(Event::EvmCallFailed(EvmCall::BalanceOf, reason)); + Ok(T::Balance::zero()) + } + Err(e) => Err(e.into()), + } + } + } +} diff --git a/pallets/token-factory/src/mock.rs b/pallets/token-factory/src/mock.rs new file mode 100644 index 0000000000..b365942437 --- /dev/null +++ b/pallets/token-factory/src/mock.rs @@ -0,0 +1,203 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Token Factory Mock Runtime +use crate as token_factory; +use frame_support::parameter_types; +use sp_core::{H160, H256}; +use sp_io::TestExternalities; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + ModuleId, +}; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Config, Storage, Event}, + Evm: pallet_evm::{Pallet, Call, Storage, Event}, + TokenFactory: token_factory::{Pallet, Call, Storage, Event}, + } +); + +pub struct BlockEverything; +impl frame_support::traits::Filter for BlockEverything { + fn filter(_: &Call) -> bool { + false + } +} + +parameter_types! { + pub const MinimumPeriod: u64 = 6000 / 2; +} + +impl pallet_timestamp::Config for Test { + type Moment = u64; + type OnTimestampSet = (); + type MinimumPeriod = MinimumPeriod; + type WeightInfo = (); +} + +pub struct FixedGasPrice; +impl pallet_evm::FeeCalculator for FixedGasPrice { + fn min_gas_price() -> sp_core::U256 { + 1.into() + } +} + +impl pallet_sudo::Config for Test { + type Event = Event; + type Call = Call; +} + +parameter_types! { + pub const TransactionByteFee: u64 = 1; + pub const ChainId: u64 = 42; + pub const EVMModuleId: ModuleId = ModuleId(*b"py/evmpa"); +} + +impl pallet_evm::Config for Test { + type FeeCalculator = FixedGasPrice; + type GasWeightMapping = (); + type CallOrigin = pallet_evm::EnsureAddressSame; + type WithdrawOrigin = pallet_evm::EnsureAddressSame; + type AddressMapping = pallet_evm::IdentityAddressMapping; + type Currency = Balances; + type Event = Event; + type Precompiles = (); + type Runner = pallet_evm::runner::stack::Runner; + type ChainId = ChainId; + type OnChargeTransaction = (); +} + +parameter_types! { + pub const BlockHashCount: u64 = 250; +} +impl frame_system::Config for Test { + type BaseCallFilter = (); + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Index = u64; + type BlockNumber = u64; + type Call = Call; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Header = Header; + type Event = Event; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); +} +type Balance = u64; +type AccountId = H160; +parameter_types! { + pub const MaxLocks: u32 = 50; + pub const ExistentialDeposit: u64 = 500; +} +impl pallet_balances::Config for Test { + type MaxLocks = MaxLocks; + type Balance = Balance; + type Event = Event; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); +} +pub struct AccountToH160; +impl sp_runtime::traits::Convert for AccountToH160 { + fn convert(from: H160) -> H160 { + from + } +} +impl token_factory::Config for Test { + type Event = Event; + type Balance = Balance; + type TokenId = u8; + type AccountToH160 = AccountToH160; +} + +pub(crate) fn last_event() -> Event { + System::events().pop().expect("Event expected").event +} + +pub(crate) fn root_address() -> H160 { + use sp_std::str::FromStr; + H160::from_str("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b").unwrap() +} + +pub(crate) fn alice() -> H160 { + use sp_std::str::FromStr; + H160::from_str("1000000000000000000000000000000000000001").unwrap() +} + +pub(crate) fn bob() -> H160 { + use sp_std::str::FromStr; + H160::from_str("1000000000000000000000000000000000000002").unwrap() +} + +pub(crate) fn charlie() -> H160 { + use sp_std::str::FromStr; + H160::from_str("1000000000000000000000000000000000000003").unwrap() +} + +pub(crate) fn deploy_addresses() -> Vec { + use sp_std::str::FromStr; + vec![ + H160::from_str("c2bf5f29a4384b1ab0c063e1c666f02121b6084a").unwrap(), + H160::from_str("5c4242beb94de30b922f57241f1d02f36e906915").unwrap(), + H160::from_str("42e2ee7ba8975c473157634ac2af4098190fc741").unwrap(), + H160::from_str("f8cef78e923919054037a1d03662bbd884ff4edf").unwrap(), + H160::from_str("e573bca813c741229ffb2488f7856c6caa841041").unwrap(), + H160::from_str("bb0cc0fb3e0c06725c67167501f850b4900d6db5").unwrap(), + H160::from_str("fe5d3c52f7ee9aa32a69b96bfbb088ba0bcd8efc").unwrap(), + H160::from_str("92496871560a01551e1b4fd04540d7a519d5c19e").unwrap(), + H160::from_str("63a1519ee99d1121780fffa1726ed2ecc6d1611b").unwrap(), + H160::from_str("dc552396caec809752fed0c5e23fd3983766e758").unwrap(), + ] +} + +pub(crate) fn genesis(balances: Vec<(AccountId, Balance)>) -> TestExternalities { + let mut storage = frame_system::GenesisConfig::default() + .build_storage::() + .unwrap(); + let genesis = pallet_balances::GenesisConfig:: { balances }; + genesis.assimilate_storage(&mut storage).unwrap(); + let genesis = pallet_sudo::GenesisConfig:: { + key: root_address(), + }; + genesis.assimilate_storage(&mut storage).unwrap(); + let mut ext = sp_io::TestExternalities::from(storage); + ext.execute_with(|| System::set_block_number(1)); + ext +} diff --git a/pallets/token-factory/src/tests.rs b/pallets/token-factory/src/tests.rs new file mode 100644 index 0000000000..1e0631b501 --- /dev/null +++ b/pallets/token-factory/src/tests.rs @@ -0,0 +1,172 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Token Factory Unit Tests +use crate::mock::{ + alice, bob, charlie, deploy_addresses, genesis, last_event, root_address, Event as TestEvent, + Origin, Test, TokenFactory, +}; +use crate::{pallet::TokenMinter, Error, Event}; +use frame_support::{assert_err, assert_noop, assert_ok}; + +#[test] +fn registration() { + genesis(vec![(root_address(), 5000000000000)]).execute_with(|| { + let tokens_to_register = 10u8; + let addresses = deploy_addresses(); + for i in 0..tokens_to_register { + let address = addresses[i as usize]; + assert!(!TokenFactory::exists(&i)); + assert_ok!(TokenFactory::register_token(Origin::root(), i)); + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Registered(i, address)) + ); + assert!(TokenFactory::exists(&i)); + assert_eq!(TokenFactory::contract_address(i).unwrap(), address); + } + }); +} + +#[test] +fn de_registration() { + genesis(vec![(root_address(), 5000000000000)]).execute_with(|| { + assert_noop!( + TokenFactory::destroy_all(Origin::root(), 1u8), + Error::::IdNotClaimed + ); + assert_ok!(TokenFactory::register_token(Origin::root(), 1u8)); + assert_ok!(TokenFactory::destroy_all(Origin::root(), 1u8)); + assert_eq!( + last_event(), + TestEvent::token_factory(Event::DestroyedAll(1u8, 0u64)) + ); + assert!(!TokenFactory::exists(&1u8)); + assert!(TokenFactory::contract_address(1u8).is_none()); + }); +} + +#[test] +fn minting() { + genesis(vec![(root_address(), 5000000000000)]).execute_with(|| { + assert_ok!(TokenFactory::register_token(Origin::root(), 1u8)); + assert_noop!( + TokenFactory::mint(0u8, alice(), 10000), + Error::::IdNotClaimed + ); + assert_ok!(TokenFactory::mint(1u8, alice(), 10000)); + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Minted(1, alice(), 10000)) + ); + assert_ok!(TokenFactory::mint(1u8, bob(), 10000)); + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Minted(1, bob(), 10000)) + ); + assert_ok!(TokenFactory::mint(1u8, charlie(), 10000)); + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Minted(1, charlie(), 10000)) + ); + assert_eq!(TokenFactory::total_issuance(1u8).unwrap(), 30000); + assert_eq!(TokenFactory::balance_of(1u8, alice()).unwrap(), 10000); + assert_eq!(TokenFactory::balance_of(1u8, bob()).unwrap(), 10000); + assert_eq!(TokenFactory::balance_of(1u8, charlie()).unwrap(), 10000); + }); +} + +#[test] +fn burning() { + genesis(vec![(root_address(), 5000000000000)]).execute_with(|| { + assert_ok!(TokenFactory::register_token(Origin::root(), 1u8)); + assert_noop!( + TokenFactory::burn(0u8, alice(), 10000), + Error::::IdNotClaimed + ); + // not a noop because we still iterate the nonce when we get balance_of before burning + assert_err!( + TokenFactory::burn(1u8, alice(), 5000), + Error::::NotEnoughBalanceToBurn + ); + assert_ok!(TokenFactory::mint(1u8, alice(), 10000)); + assert_err!( + TokenFactory::burn(1u8, bob(), 5000), + Error::::NotEnoughBalanceToBurn + ); + assert_ok!(TokenFactory::mint(1u8, bob(), 10000)); + assert_err!( + TokenFactory::burn(1u8, charlie(), 5000), + Error::::NotEnoughBalanceToBurn + ); + assert_ok!(TokenFactory::mint(1u8, charlie(), 10000)); + assert_ok!(TokenFactory::burn(1u8, alice(), 5000)); + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Burned(1, alice(), 5000)) + ); + assert_ok!(TokenFactory::burn(1u8, bob(), 5000)); + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Burned(1, bob(), 5000)) + ); + assert_ok!(TokenFactory::burn(1u8, charlie(), 10000)); + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Burned(1, charlie(), 10000)) + ); + assert_eq!(TokenFactory::total_issuance(1u8).unwrap(), 10000); + assert_eq!(TokenFactory::balance_of(1u8, alice()).unwrap(), 5000); + assert_eq!(TokenFactory::balance_of(1u8, bob()).unwrap(), 5000); + assert_eq!(TokenFactory::balance_of(1u8, charlie()).unwrap(), 0); + }); +} + +#[test] +fn get_total_supply() { + genesis(vec![(root_address(), 5000000000000)]).execute_with(|| { + assert_ok!(TokenFactory::register_token(Origin::root(), 1u8)); + assert_ok!(TokenFactory::total_issuance(1u8)); + // implies that the error event was not emitted in total issuance call + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Registered(1u8, deploy_addresses()[0])) + ); + assert_eq!(TokenFactory::total_issuance(1u8).unwrap(), 0u64); + assert_noop!( + TokenFactory::total_issuance(2u8), + Error::::IdNotClaimed + ); + }); +} + +#[test] +fn get_balance_of() { + genesis(vec![(root_address(), 5000000000000)]).execute_with(|| { + assert_ok!(TokenFactory::register_token(Origin::root(), 1u8)); + assert_ok!(TokenFactory::balance_of(1u8, root_address())); + // implies that the error event was not emitted in total issuance call + assert_eq!( + last_event(), + TestEvent::token_factory(Event::Registered(1u8, deploy_addresses()[0])) + ); + assert_eq!(TokenFactory::balance_of(1u8, root_address()).unwrap(), 0u64); + assert_noop!( + TokenFactory::balance_of(2u8, root_address()), + Error::::IdNotClaimed + ); + }); +} diff --git a/pallets/xtransfer/Cargo.toml b/pallets/xtransfer/Cargo.toml new file mode 100644 index 0000000000..f726fbbaf4 --- /dev/null +++ b/pallets/xtransfer/Cargo.toml @@ -0,0 +1,35 @@ +[package] +authors = ["PureStake"] +edition = "2018" +name = "xtransfer" +version = '0.1.0' +description = "interface for handling cross-chain transfers to relay chain or other parachains" + +[dependencies] +parity-scale-codec = { version = "2.0.0", default-features = false, features = ["derive"] } + +frame-support = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "rococo-v1", default-features = false } + +token-factory = { path = "../token-factory", default-features = false } + +xcm = { git = "https://github.com/paritytech/polkadot", branch = "rococo-v1", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "rococo-v1", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "rococo-v1", default-features = false } + +[features] +default = ["std"] +std = [ + "parity-scale-codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "sp-core/std", + "token-factory/std", + "xcm-executor/std", + "cumulus-primitives-core/std", +] diff --git a/pallets/xtransfer/src/adapter.rs b/pallets/xtransfer/src/adapter.rs new file mode 100644 index 0000000000..d3e0c51f09 --- /dev/null +++ b/pallets/xtransfer/src/adapter.rs @@ -0,0 +1,136 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Currency adapter implementation for processing cross-chain messages + +use crate::support::CurrencyIdConversion; +use frame_support::traits::{Currency, ExistenceRequirement, WithdrawReasons}; +use sp_std::{marker::PhantomData, prelude::*, result}; +use token_factory::{CurrencyId, Ticker}; +use xcm::v0::{Error as XcmError, MultiAsset, MultiLocation, Result as XcmResult}; +use xcm_executor::traits::{LocationConversion, MatchesFungible, TransactAsset}; + +/// Asset transaction errors. +enum Error { + /// Failed to match fungible. + FailedToMatchFungible, + /// `MultiLocation` to `AccountId` Conversion failed. + AccountIdConversionFailed, + /// `CurrencyId` conversion failed. + CurrencyIdConversionFailed, +} + +impl From for XcmError { + fn from(e: Error) -> Self { + match e { + Error::FailedToMatchFungible => { + XcmError::FailedToTransactAsset("FailedToMatchFungible") + } + Error::AccountIdConversionFailed => { + XcmError::FailedToTransactAsset("AccountIdConversionFailed") + } + Error::CurrencyIdConversionFailed => { + XcmError::FailedToTransactAsset("CurrencyIdConversionFailed") + } + } + } +} + +/// The handler for processing cross-chain messages +pub struct MultiCurrencyAdapter< + NativeCurrency, + TokenFactory, + Matcher, + AccountIdConverter, + AccountId, + CurrencyIdConverter, + CurrencyId, +>( + PhantomData<( + NativeCurrency, + TokenFactory, + Matcher, + AccountIdConverter, + AccountId, + CurrencyIdConverter, + CurrencyId, + )>, +); + +impl< + NativeCurrency: Currency, + TokenFactory: token_factory::TokenMinter, + Matcher: MatchesFungible, + AccountIdConverter: LocationConversion, + AccountId: sp_std::fmt::Debug + Clone, + CurrencyIdConverter: CurrencyIdConversion, + > TransactAsset + for MultiCurrencyAdapter< + NativeCurrency, + TokenFactory, + Matcher, + AccountIdConverter, + AccountId, + CurrencyIdConverter, + CurrencyId, + > +{ + fn deposit_asset(asset: &MultiAsset, location: &MultiLocation) -> XcmResult { + let who = AccountIdConverter::from_location(location) + .ok_or_else::(|| Error::AccountIdConversionFailed.into())?; + let currency = CurrencyIdConverter::from_asset(asset) + .ok_or_else::(|| Error::CurrencyIdConversionFailed.into())?; + let amount: NativeCurrency::Balance = Matcher::matches_fungible(&asset) + .ok_or_else::(|| Error::FailedToMatchFungible.into())?; + if let CurrencyId::Token(token_id) = currency { + // mint erc20 token to `who` (in the EVM) + TokenFactory::mint(token_id, who.clone(), amount) + .map_err(|e| XcmError::FailedToTransactAsset(e.into()))?; + } else { + // native currency transfer via `frame/pallet_balances` + NativeCurrency::deposit_creating(&who, amount); + } + Ok(()) + } + + fn withdraw_asset( + asset: &MultiAsset, + location: &MultiLocation, + ) -> result::Result { + let who = AccountIdConverter::from_location(location) + .ok_or_else::(|| Error::AccountIdConversionFailed.into())?; + let currency = CurrencyIdConverter::from_asset(asset) + .ok_or_else::(|| Error::CurrencyIdConversionFailed.into())?; + let amount: NativeCurrency::Balance = Matcher::matches_fungible(&asset) + .ok_or_else::(|| Error::FailedToMatchFungible.into())?; + // match on currency variant + if let CurrencyId::Token(token_id) = currency { + // burn erc20 token from `who` + TokenFactory::burn(token_id, who.clone(), amount) + .map_err(|e| XcmError::FailedToTransactAsset(e.into()))?; + } else { + // native currency transfer via `frame/pallet_balances` + NativeCurrency::withdraw( + &who, + amount, + WithdrawReasons::TRANSFER, + ExistenceRequirement::AllowDeath, + ) + .map_err(|e| XcmError::FailedToTransactAsset(e.into()))?; + } + Ok(asset.clone()) + } +} diff --git a/pallets/xtransfer/src/lib.rs b/pallets/xtransfer/src/lib.rs new file mode 100644 index 0000000000..0d51aaa050 --- /dev/null +++ b/pallets/xtransfer/src/lib.rs @@ -0,0 +1,513 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Xtransfer handles cross-chain transfers. + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod adapter; +pub mod support; + +use frame_support::pallet; + +pub use pallet::*; + +#[pallet] +pub mod pallet { + use cumulus_primitives_core::{relay_chain::Balance as RelayChainBalance, ParaId}; + use frame_support::{pallet_prelude::*, traits::Get, transactional}; + use frame_system::pallet_prelude::*; + use sp_runtime::traits::{AtLeast32BitUnsigned, Convert}; + use sp_std::{convert::Into, prelude::*}; + use token_factory::CurrencyId; + use xcm::v0::{ + Error as XcmError, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId, Order, Xcm, + }; + use xcm_executor::traits::LocationConversion; + + #[derive(Encode, Decode, Eq, PartialEq, Clone, Copy, RuntimeDebug)] + /// Identity of chain. + pub enum ChainId { + /// The relay chain. + RelayChain, + /// A parachain. + ParaChain(ParaId), + } + + #[derive(Encode, Decode, Eq, PartialEq, Clone, RuntimeDebug)] + /// Identity of cross chain currency. + pub struct XCurrencyId { + /// The reserve chain of the currency. For instance, the reserve chain + /// of DOT is Polkadot. + pub chain_id: ChainId, + /// The identity of the currency. + pub currency_id: Vec, + } + + impl Into for XCurrencyId { + fn into(self) -> MultiLocation { + MultiLocation::X1(Junction::GeneralKey(self.currency_id)) + } + } + + /// Pallet for executing cross-chain transfers + #[pallet::pallet] + pub struct Pallet(PhantomData); + + /// The shape of AccountId for (most) substrate chains (not Moonbeam, which is H160 => 20 bytes) + type AccountId32 = [u8; 32]; + + /// Configuration trait of this pallet. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Overarching event type + type Event: From> + IsType<::Event>; + /// Balances type + type Balance: Parameter + + Member + + AtLeast32BitUnsigned + + Default + + Copy + + MaybeSerializeDeserialize + + Into; + /// Moonbeam parachain identifier + type ParaId: Get; + /// Convert local balance into relay chain balance type + type ToRelayChainBalance: Convert; + /// Convert system::AccountId to key shape for Junction::AccountKey20 [u8; 20] + type AccountKey20Convert: Convert; + /// Convert account to MultiLocation + type ToMultiLocation: LocationConversion; + /// Relay chain identifier + type RelayChainNetworkId: Get; + /// XCM Executor for executing XCM effects locally + type XcmExecutor: ExecuteXcm; + } + + #[pallet::event] + #[pallet::generate_deposit(fn deposit_event)] + pub enum Event { + /// Transferred to relay chain. \[src, dest, amount\] + TransferredToRelayChain(T::AccountId, AccountId32, T::Balance), + /// Transfer to relay chain failed. \[src, dest, amount, error\] + TransferToRelayChainFailed(T::AccountId, AccountId32, T::Balance, XcmError), + /// Transferred to parachain. \[x_currency_id, src, para_id, dest, dest_network, amount\] + TransferredToAccountId32Parachain( + XCurrencyId, + T::AccountId, + ParaId, + AccountId32, + NetworkId, + T::Balance, + ), + /// Transfer to parachain failed. \[x_currency_id, src, para_id, dest, + /// dest_network, amount, error\] + TransferToAccountId32ParachainFailed( + XCurrencyId, + T::AccountId, + ParaId, + AccountId32, + NetworkId, + T::Balance, + XcmError, + ), + /// Transferred to parachain. \[x_currency_id, src, para_id, dest, dest_network, amount\] + TransferredToAccountKey20Parachain( + XCurrencyId, + T::AccountId, + ParaId, + T::AccountId, + NetworkId, + T::Balance, + ), + /// Transfer to parachain failed. \[x_currency_id, src, para_id, dest, + /// dest_network, amount, error\] + TransferToAccountKey20ParachainFailed( + XCurrencyId, + T::AccountId, + ParaId, + T::AccountId, + NetworkId, + T::Balance, + XcmError, + ), + } + + #[pallet::error] + pub enum Error { + /// Bad location. + BadLocation, + /// Cannot send message from parachain to self + CannotSendToSelf, + /// Call to SendXcm failed + FailedToSendXcm, + } + + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::call] + impl Pallet { + /// Transfer relay chain tokens to relay chain. + #[pallet::weight(10)] + #[transactional] + pub fn transfer_to_relay_chain( + origin: OriginFor, + dest: AccountId32, + amount: T::Balance, + ) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + + let xcm = Xcm::WithdrawAsset { + assets: vec![MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::Parent), + amount: T::ToRelayChainBalance::convert(amount), + }], + effects: vec![Order::InitiateReserveWithdraw { + assets: vec![MultiAsset::All], + reserve: MultiLocation::X1(Junction::Parent), + effects: vec![Order::DepositAsset { + assets: vec![MultiAsset::All], + dest: MultiLocation::X1(Junction::AccountId32 { + network: T::RelayChainNetworkId::get(), + id: dest.clone(), + }), + }], + }], + }; + + let xcm_origin = T::ToMultiLocation::try_into_location(who.clone()) + .map_err(|_| Error::::BadLocation)?; + // TODO: revert state on xcm execution failure. + match T::XcmExecutor::execute_xcm(xcm_origin, xcm) { + Ok(_) => { + Self::deposit_event(Event::::TransferredToRelayChain(who, dest, amount)) + } + Err(err) => Self::deposit_event(Event::::TransferToRelayChainFailed( + who, dest, amount, err, + )), + } + + Ok(().into()) + } + /// Transfer tokens to parachain that uses [u8; 32] for system::AccountId + /// - channel must be open with self as sender + #[pallet::weight(10)] + #[transactional] + pub fn transfer_to_account_id_32_parachain( + origin: OriginFor, + x_currency_id: XCurrencyId, + para_id: ParaId, + dest: AccountId32, + dest_network: NetworkId, + amount: T::Balance, + ) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + ensure!(para_id != T::ParaId::get(), Error::::CannotSendToSelf); + // ensure!( + // >::sender_channels().contains(¶_id), + // Error::::NoSenderChannelOpen + // ); + + let destination = Self::account_id_32_destination(dest_network.clone(), &dest); + + let xcm = match x_currency_id.chain_id { + ChainId::RelayChain => { + Self::transfer_relay_chain_tokens_to_parachain(para_id, destination, amount) + } + ChainId::ParaChain(reserve_chain) => { + if T::ParaId::get() == reserve_chain { + Self::transfer_owned_tokens_to_parachain( + x_currency_id.clone(), + para_id, + destination, + amount, + ) + } else { + Self::transfer_non_owned_tokens_to_parachain( + reserve_chain, + x_currency_id.clone(), + para_id, + destination, + amount, + ) + } + } + }; + + let xcm_origin = T::ToMultiLocation::try_into_location(who.clone()) + .map_err(|_| Error::::BadLocation)?; + // TODO: revert state on xcm execution failure. + match T::XcmExecutor::execute_xcm(xcm_origin, xcm) { + Ok(_) => Self::deposit_event(Event::::TransferredToAccountId32Parachain( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + )), + Err(err) => Self::deposit_event(Event::::TransferToAccountId32ParachainFailed( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + err, + )), + } + + Ok(().into()) + } + /// Transfer native tokens to other parachain that uses [u8; 20] + /// - assumes channel already exists with self (but not checked for now) + #[pallet::weight(10)] + #[transactional] + pub fn transfer_native( + origin: OriginFor, + para_id: ParaId, + dest: T::AccountId, + amount: T::Balance, + ) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + let self_id = T::ParaId::get(); + // TODO: ensure channel exists + ensure!(para_id != self_id, Error::::CannotSendToSelf); + let x_currency_id = XCurrencyId { + chain_id: ChainId::ParaChain(self_id), + currency_id: CurrencyId::Native.into(), + }; + let dest_network = T::RelayChainNetworkId::get(); + let destination = Self::account_key_20_destination(dest_network.clone(), dest.clone()); + let xcm = Self::transfer_owned_tokens_to_parachain( + x_currency_id.clone(), + para_id, + destination, + amount, + ); + let xcm_origin = T::ToMultiLocation::try_into_location(who.clone()) + .map_err(|_| Error::::BadLocation)?; + // TODO: revert state on xcm execution failure. + match T::XcmExecutor::execute_xcm(xcm_origin, xcm) { + Ok(_) => Self::deposit_event(Event::::TransferredToAccountKey20Parachain( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + )), + Err(err) => Self::deposit_event(Event::::TransferToAccountKey20ParachainFailed( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + err, + )), + } + Ok(().into()) + } + /// Transfer tokens to parachain that uses [u8; 20] for system::AccountId + /// - channel must be open with self as sender + #[pallet::weight(10)] + #[transactional] + pub fn transfer_to_account_key_20_parachain( + origin: OriginFor, + x_currency_id: XCurrencyId, + para_id: ParaId, + dest: T::AccountId, + dest_network: NetworkId, + amount: T::Balance, + ) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + ensure!(para_id != T::ParaId::get(), Error::::CannotSendToSelf); + // ensure!( + // >::sender_channels().contains(¶_id), + // Error::::NoSenderChannelOpen + // ); + + let destination = Self::account_key_20_destination(dest_network.clone(), dest.clone()); + + let xcm = match x_currency_id.chain_id { + ChainId::RelayChain => { + Self::transfer_relay_chain_tokens_to_parachain(para_id, destination, amount) + } + ChainId::ParaChain(reserve_chain) => { + if T::ParaId::get() == reserve_chain { + Self::transfer_owned_tokens_to_parachain( + x_currency_id.clone(), + para_id, + destination, + amount, + ) + } else { + Self::transfer_non_owned_tokens_to_parachain( + reserve_chain, + x_currency_id.clone(), + para_id, + destination, + amount, + ) + } + } + }; + + let xcm_origin = T::ToMultiLocation::try_into_location(who.clone()) + .map_err(|_| Error::::BadLocation)?; + // TODO: revert state on xcm execution failure. + match T::XcmExecutor::execute_xcm(xcm_origin, xcm) { + Ok(_) => Self::deposit_event(Event::::TransferredToAccountKey20Parachain( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + )), + Err(err) => Self::deposit_event(Event::::TransferToAccountKey20ParachainFailed( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + err, + )), + } + + Ok(().into()) + } + } + + impl Pallet { + /// Form multilocation when recipient chain uses AccountId32 as system::AccountId type + fn account_id_32_destination(network: NetworkId, id: &AccountId32) -> MultiLocation { + MultiLocation::X1(Junction::AccountId32 { + network, + id: id.clone(), + }) + } + /// Form multilocation when recipient chain uses AccountKey20 as system::AccountId type + fn account_key_20_destination(network: NetworkId, key: T::AccountId) -> MultiLocation { + MultiLocation::X1(Junction::AccountKey20 { + network, + key: T::AccountKey20Convert::convert(key).clone(), + }) + } + /// Returns upward message to transfer tokens from relay chain to parachain + fn transfer_relay_chain_tokens_to_parachain( + para_id: ParaId, + destination: MultiLocation, + amount: T::Balance, + ) -> Xcm { + Xcm::WithdrawAsset { + assets: vec![MultiAsset::ConcreteFungible { + id: MultiLocation::X1(Junction::Parent), + amount: T::ToRelayChainBalance::convert(amount), + }], + effects: vec![Order::InitiateReserveWithdraw { + assets: vec![MultiAsset::All], + reserve: MultiLocation::X1(Junction::Parent), + effects: vec![Order::DepositReserveAsset { + assets: vec![MultiAsset::All], + // `dest` is children parachain(of parent). + dest: MultiLocation::X1(Junction::Parachain { id: para_id.into() }), + effects: vec![Order::DepositAsset { + assets: vec![MultiAsset::All], + dest: destination, + }], + }], + }], + } + } + /// Transfer parachain tokens "owned" by self parachain to another + /// parachain. + /// + /// NOTE - `para_id` must not be self parachain. + fn transfer_owned_tokens_to_parachain( + x_currency_id: XCurrencyId, + para_id: ParaId, + destination: MultiLocation, + amount: T::Balance, + ) -> Xcm { + Xcm::WithdrawAsset { + assets: vec![MultiAsset::ConcreteFungible { + id: x_currency_id.into(), + amount: amount.into(), + }], + effects: vec![Order::DepositReserveAsset { + assets: vec![MultiAsset::All], + dest: MultiLocation::X2( + Junction::Parent, + Junction::Parachain { id: para_id.into() }, + ), + effects: vec![Order::DepositAsset { + assets: vec![MultiAsset::All], + dest: destination, + }], + }], + } + } + /// Transfer parachain tokens not "owned" by self chain to another + /// parachain. + fn transfer_non_owned_tokens_to_parachain( + reserve_chain: ParaId, + x_currency_id: XCurrencyId, + para_id: ParaId, + destination: MultiLocation, + amount: T::Balance, + ) -> Xcm { + let deposit_to_dest = Order::DepositAsset { + assets: vec![MultiAsset::All], + dest: destination, + }; + // If transfer to reserve chain, deposit to `dest` on reserve chain, + // else deposit reserve asset. + let reserve_chain_order = if para_id == reserve_chain { + deposit_to_dest + } else { + Order::DepositReserveAsset { + assets: vec![MultiAsset::All], + dest: MultiLocation::X2( + Junction::Parent, + Junction::Parachain { id: para_id.into() }, + ), + effects: vec![deposit_to_dest], + } + }; + + Xcm::WithdrawAsset { + assets: vec![MultiAsset::ConcreteFungible { + id: x_currency_id.into(), + amount: amount.into(), + }], + effects: vec![Order::InitiateReserveWithdraw { + assets: vec![MultiAsset::All], + reserve: MultiLocation::X2( + Junction::Parent, + Junction::Parachain { + id: reserve_chain.into(), + }, + ), + effects: vec![reserve_chain_order], + }], + } + } + } +} diff --git a/pallets/xtransfer/src/support.rs b/pallets/xtransfer/src/support.rs new file mode 100644 index 0000000000..a035254406 --- /dev/null +++ b/pallets/xtransfer/src/support.rs @@ -0,0 +1,90 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! XCM objects and relationships + +use frame_support::traits::Get; +use sp_runtime::{ + traits::{CheckedConversion, Convert}, +}; +use sp_std::{ + convert::{TryFrom, TryInto}, + marker::PhantomData, + prelude::*, +}; +use xcm::v0::{Junction, MultiAsset, MultiLocation}; +use xcm_executor::traits::MatchesFungible; + +// /// The XCM handler to execute XCM locally. +// pub trait XcmHandler { +// fn execute_xcm(origin: AccountId, xcm: Xcm) -> DispatchResult; +// } + +pub trait CurrencyIdConversion { + fn from_asset(asset: &MultiAsset) -> Option; +} + +/// Matcher associated type for MultiCurrencyAdapter to convert assets into local types +pub struct IsConcreteWithGeneralKey( + PhantomData<(CurrencyId, FromRelayChainBalance)>, +); +impl MatchesFungible + for IsConcreteWithGeneralKey +where + CurrencyId: TryFrom>, + B: TryFrom, + FromRelayChainBalance: Convert, +{ + fn matches_fungible(a: &MultiAsset) -> Option { + if let MultiAsset::ConcreteFungible { id, amount } = a { + if id == &MultiLocation::X1(Junction::Parent) { + // Convert relay chain decimals to local chain + let local_amount = FromRelayChainBalance::convert(*amount); + return CheckedConversion::checked_from(local_amount); + } + if let Some(Junction::GeneralKey(key)) = id.last() { + if TryInto::::try_into(key.clone()).is_ok() { + return CheckedConversion::checked_from(*amount); + } + } + } + None + } +} + +/// Converter from MultiAsset to local Currency type +pub struct CurrencyIdConverter( + PhantomData, + PhantomData, +); +impl CurrencyIdConversion + for CurrencyIdConverter +where + CurrencyId: TryFrom>, + RelayChainCurrencyId: Get, +{ + fn from_asset(asset: &MultiAsset) -> Option { + if let MultiAsset::ConcreteFungible { id: location, .. } = asset { + if location == &MultiLocation::X1(Junction::Parent) { + return Some(RelayChainCurrencyId::get()); + } + if let Some(Junction::GeneralKey(key)) = location.last() { + return CurrencyId::try_from(key.clone()).ok(); + } + } + None + } +} diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index e209351ba7..1b3105a5d6 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -19,6 +19,8 @@ pallet-ethereum-chain-id = { path = "../pallets/ethereum-chain-id", default-feat parachain-staking = { path = "../pallets/parachain-staking", default-features = false } author-inherent = { path = "../pallets/author-inherent", default-features = false } pallet-author-filter = { path = "../pallets/author-filter", default-features = false } +token-factory = { path = "../pallets/token-factory", default-features = false } +xtransfer = { path = "../pallets/xtransfer", default-features = false } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-v1" } @@ -58,6 +60,11 @@ moonbeam-rpc-primitives-txpool = { path = "../primitives/rpc/txpool", default-fe # Cumulus dependencies cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "rococo-v1" } cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "rococo-v1" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "rococo-v1" } +cumulus-pallet-xcm-handler = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "rococo-v1" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "rococo-v1" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "rococo-v1" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "rococo-v1" } parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "rococo-v1" } [build-dependencies] @@ -109,6 +116,13 @@ std = [ "account/std", "parachain-staking/std", "pallet-author-filter/std", + "xtransfer/std", + "token-factory/std", + "xcm-builder/std", + "cumulus-pallet-xcm-handler/std", + "xcm-executor/std", + "xcm/std", + "polkadot-parachain/std", ] # Will be enabled by the `wasm-builder` when building the runtime for WASM. diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index bc1859ebf6..4c44385f2c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -28,6 +28,7 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +use cumulus_primitives_core::relay_chain::Balance as RelayChainBalance; use fp_rpc::TransactionStatus; use frame_support::{ construct_runtime, @@ -45,11 +46,12 @@ use pallet_evm::{ use pallet_transaction_payment::CurrencyAdapter; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode}; +use polkadot_parachain::primitives::Sibling; use sp_api::impl_runtime_apis; use sp_core::{OpaqueMetadata, H160, H256, U256}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, Verify}, + traits::{BlakeTwo256, Block as BlockT, Convert, IdentifyAccount, IdentityLookup, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, Perbill, }; @@ -57,6 +59,15 @@ use sp_std::{convert::TryFrom, prelude::*}; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; +use token_factory::{CurrencyId, Ticker}; +use xcm::v0::{Junction, MultiLocation, NetworkId}; +use xcm_builder::{ + AccountKey20Aliases, LocationInverter, ParentIsDefault, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, + SovereignSignedViaLocation, +}; +use xcm_executor::{traits::NativeAsset, XcmExecutor}; +use xtransfer::{adapter::*, support::*}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -367,16 +378,6 @@ impl pallet_ethereum::Config for Runtime { type BlockGasLimit = BlockGasLimit; } -impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; - type OnValidationData = (); - type SelfParaId = ParachainInfo; - type DownwardMessageHandlers = (); - type HrmpMessageHandlers = (); -} - -impl parachain_info::Config for Runtime {} - /// GLMR, the native token, uses 18 decimals of precision. pub const GLMR: Balance = 1_000_000_000_000_000_000; @@ -429,6 +430,102 @@ impl pallet_author_filter::Config for Runtime { type RandomnessSource = RandomnessCollectiveFlip; } +pub struct AccountToH160; +impl Convert<<::Signer as IdentifyAccount>::AccountId, H160> + for AccountToH160 +{ + fn convert(from: <::Signer as IdentifyAccount>::AccountId) -> H160 { + from + } +} + +impl token_factory::Config for Runtime { + type Event = Event; + type Balance = Balance; + type TokenId = Ticker; + type AccountToH160 = AccountToH160; +} + +parameter_types! { + pub const PolkadotNetworkId: NetworkId = NetworkId::Polkadot; + pub MoonbeamNetwork: NetworkId = NetworkId::Named("moon".into()); + pub RelayChainOrigin: Origin = cumulus_pallet_xcm_handler::Origin::Relay.into(); + pub Ancestry: MultiLocation = MultiLocation::X1(Junction::Parachain { + id: ParachainInfo::get().into(), + }); + pub const RelayChainCurrencyId: CurrencyId = CurrencyId::Token(Ticker::DOT); +} + +pub type LocationConverter = ( + ParentIsDefault, + SiblingParachainConvertsVia, + AccountKey20Aliases, +); + +pub struct RelayToNative; +impl Convert for RelayToNative { + fn convert(val: u128) -> Balance { + // native is 18 + // relay is 12 + val * 1_000_000 + } +} +pub struct NativeToRelay; +impl Convert for NativeToRelay { + fn convert(val: u128) -> RelayChainBalance { + // native is 18 + // relay is 12 + val / 1_000_000 + } +} + +pub type LocalAssetTransactor = MultiCurrencyAdapter< + Balances, + TokenFactory, + IsConcreteWithGeneralKey, + LocationConverter, + AccountId, + CurrencyIdConverter, + CurrencyId, +>; + +pub type LocalOriginConverter = ( + SovereignSignedViaLocation, + RelayChainAsNative, + SiblingParachainAsNative, + SignedAccountKey20AsNative, +); + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type Call = Call; + type XcmSender = XcmHandler; + type AssetTransactor = LocalAssetTransactor; + type OriginConverter = LocalOriginConverter; + type IsReserve = NativeAsset; + type IsTeleporter = (); + type LocationInverter = LocationInverter; +} + +impl cumulus_pallet_xcm_handler::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type UpwardMessageSender = ParachainSystem; + type HrmpMessageSender = ParachainSystem; + type SendXcmOrigin = EnsureRoot; + type AccountIdConverter = LocationConverter; +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type Event = Event; + type OnValidationData = (); + type SelfParaId = ParachainInfo; + type DownwardMessageHandlers = XcmHandler; + type HrmpMessageHandlers = XcmHandler; +} + +impl parachain_info::Config for Runtime {} + construct_runtime! { pub enum Runtime where Block = Block, @@ -450,6 +547,8 @@ construct_runtime! { ParachainStaking: parachain_staking::{Pallet, Call, Storage, Event, Config}, Scheduler: pallet_scheduler::{Pallet, Storage, Config, Event, Call}, Democracy: pallet_democracy::{Pallet, Storage, Config, Event, Call}, + TokenFactory: token_factory::{Pallet, Call, Storage, Event}, + XcmHandler: cumulus_pallet_xcm_handler::{Pallet, Call, Event, Origin}, // The order matters here. Inherents will be included in the order specified here. // Concretely we need the author inherent to come after the parachain_upgrade inherent. AuthorInherent: author_inherent::{Pallet, Call, Storage, Inherent}, From 77b3439279a3aedfcbdbc4d55fd455be88531048 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Tue, 30 Mar 2021 10:30:55 -0700 Subject: [PATCH 07/11] fmt --- pallets/xtransfer/src/support.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pallets/xtransfer/src/support.rs b/pallets/xtransfer/src/support.rs index a035254406..124b339b90 100644 --- a/pallets/xtransfer/src/support.rs +++ b/pallets/xtransfer/src/support.rs @@ -17,9 +17,7 @@ //! XCM objects and relationships use frame_support::traits::Get; -use sp_runtime::{ - traits::{CheckedConversion, Convert}, -}; +use sp_runtime::traits::{CheckedConversion, Convert}; use sp_std::{ convert::{TryFrom, TryInto}, marker::PhantomData, From fcd234eb761e41426c4bd983806346e6dc13f537 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Tue, 30 Mar 2021 12:23:44 -0700 Subject: [PATCH 08/11] runtime --- Cargo.lock | 1 + pallets/xtransfer/Cargo.toml | 2 + pallets/xtransfer/src/lib.rs | 188 ++++++++++------------------------- runtime/src/lib.rs | 19 ++++ 4 files changed, 74 insertions(+), 136 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63a09e0976..bb6f6bb054 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11802,6 +11802,7 @@ dependencies = [ name = "xtransfer" version = "0.1.0" dependencies = [ + "cumulus-pallet-xcm-handler", "cumulus-primitives-core", "frame-support", "frame-system", diff --git a/pallets/xtransfer/Cargo.toml b/pallets/xtransfer/Cargo.toml index f726fbbaf4..1b4103c17a 100644 --- a/pallets/xtransfer/Cargo.toml +++ b/pallets/xtransfer/Cargo.toml @@ -18,6 +18,7 @@ token-factory = { path = "../token-factory", default-features = false } xcm = { git = "https://github.com/paritytech/polkadot", branch = "rococo-v1", default-features = false } xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "rococo-v1", default-features = false } +cumulus-pallet-xcm-handler = { git = "https://github.com/paritytech/cumulus", branch = "rococo-v1", default-features = false } cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "rococo-v1", default-features = false } [features] @@ -31,5 +32,6 @@ std = [ "sp-core/std", "token-factory/std", "xcm-executor/std", + "cumulus-pallet-xcm-handler/std", "cumulus-primitives-core/std", ] diff --git a/pallets/xtransfer/src/lib.rs b/pallets/xtransfer/src/lib.rs index 0d51aaa050..9f39ce4857 100644 --- a/pallets/xtransfer/src/lib.rs +++ b/pallets/xtransfer/src/lib.rs @@ -33,10 +33,7 @@ pub mod pallet { use sp_runtime::traits::{AtLeast32BitUnsigned, Convert}; use sp_std::{convert::Into, prelude::*}; use token_factory::CurrencyId; - use xcm::v0::{ - Error as XcmError, ExecuteXcm, Junction, MultiAsset, MultiLocation, NetworkId, Order, Xcm, - }; - use xcm_executor::traits::LocationConversion; + use xcm::v0::{Junction, MultiAsset, MultiLocation, NetworkId, Order, Xcm}; #[derive(Encode, Decode, Eq, PartialEq, Clone, Copy, RuntimeDebug)] /// Identity of chain. @@ -72,7 +69,7 @@ pub mod pallet { /// Configuration trait of this pallet. #[pallet::config] - pub trait Config: frame_system::Config { + pub trait Config: frame_system::Config + cumulus_pallet_xcm_handler::Config { /// Overarching event type type Event: From> + IsType<::Event>; /// Balances type @@ -83,18 +80,14 @@ pub mod pallet { + Copy + MaybeSerializeDeserialize + Into; - /// Moonbeam parachain identifier - type ParaId: Get; /// Convert local balance into relay chain balance type type ToRelayChainBalance: Convert; - /// Convert system::AccountId to key shape for Junction::AccountKey20 [u8; 20] + /// Convert system::AccountId to shape of inner field for Junction::AccountKey20 [u8; 20] type AccountKey20Convert: Convert; - /// Convert account to MultiLocation - type ToMultiLocation: LocationConversion; /// Relay chain identifier type RelayChainNetworkId: Get; - /// XCM Executor for executing XCM effects locally - type XcmExecutor: ExecuteXcm; + /// This parachain's identifier + type SelfParaId: Get; } #[pallet::event] @@ -102,8 +95,6 @@ pub mod pallet { pub enum Event { /// Transferred to relay chain. \[src, dest, amount\] TransferredToRelayChain(T::AccountId, AccountId32, T::Balance), - /// Transfer to relay chain failed. \[src, dest, amount, error\] - TransferToRelayChainFailed(T::AccountId, AccountId32, T::Balance, XcmError), /// Transferred to parachain. \[x_currency_id, src, para_id, dest, dest_network, amount\] TransferredToAccountId32Parachain( XCurrencyId, @@ -113,17 +104,6 @@ pub mod pallet { NetworkId, T::Balance, ), - /// Transfer to parachain failed. \[x_currency_id, src, para_id, dest, - /// dest_network, amount, error\] - TransferToAccountId32ParachainFailed( - XCurrencyId, - T::AccountId, - ParaId, - AccountId32, - NetworkId, - T::Balance, - XcmError, - ), /// Transferred to parachain. \[x_currency_id, src, para_id, dest, dest_network, amount\] TransferredToAccountKey20Parachain( XCurrencyId, @@ -133,23 +113,10 @@ pub mod pallet { NetworkId, T::Balance, ), - /// Transfer to parachain failed. \[x_currency_id, src, para_id, dest, - /// dest_network, amount, error\] - TransferToAccountKey20ParachainFailed( - XCurrencyId, - T::AccountId, - ParaId, - T::AccountId, - NetworkId, - T::Balance, - XcmError, - ), } #[pallet::error] pub enum Error { - /// Bad location. - BadLocation, /// Cannot send message from parachain to self CannotSendToSelf, /// Call to SendXcm failed @@ -162,6 +129,7 @@ pub mod pallet { #[pallet::call] impl Pallet { /// Transfer relay chain tokens to relay chain. + /// TODO: check that relay chain token type is registered locally beforehand #[pallet::weight(10)] #[transactional] pub fn transfer_to_relay_chain( @@ -188,26 +156,16 @@ pub mod pallet { }], }], }; - - let xcm_origin = T::ToMultiLocation::try_into_location(who.clone()) - .map_err(|_| Error::::BadLocation)?; // TODO: revert state on xcm execution failure. - match T::XcmExecutor::execute_xcm(xcm_origin, xcm) { - Ok(_) => { - Self::deposit_event(Event::::TransferredToRelayChain(who, dest, amount)) - } - Err(err) => Self::deposit_event(Event::::TransferToRelayChainFailed( - who, dest, amount, err, - )), - } - + >::execute_xcm(who.clone(), xcm)?; + Self::deposit_event(Event::TransferredToRelayChain(who, dest, amount)); Ok(().into()) } /// Transfer tokens to parachain that uses [u8; 32] for system::AccountId - /// - channel must be open with self as sender + /// TODO: check if channel exists before making any changes #[pallet::weight(10)] #[transactional] - pub fn transfer_to_account_id_32_parachain( + pub fn transfer_to_account32_parachain( origin: OriginFor, x_currency_id: XCurrencyId, para_id: ParaId, @@ -216,11 +174,10 @@ pub mod pallet { amount: T::Balance, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(para_id != T::ParaId::get(), Error::::CannotSendToSelf); - // ensure!( - // >::sender_channels().contains(¶_id), - // Error::::NoSenderChannelOpen - // ); + ensure!( + para_id != T::SelfParaId::get(), + Error::::CannotSendToSelf + ); let destination = Self::account_id_32_destination(dest_network.clone(), &dest); @@ -229,7 +186,7 @@ pub mod pallet { Self::transfer_relay_chain_tokens_to_parachain(para_id, destination, amount) } ChainId::ParaChain(reserve_chain) => { - if T::ParaId::get() == reserve_chain { + if T::SelfParaId::get() == reserve_chain { Self::transfer_owned_tokens_to_parachain( x_currency_id.clone(), para_id, @@ -247,44 +204,30 @@ pub mod pallet { } } }; - - let xcm_origin = T::ToMultiLocation::try_into_location(who.clone()) - .map_err(|_| Error::::BadLocation)?; // TODO: revert state on xcm execution failure. - match T::XcmExecutor::execute_xcm(xcm_origin, xcm) { - Ok(_) => Self::deposit_event(Event::::TransferredToAccountId32Parachain( - x_currency_id, - who, - para_id, - dest, - dest_network, - amount, - )), - Err(err) => Self::deposit_event(Event::::TransferToAccountId32ParachainFailed( - x_currency_id, - who, - para_id, - dest, - dest_network, - amount, - err, - )), - } - + >::execute_xcm(who.clone(), xcm)?; + Self::deposit_event(Event::TransferredToAccountId32Parachain( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + )); Ok(().into()) } /// Transfer native tokens to other parachain that uses [u8; 20] - /// - assumes channel already exists with self (but not checked for now) + /// TODO: check if channel exists before making any changes #[pallet::weight(10)] #[transactional] - pub fn transfer_native( + pub fn transfer_native_to_account20_parachain( origin: OriginFor, para_id: ParaId, dest: T::AccountId, amount: T::Balance, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - let self_id = T::ParaId::get(); + let self_id = T::SelfParaId::get(); // TODO: ensure channel exists ensure!(para_id != self_id, Error::::CannotSendToSelf); let x_currency_id = XCurrencyId { @@ -299,35 +242,23 @@ pub mod pallet { destination, amount, ); - let xcm_origin = T::ToMultiLocation::try_into_location(who.clone()) - .map_err(|_| Error::::BadLocation)?; // TODO: revert state on xcm execution failure. - match T::XcmExecutor::execute_xcm(xcm_origin, xcm) { - Ok(_) => Self::deposit_event(Event::::TransferredToAccountKey20Parachain( - x_currency_id, - who, - para_id, - dest, - dest_network, - amount, - )), - Err(err) => Self::deposit_event(Event::::TransferToAccountKey20ParachainFailed( - x_currency_id, - who, - para_id, - dest, - dest_network, - amount, - err, - )), - } + >::execute_xcm(who.clone(), xcm)?; + Self::deposit_event(Event::TransferredToAccountKey20Parachain( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + )); Ok(().into()) } /// Transfer tokens to parachain that uses [u8; 20] for system::AccountId - /// - channel must be open with self as sender + /// TODO: check if channel exists before making any changes #[pallet::weight(10)] #[transactional] - pub fn transfer_to_account_key_20_parachain( + pub fn transfer_to_account20_parachain( origin: OriginFor, x_currency_id: XCurrencyId, para_id: ParaId, @@ -336,11 +267,10 @@ pub mod pallet { amount: T::Balance, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(para_id != T::ParaId::get(), Error::::CannotSendToSelf); - // ensure!( - // >::sender_channels().contains(¶_id), - // Error::::NoSenderChannelOpen - // ); + ensure!( + para_id != T::SelfParaId::get(), + Error::::CannotSendToSelf + ); let destination = Self::account_key_20_destination(dest_network.clone(), dest.clone()); @@ -349,7 +279,7 @@ pub mod pallet { Self::transfer_relay_chain_tokens_to_parachain(para_id, destination, amount) } ChainId::ParaChain(reserve_chain) => { - if T::ParaId::get() == reserve_chain { + if T::SelfParaId::get() == reserve_chain { Self::transfer_owned_tokens_to_parachain( x_currency_id.clone(), para_id, @@ -367,30 +297,16 @@ pub mod pallet { } } }; - - let xcm_origin = T::ToMultiLocation::try_into_location(who.clone()) - .map_err(|_| Error::::BadLocation)?; // TODO: revert state on xcm execution failure. - match T::XcmExecutor::execute_xcm(xcm_origin, xcm) { - Ok(_) => Self::deposit_event(Event::::TransferredToAccountKey20Parachain( - x_currency_id, - who, - para_id, - dest, - dest_network, - amount, - )), - Err(err) => Self::deposit_event(Event::::TransferToAccountKey20ParachainFailed( - x_currency_id, - who, - para_id, - dest, - dest_network, - amount, - err, - )), - } - + >::execute_xcm(who.clone(), xcm)?; + Self::deposit_event(Event::TransferredToAccountKey20Parachain( + x_currency_id, + who, + para_id, + dest, + dest_network, + amount, + )); Ok(().into()) } } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 4c44385f2c..56e583dfe4 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -526,6 +526,24 @@ impl cumulus_pallet_parachain_system::Config for Runtime { impl parachain_info::Config for Runtime {} +pub struct AccountKey20Convert; +impl Convert<<::Signer as IdentifyAccount>::AccountId, [u8; 20]> + for AccountKey20Convert +{ + fn convert(from: <::Signer as IdentifyAccount>::AccountId) -> [u8; 20] { + from.into() + } +} + +impl xtransfer::Config for Runtime { + type Event = Event; + type Balance = Balance; + type ToRelayChainBalance = NativeToRelay; + type AccountKey20Convert = AccountKey20Convert; + type RelayChainNetworkId = PolkadotNetworkId; + type SelfParaId = ParachainInfo; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -549,6 +567,7 @@ construct_runtime! { Democracy: pallet_democracy::{Pallet, Storage, Config, Event, Call}, TokenFactory: token_factory::{Pallet, Call, Storage, Event}, XcmHandler: cumulus_pallet_xcm_handler::{Pallet, Call, Event, Origin}, + Xtransfer: xtransfer::{Pallet, Call, Storage, Event}, // The order matters here. Inherents will be included in the order specified here. // Concretely we need the author inherent to come after the parachain_upgrade inherent. AuthorInherent: author_inherent::{Pallet, Call, Storage, Inherent}, From df3a9253ecbb4686b92311b16e1fe074e03be78f Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Tue, 30 Mar 2021 13:37:45 -0700 Subject: [PATCH 09/11] polkadot launch testst --- tools/config_xcmp.json | 63 +++++++++++++ tools/moonbeam-xcmp.ts | 210 +++++++++++++++++++++++++++++++++++++++++ tools/package.json | 1 + 3 files changed, 274 insertions(+) create mode 100644 tools/config_xcmp.json create mode 100644 tools/moonbeam-xcmp.ts diff --git a/tools/config_xcmp.json b/tools/config_xcmp.json new file mode 100644 index 0000000000..e791238adc --- /dev/null +++ b/tools/config_xcmp.json @@ -0,0 +1,63 @@ +{ + "relaychain": { + "bin": "../../polkadot/target/release/polkadot", + "chain": "rococo-local", + "nodes": [ + { + "name": "alice", + "wsPort": 36944, + "port": 36444 + }, + { + "name": "bob", + "wsPort": 36955, + "port": 36555 + }, + { + "name": "charlie", + "wsPort": 36956, + "port": 36556 + } + ] + }, + "parachains": [ + { + "bin": "../target/release/moonbeam", + "id": "200", + "rpcPort": 36846, + "wsPort": 36946, + "port": 36335, + "balance": "1000", + "chain": "local", + "flags": [ + "--no-telemetry", + "--no-prometheus", + "--author-id=6be02d1d3665660d22ff9624b7be0551ee1ac91b", + "--", + "--execution=wasm" + ] + }, + { + "bin": "../target/release/moonbeam", + "id": "201", + "rpcPort": 36847, + "wsPort": 36947, + "port": 36336, + "balance": "1000", + "chain": "local", + "flags": [ + "--no-telemetry", + "--no-prometheus", + "--author-id=6be02d1d3665660d22ff9624b7be0551ee1ac91b", + "--", + "--execution=wasm" + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "types": { + "Address": "MultiAddress", + "LookupSource": "MultiAddress" + } +} diff --git a/tools/moonbeam-xcmp.ts b/tools/moonbeam-xcmp.ts new file mode 100644 index 0000000000..6ca4c53d7c --- /dev/null +++ b/tools/moonbeam-xcmp.ts @@ -0,0 +1,210 @@ +import { ApiPromise, Keyring, WsProvider } from "@polkadot/api"; +import { start } from "polkadot-launch"; +import { typesBundle } from "../moonbeam-types-bundle"; + +// constants +const GERALD = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b"; +const GERALD_PRIVKEY = "0x99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342"; +const ALICE = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"; +const STAKING_AMOUNT = "1.0000 kUnit"; +const GLMR = 1_000_000_000_000_000_000n; +const MIN_GLMR_STAKING = 1000n * GLMR; +const MIN_GLMR_NOMINATOR = 5n * GLMR; +const DEFAULT_GENESIS_BALANCE = 2n ** 80n; +const DEFAULT_GENESIS_STAKING = 1_000n * GLMR; +const GENESIS_ACCOUNT_BALANCE = DEFAULT_GENESIS_BALANCE - DEFAULT_GENESIS_STAKING; + +interface HrmpChannelId { + sender: number; + recipient: number; +} + +function assert(condition: boolean, msg: string) { + if (!condition) throw new Error(msg); +} + +async function wait(duration: number) { + console.log(`Waiting ${duration / 1000} seconds`); + return new Promise((res) => { + setTimeout(res, duration); + }); +} + +async function parachain_api(PORT: number): Promise { + const url = `ws://localhost:${PORT}`; + const provider = new WsProvider(url); + const api = await ApiPromise.create({ + provider, + typesBundle: typesBundle as any, + }); + return api; +} + +async function relaychain_api(PORT: number): Promise { + const url = `ws://localhost:${PORT}`; + const provider = new WsProvider(url); + const api = await ApiPromise.create({ + provider, + types: { + Address: "MultiAddress", + LookupSource: "MultiAddress", + }, + }); + return api; +} + +async function test() { + await start("config_xcmp.json"); + console.log("moonbeam launch launched"); + const WS_PORT200 = 36946; + const WS_PORT201 = 36947; + const WS_RELAY_PORT = 36944; + // first Moonbeam Parachain with ID 200 + const moonbeam200 = await parachain_api(WS_PORT200); + // second Moonbeam Parachain with ID 201 + const moonbeam201 = await parachain_api(WS_PORT201); + // relay chain + const relayApi = await relaychain_api(WS_RELAY_PORT); + // sanity checks that genesis state for all chains meet expectations + const gerald200 = await moonbeam200.query.system.account(GERALD); + assert( + gerald200.data.free.toString() === GENESIS_ACCOUNT_BALANCE.toString(), + "wrong balance for Gerald, dif: " + + (Number(GENESIS_ACCOUNT_BALANCE) - Number(gerald200.data.free)) + ); + const gerald201 = await moonbeam201.query.system.account(GERALD); + assert( + gerald201.data.free.toString() === GENESIS_ACCOUNT_BALANCE.toString(), + "wrong balance for Gerald, dif: " + + (Number(GENESIS_ACCOUNT_BALANCE) - Number(gerald201.data.free)) + ); + const relayAlice = await relayApi.query.system.account(ALICE); + assert( + "1000000000000000000" === relayAlice.data.free.toString(), + "wrong balance for relayAlice, expected: 1000000000000000000, returned: " + + Number(relayAlice.data.free) + ); + console.log("++ Sanity Checks Passed for Relay Chain and Both Parachains"); + // Open channel using relay sudo as caller + const keyring = new Keyring({ type: "sr25519" }); + const alice = keyring.addFromUri("//Alice"); + const sender: number = 200; + const recipient: number = 201; + await new Promise(async (resolve) => { + const unsub = await relayApi.tx.sudo + .sudo(relayApi.tx.parasSudoWrapper.sudoEstablishHrmpChannel(sender, recipient, 8, 1024)) + .signAndSend(alice, {}, ({ events = [], status }) => { + console.log(`Current status is ${status}`); + if (status.isInBlock) { + console.log(`Transaction included at blockHash ${status.asInBlock}`); + } else if (status.isFinalized) { + console.log(`Transaction finalized at blockHash ${status.asFinalized}`); + // Loop through Vec to display all events + events.forEach(({ phase, event: { data, method, section } }) => { + console.log(`\t' ${phase}: ${section}.${method}:: ${data}`); + }); + unsub(); + resolve(); + } + }); + }); + console.log("api call resolved"); + // Check that relay chain persists storage changes (registers the necessary channel) + const channelID: HrmpChannelId = { sender, recipient }; + // @ts-ignore + const expectedChannel = await relayApi.query.hrmp.hrmpChannels(channelID); + // const expectedChannel = await relayApi.query.hrmp.hrmpChannels(sender, recipient); + console.log("expectedchannel", expectedChannel, expectedChannel.toHuman()); + assert(expectedChannel !== undefined, "Channel does not exist but we expected it to exist"); + // (2) TODO: check that channel deposits are reserved from sender and recipient + // HOW LONG TO WAIT UNTIL QUEUED DOWNWARD MESSAGES ARE RECEIVED BY PARARCHAIN + // await wait(50); + // (3) TODO: check that the downward message Xcm::HrmpNewChannelOpenRequest + // { sender, max_msg_size, max_capacity } + // was sent to the recipient parachain + // const recipientChannels = await moonbeam201.query.channels.recipientChannels(); + // console.log("recipientChannels", recipientChannels, recipientChannels.toHuman()); + // assert( + // recipientChannels[0] === sender, + // "Recipient channel with sender ID not yet opened on recipient chain" + // ); + // (4) TODO: check that the downward message Xcm::HrmpChannelAccepted { recipient } + // was sent to the sender parachain + // const senderChannels = await moonbeam200.query.channels.senderChannels(); + // console.log("senderChannels", senderChannels); + // assert( + // senderChannels[0] === recipient, + // "Sender channel with recipient ID not yet opened on sender chain" + // ); + // (5) Transfer from Sender to Recipient Parachain + // transfer_native_to_account20_parachain + const senderKeyring = new Keyring({ type: "ethereum" }); + const gerald = await senderKeyring.addFromUri(GERALD_PRIVKEY, null, "ethereum"); + await new Promise(async (resolve) => { + const unsub2 = await moonbeam200.tx.xtransfer + .transferNativeToAccount20Parachain(recipient, GERALD, 100000) + .signAndSend(gerald, ({ events = [], status }) => { + console.log(`Current status is ${status.type}`); + + if (status.isFinalized) { + console.log(`Transaction finalized at blockHash ${status.asFinalized}`); + + // Loopcod through Vec to display all events + events.forEach(({ phase, event: { data, method, section } }) => { + console.log(`\t' ${phase}: ${section}.${method}:: ${data}`); + }); + + unsub2(); + resolve(); + } + }); + }); + // check to see if message is received on the recipient chain + // check to see if account balance changes on sender chain + // check to see if account balance changes on recipient chain + // (6) Test transfer in the opposite direction, register a new channel first and etc + // const sender2: number = recipient; + // const recipient2: number = sender; + // const unsub3 = await relayApi.tx.sudo + // .sudo(relayApi.tx.parasSudoWrapper.sudoEstablishHrmpChannel(sender2, recipient2, 8, 1024)) + // .signAndSend(alice, {}, (result) => { + // console.log(`Current status is ${result.status}`); + // if (result.status.isInBlock) { + // console.log(`Transaction included at blockHash ${result.status.asInBlock}`); + // } else if (result.status.isFinalized) { + // console.log(`Transaction finalized at blockHash ${result.status.asFinalized}`); + // unsub3(); + // } + // }); + console.log("all tests passed"); +} +test(); + +// construct Transact code to request open channel from 200 -> 201 +// const rawOpenCode = relayApi.tx.hrmp.hrmpInitOpenChannel(201, 8, 1024); +// console.log(rawOpenCode.toHex()); +// const rawParaCallTest = moonbeam200.tx.parachainStaking.leaveNominators(); +// console.log(rawParaCallTest.toHex()); +// remove prefix 31c04 +// const openCode = "0x1600c90000000800000000040000"; +// // Send message from 200 to relay to request open channel from 200 -> 201 +// const keyring = new Keyring({ type: "ethereum" }); +// const gerald = await keyring.addFromUri(GERALD_PRIVKEY, null, "ethereum"); +// const unsub = await moonbeam200.tx.xtransfer +// .openChannel(201, openCode) +// .signAndSend(gerald, ({ events = [], status }) => { +// console.log(`Current status is ${status.type}`); + +// if (status.isFinalized) { +// console.log(`Transaction finalized at blockHash ${status.asFinalized}`); + +// // Loopcod through Vec to display all events +// events.forEach(({ phase, event: { data, method, section } }) => { +// console.log(`\t' ${phase}: ${section}.${method}:: ${data}`); +// }); + +// unsub(); +// } +// }); +// Send message from 201 to relay to accept channel request from 200 -> 201 +// Transfer Moonbeam from 200 to 201 diff --git a/tools/package.json b/tools/package.json index 8a3d97f5d6..69e44b7fba 100644 --- a/tools/package.json +++ b/tools/package.json @@ -28,6 +28,7 @@ "build-moonbeam-launch": "yarn add PureStake/polkadot-launch#moonbeam-launch", "moonbeam-launch": "yarn run build-moonbeam-launch && mkdir -p specFiles && ts-node moonbeam-launch.ts", "moonbeam-test": "yarn run build-moonbeam-launch && mkdir -p specFiles && ts-node moonbeam-test.ts", + "moonbeam-xcmp": "yarn run build-moonbeam-launch && mkdir -p specFiles && ts-node moonbeam-xcmp.ts", "test-staking": "yarn run build-moonbeam-launch && mkdir -p specFiles && ts-node test-staking.ts" } } From da4c601cb5eeae9ea0e09a4c037a6441844ffc88 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Wed, 7 Apr 2021 11:37:55 -0700 Subject: [PATCH 10/11] try to test parachain registration --- tools/moonbeam-xcmp.ts | 7 + tools/yarn.lock | 307 ++++++++++++----------------------------- 2 files changed, 93 insertions(+), 221 deletions(-) diff --git a/tools/moonbeam-xcmp.ts b/tools/moonbeam-xcmp.ts index 6ca4c53d7c..6602a15ee5 100644 --- a/tools/moonbeam-xcmp.ts +++ b/tools/moonbeam-xcmp.ts @@ -84,6 +84,13 @@ async function test() { "wrong balance for relayAlice, expected: 1000000000000000000, returned: " + Number(relayAlice.data.free) ); + // ensure both parachains are registered on the relay chain + const dummyDead = await relayApi.query.paras.paraLifecycles(199); + assert(dummyDead === undefined, "Expected no parachain registered found Some"); + const senderAlive = await relayApi.query.paras.paraLifecycles(200); + assert(senderAlive !== undefined, "Expected some parachain registered found None"); + const recipientAlive = await relayApi.query.paras.paraLifecycles(201); + assert(recipientAlive !== undefined, "Expected some parachain registered found None"); console.log("++ Sanity Checks Passed for Relay Chain and Both Parachains"); // Open channel using relay sudo as caller const keyring = new Keyring({ type: "sr25519" }); diff --git a/tools/yarn.lock b/tools/yarn.lock index 8e59249e5e..19a1ee48de 100644 --- a/tools/yarn.lock +++ b/tools/yarn.lock @@ -118,7 +118,7 @@ babel-plugin-polyfill-regenerator "^0.1.2" semver "^6.3.0" -"@babel/runtime@^7.13.7", "@babel/runtime@^7.13.8", "@babel/runtime@^7.13.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.13.10", "@babel/runtime@^7.13.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.9.2": version "7.13.10" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d" integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw== @@ -358,20 +358,6 @@ "@nodelib/fs.scandir" "2.1.4" fastq "^1.6.0" -"@polkadot/api-derive@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-3.11.1.tgz#3f0d6804ca2ade80da100314d576534490db5727" - integrity sha512-/v/fNSivgucQrDJvwLU17u8iZ0oQipQzgpofCJGQhRv8OaSv/E9g5EXcHJ1ri/Ozevgu5cPmGs96lLkQaPieAw== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/api" "3.11.1" - "@polkadot/rpc-core" "3.11.1" - "@polkadot/types" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - "@polkadot/x-rxjs" "^5.9.2" - bn.js "^4.11.9" - "@polkadot/api-derive@4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-4.0.3.tgz#542d871d84c64f927565d655eabce0ec2b917a4a" @@ -386,24 +372,19 @@ "@polkadot/x-rxjs" "^6.0.5" bn.js "^4.11.9" -"@polkadot/api@3.11.1", "@polkadot/api@^3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-3.11.1.tgz#854ee9686942a4be736932d61bf7ddb1242a0966" - integrity sha512-VqEh2n13ESLxnTUKujUfZ3Spct+lTycNgrX+IWD7/f05GsMwhCZLYtt708K8nqGFH2OKDl8xzwuGCvRN/05U1Q== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/api-derive" "3.11.1" - "@polkadot/keyring" "^5.9.2" - "@polkadot/metadata" "3.11.1" - "@polkadot/rpc-core" "3.11.1" - "@polkadot/rpc-provider" "3.11.1" - "@polkadot/types" "3.11.1" - "@polkadot/types-known" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - "@polkadot/x-rxjs" "^5.9.2" +"@polkadot/api-derive@4.4.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-4.4.1.tgz#2e3a26b59573a04c18e05b85e0b8a951a7f970b0" + integrity sha512-N+U4S2zT4W9UNaJpOlEn8kvUnchiqvfYXnD1CXhxbn8yLo3jMW/WNJ8KksxxW2jg3RGW24slYVARvYFHBrlFYQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@polkadot/api" "4.4.1" + "@polkadot/rpc-core" "4.4.1" + "@polkadot/types" "4.4.1" + "@polkadot/util" "^6.0.5" + "@polkadot/util-crypto" "^6.0.5" + "@polkadot/x-rxjs" "^6.0.5" bn.js "^4.11.9" - eventemitter3 "^4.0.7" "@polkadot/api@4.0.3", "@polkadot/api@^4.0.3": version "4.0.3" @@ -424,14 +405,24 @@ bn.js "^4.11.9" eventemitter3 "^4.0.7" -"@polkadot/keyring@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-5.9.2.tgz#f8011a524767bb8f000bec3e26178fc5feffae5b" - integrity sha512-h9AhrzyUmludbmo0ixRFLEyRJvUc7GTl5koSBrG0uv+9Yn0I/7YRgAKn3zKcUVZyvgoLvzZnBFwekGbdFcl9Yg== +"@polkadot/api@4.4.1", "@polkadot/api@^4.2.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-4.4.1.tgz#7f5e9bdafce53e34505875183c9cbcdd966a6e8b" + integrity sha512-r/zpFYVebp6TYE5SjEH9eYNFQEq4IzNYM6rM65d0nPCbXFVmpzY5hsqPUhiRL6+drdhEO47pgxAow+60Pdx1fg== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/util" "5.9.2" - "@polkadot/util-crypto" "5.9.2" + "@babel/runtime" "^7.13.10" + "@polkadot/api-derive" "4.4.1" + "@polkadot/keyring" "^6.0.5" + "@polkadot/metadata" "4.4.1" + "@polkadot/rpc-core" "4.4.1" + "@polkadot/rpc-provider" "4.4.1" + "@polkadot/types" "4.4.1" + "@polkadot/types-known" "4.4.1" + "@polkadot/util" "^6.0.5" + "@polkadot/util-crypto" "^6.0.5" + "@polkadot/x-rxjs" "^6.0.5" + bn.js "^4.11.9" + eventemitter3 "^4.0.7" "@polkadot/keyring@^6.0.5": version "6.0.5" @@ -442,18 +433,6 @@ "@polkadot/util" "6.0.5" "@polkadot/util-crypto" "6.0.5" -"@polkadot/metadata@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-3.11.1.tgz#c3e9645f6f78c8e02e0da695f3718b9d69f450a8" - integrity sha512-Z3KtOTX2kU+vvbRDiGY+qyPpF/4xTpnUipoNGijIGQ/EWWcgrm8sSgPzZQhHCfgIqM+jq3g9GvPMYeQp2Yy3ng== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/types" "3.11.1" - "@polkadot/types-known" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - bn.js "^4.11.9" - "@polkadot/metadata@4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-4.0.3.tgz#f0c7b63f8d0f40d8f81218849613f35edcb8157b" @@ -466,12 +445,17 @@ "@polkadot/util-crypto" "^6.0.5" bn.js "^4.11.9" -"@polkadot/networks@5.9.2", "@polkadot/networks@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-5.9.2.tgz#c687525b5886c9418f75240afe22b562ed88e2dd" - integrity sha512-JQyXJDJTZKQtn8y3HBHWDhiBfijhpiXjVEhY+fKvFcQ82TaKmzhnipYX0EdBoopZbuxpn/BJy6Y1Y/3y85EC+g== +"@polkadot/metadata@4.4.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-4.4.1.tgz#aeecee93f0c63183dddd4a4f4f987cd3ebacf085" + integrity sha512-rkOaB90BkYvWLc1gKfY4/hGtXriWi/8LmopDV241on9ED5q8gvD5gX8gamrHeK7p0IDvUELkP35/0zyKpK2ihw== dependencies: - "@babel/runtime" "^7.13.8" + "@babel/runtime" "^7.13.10" + "@polkadot/types" "4.4.1" + "@polkadot/types-known" "4.4.1" + "@polkadot/util" "^6.0.5" + "@polkadot/util-crypto" "^6.0.5" + bn.js "^4.11.9" "@polkadot/networks@6.0.5", "@polkadot/networks@^6.0.5": version "6.0.5" @@ -480,18 +464,6 @@ dependencies: "@babel/runtime" "^7.13.9" -"@polkadot/rpc-core@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-3.11.1.tgz#fc57ac6429fd0322ac8421f434868cd244ede86f" - integrity sha512-8KTEZ/c2/TrsTOrrqxxNbyjO5P/033R/yTDgwqL0gwmF+ApnH3vB65YfKqaxn+rBWOMQS0jQhF6KZdtXvRcuYg== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/metadata" "3.11.1" - "@polkadot/rpc-provider" "3.11.1" - "@polkadot/types" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/x-rxjs" "^5.9.2" - "@polkadot/rpc-core@4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-4.0.3.tgz#40046acd961d925ef69532694f48437c7bceef0c" @@ -504,20 +476,17 @@ "@polkadot/util" "^6.0.5" "@polkadot/x-rxjs" "^6.0.5" -"@polkadot/rpc-provider@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-3.11.1.tgz#d4ee901f464211b3b03607615a6db208ef186213" - integrity sha512-5OKh3rAg8l10M+tGLCoxhEoH9uEtK0ehJfOHUmdtwmwIk5aBFZ/ZTeiDkPM+/l84PCzYmp2uzO+YNsyMWUoVLw== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/types" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - "@polkadot/x-fetch" "^5.9.2" - "@polkadot/x-global" "^5.9.2" - "@polkadot/x-ws" "^5.9.2" - bn.js "^4.11.9" - eventemitter3 "^4.0.7" +"@polkadot/rpc-core@4.4.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-4.4.1.tgz#bf010efa0bafb4b353db10067b945457ba3852eb" + integrity sha512-tDN6qt0LYbslHVS4iTlssNaqv5Zepe9do0Edew6oa7b4wAr5zmXbsyhlVQFgaPvi/whNjpcyRF2ZYxhGbEkd6Q== + dependencies: + "@babel/runtime" "^7.13.10" + "@polkadot/metadata" "4.4.1" + "@polkadot/rpc-provider" "4.4.1" + "@polkadot/types" "4.4.1" + "@polkadot/util" "^6.0.5" + "@polkadot/x-rxjs" "^6.0.5" "@polkadot/rpc-provider@4.0.3": version "4.0.3" @@ -534,16 +503,20 @@ bn.js "^4.11.9" eventemitter3 "^4.0.7" -"@polkadot/types-known@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-3.11.1.tgz#f695c9155fa54eeed95cea179bb8cb2398726bd3" - integrity sha512-ImAxyCdqblmlXaMlgvuXZ6wzZgOYgE40FgWaYRJpFXRGJLDwtcJcpVI+7m/ns5dJ3WujboEMOHVR1HPpquw8Jw== +"@polkadot/rpc-provider@4.4.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-4.4.1.tgz#c60e27253dc0be7c6361ae63e10ac77795588e74" + integrity sha512-6v4iAkFzbeCLaCBvsTVTSyCy+Fp7AzMKySpdB4g/+MG8dupqts5f2BDmlnMFHBlNBDantVpJoMTvfvLfLxJz7g== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/networks" "^5.9.2" - "@polkadot/types" "3.11.1" - "@polkadot/util" "^5.9.2" + "@babel/runtime" "^7.13.10" + "@polkadot/types" "4.4.1" + "@polkadot/util" "^6.0.5" + "@polkadot/util-crypto" "^6.0.5" + "@polkadot/x-fetch" "^6.0.5" + "@polkadot/x-global" "^6.0.5" + "@polkadot/x-ws" "^6.0.5" bn.js "^4.11.9" + eventemitter3 "^4.0.7" "@polkadot/types-known@4.0.3": version "4.0.3" @@ -556,17 +529,15 @@ "@polkadot/util" "^6.0.5" bn.js "^4.11.9" -"@polkadot/types@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-3.11.1.tgz#c0188390dfda84d746d57f7818ad622ac6b1de8b" - integrity sha512-+BWsmveYVkLFx/csvPmU+NhNFhf+0srAt2d0f+7y663nitc/sng1AcEDPbrbXHSQVyPdvI20Mh4Escl4aR+TLw== +"@polkadot/types-known@4.4.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-4.4.1.tgz#dfd7e9bb8cafd50fb1438270f0310fbdf78c978d" + integrity sha512-JPRqRnwxTweDZMWVg+vjFLK2xB3dsJsBUcUGoL96KH8klywk5m07JueRYdNuWhnZ77OloSo+0FvLWC83oBhBfg== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/metadata" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - "@polkadot/x-rxjs" "^5.9.2" - "@types/bn.js" "^4.11.6" + "@babel/runtime" "^7.13.10" + "@polkadot/networks" "^6.0.5" + "@polkadot/types" "4.4.1" + "@polkadot/util" "^6.0.5" bn.js "^4.11.9" "@polkadot/types@4.0.3": @@ -582,27 +553,18 @@ "@types/bn.js" "^4.11.6" bn.js "^4.11.9" -"@polkadot/util-crypto@5.9.2", "@polkadot/util-crypto@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-5.9.2.tgz#3858cfffe7732458b4a2b38ece01eaf52a3746c2" - integrity sha512-d8CW2grI3gWi6d/brmcZQWaMPHqQq5z7VcM74/v8D2KZ+hPYL3B0Jn8zGL1vtgMz2qdpWrZdAe89LBC8BvM9bw== +"@polkadot/types@4.4.1": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-4.4.1.tgz#85bdbdd965e33e2832bf77e7ffc5741e513938f7" + integrity sha512-sP0yqAKmv4WcFYX3fGdZ2xFaLAo1dcTY9gSL4twnG1TYBh1FT9fTux1d0d46VSPM6/+fbTV/HSIBa6wSETRHUQ== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/networks" "5.9.2" - "@polkadot/util" "5.9.2" - "@polkadot/wasm-crypto" "^3.2.4" - "@polkadot/x-randomvalues" "5.9.2" - base-x "^3.0.8" - base64-js "^1.5.1" - blakejs "^1.1.0" + "@babel/runtime" "^7.13.10" + "@polkadot/metadata" "4.4.1" + "@polkadot/util" "^6.0.5" + "@polkadot/util-crypto" "^6.0.5" + "@polkadot/x-rxjs" "^6.0.5" + "@types/bn.js" "^4.11.6" bn.js "^4.11.9" - create-hash "^1.2.0" - elliptic "^6.5.4" - hash.js "^1.1.7" - js-sha3 "^0.8.0" - scryptsy "^2.1.0" - tweetnacl "^1.0.3" - xxhashjs "^0.2.2" "@polkadot/util-crypto@6.0.5", "@polkadot/util-crypto@^6.0.5": version "6.0.5" @@ -626,19 +588,6 @@ tweetnacl "^1.0.3" xxhashjs "^0.2.2" -"@polkadot/util@5.9.2", "@polkadot/util@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-5.9.2.tgz#ad2494e78ca6c3aadd6fb394a6be55020dc9b2a8" - integrity sha512-p225NJusnXeu7i2iAb8HAGWiMOUAnRaIyblIjJ4F89ZFZZ4amyliGxe5gKcyjRgxAJ44WdKyBLl/8L3rNv8hmQ== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-textdecoder" "5.9.2" - "@polkadot/x-textencoder" "5.9.2" - "@types/bn.js" "^4.11.6" - bn.js "^4.11.9" - camelcase "^5.3.1" - ip-regex "^4.3.0" - "@polkadot/util@6.0.5", "@polkadot/util@^6.0.5": version "6.0.5" resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-6.0.5.tgz#aa52995d3fe998eed218d26b243832a7a3e2944d" @@ -652,13 +601,6 @@ camelcase "^5.3.1" ip-regex "^4.3.0" -"@polkadot/wasm-crypto-asmjs@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-3.2.4.tgz#837f5b723161b21670d13779eff4c061f7947577" - integrity sha512-fgN26iL+Pbb35OYsDIRHC74Xnwde+A5u3OjEcQ9zJhM391eOTuKsQ2gyC9TLNAKqeYH8pxsa27yjRO71We7FUA== - dependencies: - "@babel/runtime" "^7.13.7" - "@polkadot/wasm-crypto-asmjs@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.0.2.tgz#f42c353a64e1243841daf90e4bd54eff01a4e3cf" @@ -666,13 +608,6 @@ dependencies: "@babel/runtime" "^7.13.9" -"@polkadot/wasm-crypto-wasm@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-3.2.4.tgz#70885e06a813af91d81cf7e8ff826976fa99a38b" - integrity sha512-Q/3IEpoo7vkTzg40GxehRK000A9oBgjbh/uWCNQ8cMqWLYYCfzZy4NIzw8szpxNiSiGfGL0iZlP4ZSx2ZqEe2g== - dependencies: - "@babel/runtime" "^7.13.7" - "@polkadot/wasm-crypto-wasm@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.0.2.tgz#89f9e0a1e4d076784d4a42bea37fc8b06bdd8bb6" @@ -680,15 +615,6 @@ dependencies: "@babel/runtime" "^7.13.9" -"@polkadot/wasm-crypto@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-3.2.4.tgz#c3e23ff728c1d5701215ae15ecdc605e96901989" - integrity sha512-poeRU91zzZza0ZectT63vBiAqh6DsHCyd3Ogx1U6jsYiRa0yuECMWJx1onvnseDW4tIqsC8vZ/9xHXWwhjTAVg== - dependencies: - "@babel/runtime" "^7.13.7" - "@polkadot/wasm-crypto-asmjs" "^3.2.4" - "@polkadot/wasm-crypto-wasm" "^3.2.4" - "@polkadot/wasm-crypto@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-4.0.2.tgz#9649057adee8383cc86433d107ba526b718c5a3b" @@ -698,16 +624,6 @@ "@polkadot/wasm-crypto-asmjs" "^4.0.2" "@polkadot/wasm-crypto-wasm" "^4.0.2" -"@polkadot/x-fetch@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-5.9.2.tgz#0ec2b00bd253b896f7e435dfba34ebac914269e1" - integrity sha512-Nx7GfyOmMdqn5EX+wf6PnIwleQX+aGqzdbYhozNLF54IoNFLHLOs6hCYnBlKbmM1WyukMZMjg2YxyZRQWcHKPQ== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" - "@types/node-fetch" "^2.5.8" - node-fetch "^2.6.1" - "@polkadot/x-fetch@^6.0.5": version "6.0.5" resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-6.0.5.tgz#b6c90c478f9951ab1f9c835d48869c669c45120e" @@ -718,15 +634,6 @@ "@types/node-fetch" "^2.5.8" node-fetch "^2.6.1" -"@polkadot/x-global@5.9.2", "@polkadot/x-global@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-5.9.2.tgz#e223d59536d168c7cbc49fc3a2052cbd71bd7256" - integrity sha512-wpY6IAOZMGiJQa8YMm7NeTLi9bwnqqVauR+v7HwyrssnGPuYX8heb6BQLOnnnPh/EK0+M8zNtwRBU48ez0/HOg== - dependencies: - "@babel/runtime" "^7.13.8" - "@types/node-fetch" "^2.5.8" - node-fetch "^2.6.1" - "@polkadot/x-global@6.0.5", "@polkadot/x-global@^6.0.5": version "6.0.5" resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-6.0.5.tgz#eb2a0980e4c2012f251e7b61832e185f5037ae80" @@ -736,14 +643,6 @@ "@types/node-fetch" "^2.5.8" node-fetch "^2.6.1" -"@polkadot/x-randomvalues@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-5.9.2.tgz#563a76550f94107ce5a37c462ed067dc040626b1" - integrity sha512-Zv+eXSP3oBImMnB82y05Doo0A96WUFsQDbnLHI3jFHioIg848cL0nndB9TgBwPaFkZ2oiwoHEC8yxqNI6/jkzQ== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" - "@polkadot/x-randomvalues@6.0.5": version "6.0.5" resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-6.0.5.tgz#32aa5e670acf3ab13af281f9c0871c279de24b0a" @@ -752,14 +651,6 @@ "@babel/runtime" "^7.13.9" "@polkadot/x-global" "6.0.5" -"@polkadot/x-rxjs@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-5.9.2.tgz#925b7c3325678b137ca30af6a726b22c5e8f9125" - integrity sha512-cuF4schclspOfAqEPvbcA3aQ9d3TBy2ORZ8YehxD0ZSHWJNhefHDIUDgS5T3NtPhSKgcEmSlI5TfVfgGFxgVMg== - dependencies: - "@babel/runtime" "^7.13.8" - rxjs "^6.6.6" - "@polkadot/x-rxjs@^6.0.5": version "6.0.5" resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-6.0.5.tgz#829b12f225a4252ae16e405fe7876cce390eabd6" @@ -768,14 +659,6 @@ "@babel/runtime" "^7.13.9" rxjs "^6.6.6" -"@polkadot/x-textdecoder@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-5.9.2.tgz#2e69922acc426f91adc2629fea362e41c9035f25" - integrity sha512-MCkgITwGY3tG0UleDkBJEoiKGk/YWYwMM5OR6fNo07RymHRtJ8OLJC+Sej9QD05yz6TIhFaaRRYzmtungIcwTw== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" - "@polkadot/x-textdecoder@6.0.5": version "6.0.5" resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-6.0.5.tgz#919a8991c9e81610a3c4f6bf314331071f2f8345" @@ -784,14 +667,6 @@ "@babel/runtime" "^7.13.9" "@polkadot/x-global" "6.0.5" -"@polkadot/x-textencoder@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-5.9.2.tgz#67362e64bacfe6ff4eec73bf596873a2f9d9f36d" - integrity sha512-IjdLY3xy0nUfps1Bdi0tRxAX7X081YyoiSWExwqUkChdcYGMqMe3T2wqrrt9qBr2IkW8O/tlfYBiZXdII0YCcw== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" - "@polkadot/x-textencoder@6.0.5": version "6.0.5" resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-6.0.5.tgz#fc851259de97a98f3417e51807c1f5ebe265fdf0" @@ -800,16 +675,6 @@ "@babel/runtime" "^7.13.9" "@polkadot/x-global" "6.0.5" -"@polkadot/x-ws@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-5.9.2.tgz#294f226be5ef07363426b8cf2729cba12d9637e5" - integrity sha512-6A/cteC0B3hm64/xG6DNG8qGsHAXJgAy9wjcB38qnoJGYl12hysIFjPeHD+V0W/LOl9payW6kpZzhisLlVOZpQ== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" - "@types/websocket" "^1.0.1" - websocket "^1.0.33" - "@polkadot/x-ws@^6.0.5": version "6.0.5" resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-6.0.5.tgz#bafab6004d88d9273478332a3a040bfef3647619" @@ -898,7 +763,7 @@ dependencies: "@types/node" "*" -"@types/websocket@^1.0.1", "@types/websocket@^1.0.2": +"@types/websocket@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.2.tgz#d2855c6a312b7da73ed16ba6781815bf30c6187a" integrity sha512-B5m9aq7cbbD/5/jThEr33nUY8WEfVi6A2YKCTOvw5Ldy7mtsOkqRvGjnzy6g7iMMDsgu7xREuCzqATLDLQVKcQ== @@ -4112,11 +3977,11 @@ pkg@^4.4.9: polkadot-launch@PureStake/polkadot-launch#moonbeam-launch: version "1.0.12" - resolved "https://codeload.github.com/PureStake/polkadot-launch/tar.gz/077ecbe74d0ebc30d337ce98429e1306d87ac04c" + resolved "https://codeload.github.com/PureStake/polkadot-launch/tar.gz/c4eea0a021cd75afc9f3bbc9e4a580e473e5e3ed" dependencies: - "@polkadot/api" "^3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" + "@polkadot/api" "^4.2.1" + "@polkadot/util" "^6.0.5" + "@polkadot/util-crypto" "^6.0.5" "@types/chai" "^4.2.14" "@types/mocha" "^8.2.0" chai "^4.2.0" From 2e185965bd268247aaf2ca410d2ca13511c1bcb4 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Wed, 7 Apr 2021 11:51:24 -0700 Subject: [PATCH 11/11] fix tests to show that channel is not opened successfully --- tools/moonbeam-xcmp.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/moonbeam-xcmp.ts b/tools/moonbeam-xcmp.ts index 6602a15ee5..d411410b74 100644 --- a/tools/moonbeam-xcmp.ts +++ b/tools/moonbeam-xcmp.ts @@ -86,11 +86,11 @@ async function test() { ); // ensure both parachains are registered on the relay chain const dummyDead = await relayApi.query.paras.paraLifecycles(199); - assert(dummyDead === undefined, "Expected no parachain registered found Some"); + assert(dummyDead.toHuman() === null, "Expected no parachain registered found Some"); const senderAlive = await relayApi.query.paras.paraLifecycles(200); - assert(senderAlive !== undefined, "Expected some parachain registered found None"); + assert(senderAlive !== null, "Expected some parachain registered found None"); const recipientAlive = await relayApi.query.paras.paraLifecycles(201); - assert(recipientAlive !== undefined, "Expected some parachain registered found None"); + assert(recipientAlive !== null, "Expected some parachain registered found None"); console.log("++ Sanity Checks Passed for Relay Chain and Both Parachains"); // Open channel using relay sudo as caller const keyring = new Keyring({ type: "sr25519" }); @@ -120,9 +120,7 @@ async function test() { const channelID: HrmpChannelId = { sender, recipient }; // @ts-ignore const expectedChannel = await relayApi.query.hrmp.hrmpChannels(channelID); - // const expectedChannel = await relayApi.query.hrmp.hrmpChannels(sender, recipient); - console.log("expectedchannel", expectedChannel, expectedChannel.toHuman()); - assert(expectedChannel !== undefined, "Channel does not exist but we expected it to exist"); + assert(expectedChannel.toHuman() !== null, "Channel does not exist but we expected it to exist"); // (2) TODO: check that channel deposits are reserved from sender and recipient // HOW LONG TO WAIT UNTIL QUEUED DOWNWARD MESSAGES ARE RECEIVED BY PARARCHAIN // await wait(50);