diff --git a/Cargo.lock b/Cargo.lock index 3b99ac1256..e94b5dadd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,6 +197,7 @@ dependencies = [ "cfg-primitives", "cfg-traits", "cfg-types", + "chainbridge", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -215,6 +216,8 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", + "getrandom 0.2.10", + "hex", "hex-literal 0.3.4", "liquidity-pools-gateway-routers", "log", @@ -232,6 +235,8 @@ dependencies = [ "pallet-balances", "pallet-base-fee", "pallet-block-rewards", + "pallet-bridge", + "pallet-claims", "pallet-collator-allowlist", "pallet-collator-selection", "pallet-collective", @@ -244,7 +249,6 @@ dependencies = [ "pallet-ethereum-transaction", "pallet-evm", "pallet-evm-chain-id", - "pallet-evm-precompile-dispatch", "pallet-fees", "pallet-foreign-investments", "pallet-identity", @@ -258,6 +262,7 @@ dependencies = [ "pallet-membership", "pallet-migration-manager", "pallet-multisig", + "pallet-nft", "pallet-nft-sales", "pallet-order-book", "pallet-permissions", @@ -269,9 +274,11 @@ dependencies = [ "pallet-rewards", "pallet-scheduler", "pallet-session", + "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-transfer-allowlist", "pallet-treasury", "pallet-uniques", "pallet-utility", @@ -290,6 +297,7 @@ dependencies = [ "sp-consensus-aura", "sp-core", "sp-inherents", + "sp-io", "sp-offchain", "sp-runtime", "sp-session", @@ -1086,7 +1094,6 @@ dependencies = [ "polkadot-primitives", "polkadot-service", "runtime-common", - "runtime-integration-tests", "sc-basic-authorship", "sc-chain-spec", "sc-cli", @@ -1157,6 +1164,8 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", + "getrandom 0.2.10", + "hex", "hex-literal 0.3.4", "liquidity-pools-gateway-routers", "log", @@ -1188,7 +1197,6 @@ dependencies = [ "pallet-ethereum-transaction", "pallet-evm", "pallet-evm-chain-id", - "pallet-evm-precompile-dispatch", "pallet-fees", "pallet-foreign-investments", "pallet-identity", @@ -1203,6 +1211,7 @@ dependencies = [ "pallet-migration-manager", "pallet-multisig", "pallet-nft", + "pallet-nft-sales", "pallet-order-book", "pallet-permissions", "pallet-pool-registry", @@ -1213,9 +1222,11 @@ dependencies = [ "pallet-rewards", "pallet-scheduler", "pallet-session", + "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-transfer-allowlist", "pallet-treasury", "pallet-uniques", "pallet-utility", @@ -2792,7 +2803,6 @@ dependencies = [ "pallet-ethereum-transaction", "pallet-evm", "pallet-evm-chain-id", - "pallet-evm-precompile-dispatch", "pallet-fees", "pallet-foreign-investments", "pallet-identity", @@ -4211,7 +4221,6 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-inprocess-interface", - "frame-benchmarking", "frame-support", "frame-system", "fudge-companion", @@ -11379,7 +11388,12 @@ dependencies = [ "cfg-traits", "cfg-types", "cfg-utils", - "fp-self-contained", + "chainbridge", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", "frame-support", "frame-system", "hex-literal 0.3.4", @@ -11388,13 +11402,26 @@ dependencies = [ "orml-oracle", "orml-tokens", "orml-traits", + "orml-xcm", + "orml-xtokens", "pallet-anchors", + "pallet-aura", "pallet-authorship", "pallet-balances", "pallet-base-fee", + "pallet-block-rewards", + "pallet-bridge", + "pallet-claims", + "pallet-collator-allowlist", + "pallet-collator-selection", "pallet-collective", + "pallet-crowdloan-claim", + "pallet-crowdloan-reward", "pallet-data-collector", + "pallet-democracy", + "pallet-elections-phragmen", "pallet-ethereum", + "pallet-ethereum-transaction", "pallet-evm", "pallet-evm-chain-id", "pallet-evm-precompile-blake2", @@ -11403,13 +11430,41 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", + "pallet-fees", + "pallet-foreign-investments", + "pallet-identity", + "pallet-interest-accrual", "pallet-investments", + "pallet-keystore", "pallet-liquidity-pools", "pallet-liquidity-pools-gateway", + "pallet-liquidity-rewards", "pallet-loans", + "pallet-membership", + "pallet-migration-manager", + "pallet-multisig", + "pallet-nft", + "pallet-nft-sales", + "pallet-order-book", + "pallet-permissions", + "pallet-pool-registry", "pallet-pool-system", + "pallet-preimage", + "pallet-proxy", "pallet-restricted-tokens", + "pallet-rewards", + "pallet-scheduler", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transfer-allowlist", "pallet-treasury", + "pallet-uniques", + "pallet-utility", + "pallet-vesting", + "pallet-xcm", + "pallet-xcm-transactor", "parachain-info", "parity-scale-codec 3.6.5", "polkadot-parachain", @@ -11438,7 +11493,12 @@ dependencies = [ "cfg-traits", "cfg-types", "cfg-utils", + "chainbridge", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-test-relay-sproof-builder", @@ -11446,7 +11506,6 @@ dependencies = [ "ethabi 16.0.0", "ethereum", "fp-self-contained", - "frame-benchmarking", "frame-support", "frame-system", "fudge", @@ -11461,40 +11520,64 @@ dependencies = [ "orml-oracle", "orml-tokens", "orml-traits", + "orml-xcm", "orml-xtokens", + "pallet-anchors", "pallet-aura", "pallet-authorship", "pallet-babe", "pallet-balances", - "pallet-beefy", + "pallet-base-fee", "pallet-block-rewards", + "pallet-bridge", + "pallet-claims", + "pallet-collator-allowlist", "pallet-collator-selection", "pallet-collective", + "pallet-crowdloan-claim", + "pallet-crowdloan-reward", + "pallet-data-collector", "pallet-democracy", + "pallet-elections-phragmen", "pallet-ethereum", "pallet-ethereum-transaction", "pallet-evm", "pallet-evm-chain-id", + "pallet-fees", "pallet-foreign-investments", "pallet-grandpa", + "pallet-identity", "pallet-im-online", + "pallet-interest-accrual", "pallet-investments", + "pallet-keystore", "pallet-liquidity-pools", "pallet-liquidity-pools-gateway", + "pallet-liquidity-rewards", "pallet-loans", - "pallet-message-queue", + "pallet-membership", + "pallet-migration-manager", + "pallet-multisig", + "pallet-nft", + "pallet-nft-sales", "pallet-order-book", "pallet-permissions", "pallet-pool-registry", "pallet-pool-system", "pallet-preimage", + "pallet-proxy", "pallet-restricted-tokens", "pallet-rewards", + "pallet-scheduler", "pallet-session", + "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", + "pallet-transfer-allowlist", "pallet-treasury", "pallet-uniques", + "pallet-utility", + "pallet-vesting", "pallet-xcm", "pallet-xcm-transactor", "parachain-info", diff --git a/Cargo.toml b/Cargo.toml index ee4e4fe92c..ae24600f11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,9 +70,203 @@ members = [ "runtime/integration-tests", ] +[workspace.package] +authors = ["Centrifuge "] +edition = "2021" +license = "LGPL-3.0" +homepage = "https://centrifuge.io/" +repository = "https://github.com/centrifuge/centrifuge-chain" +documentation = "https://reference.centrifuge.io/centrifuge_chain/index.html" + [workspace.dependencies] +hex-literal = { version = "0.3.4" } +hex = { version = "0.4.3", default_features = false } +smallvec = "1.6.1" +serde = { version = "1.0.119", features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } +log = "0.4" +getrandom = { version = "0.2", features = ["js"] } +static_assertions = "1.1.0" +lazy_static = "1.4.0" +thiserror = "1.0.30" +tokio = { version = "1.15", features = ["macros"] } +tracing-subscriber = "0.2" +ethabi = { version = "16.0", default-features = false } +ethereum = { version = "0.14.0", default-features = false } + +# Cumulus +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } + +pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } + +# Polkadot +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +rococo-runtime = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +kusama-runtime = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +polkadot-runtime = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } + +# Substrate +node-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sc-service = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sc-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sc-client-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sc-executor = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-consensus-babe = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-consensus-beefy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-consensus-slots = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +sp-tracing = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, features = [ + "tuples-96", +], branch = "polkadot-v0.9.43" } # Check when tuples-96 can be removed +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-babe = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-grandpa = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-im-online = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-identity = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, features = ["historical"], branch = "polkadot-v0.9.43" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } + +# Orml +orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } + +# Frontier +fp-rpc = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +fp-self-contained = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-base-fee = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-ethereum = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-evm-chain-id = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-evm-precompile-blake2 = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-evm-precompile-bn128 = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-evm-precompile-dispatch = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-evm-precompile-modexp = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-evm-precompile-sha3fips = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +pallet-evm-precompile-simple = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } + +# Moonbeam +moonbeam-relay-encoder = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } +xcm-primitives = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } +pallet-xcm-transactor = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } + +# Centrifuge organization +fudge = { git = "https://github.com/centrifuge/fudge", branch = "polkadot-v0.9.43" } +fudge-core = { git = "https://github.com/centrifuge/fudge", branch = "polkadot-v0.9.43" } +chainbridge = { git = "https://github.com/centrifuge/chainbridge-substrate.git", default-features = false, branch = "polkadot-v0.9.43" } + +# Foss3 mock-builder = { git = "https://github.com/foss3/runtime-pallet-library", branch = "polkadot-v0.9.43" } +# Centrifuge pallets +axelar-gateway-precompile = { path = "pallets/liquidity-pools-gateway/axelar-gateway-precompile", default-features = false } +liquidity-pools-gateway-routers = { path = "pallets/liquidity-pools-gateway/routers", default-features = false } +pallet-anchors = { path = "pallets/anchors", default-features = false } +pallet-block-rewards = { path = "pallets/block-rewards", default-features = false } +pallet-bridge = { path = "pallets/bridge", default-features = false } +pallet-claims = { path = "pallets/claims", default-features = false } +pallet-collator-allowlist = { path = "pallets/collator-allowlist", default-features = false } +pallet-crowdloan-claim = { path = "pallets/crowdloan-claim", default-features = false } +pallet-crowdloan-reward = { path = "pallets/crowdloan-reward", default-features = false } +pallet-data-collector = { path = "pallets/data-collector", default-features = false } +pallet-ethereum-transaction = { path = "pallets/ethereum-transaction", default-features = false } +pallet-fees = { path = "pallets/fees", default-features = false } +pallet-foreign-investments = { path = "pallets/foreign-investments", default-features = false } +pallet-interest-accrual = { path = "pallets/interest-accrual", default-features = false } +pallet-investments = { path = "pallets/investments", default-features = false } +pallet-keystore = { path = "pallets/keystore", default-features = false } +pallet-liquidity-pools = { path = "pallets/liquidity-pools", default-features = false } +pallet-liquidity-pools-gateway = { path = "pallets/liquidity-pools-gateway", default-features = false } +pallet-liquidity-rewards = { path = "pallets/liquidity-rewards", default-features = false } +pallet-loans = { path = "pallets/loans", default-features = false } +pallet-migration-manager = { path = "pallets/migration", default-features = false } +pallet-nft = { path = "pallets/nft", default-features = false } +pallet-nft-sales = { path = "pallets/nft-sales", default-features = false } +pallet-order-book = { path = "pallets/order-book", default-features = false } +pallet-permissions = { path = "pallets/permissions", default-features = false } +pallet-pool-registry = { path = "pallets/pool-registry", default-features = false } +pallet-pool-system = { path = "pallets/pool-system", default-features = false } +pallet-restricted-tokens = { path = "pallets/restricted-tokens", default-features = false } +pallet-rewards = { path = "pallets/rewards", default-features = false } +pallet-transfer-allowlist = { path = "pallets/transfer-allowlist", default-features = false } + +# Centrifuge libs +cfg-primitives = { path = "libs/primitives", default-features = false } +cfg-traits = { path = "libs/traits", default-features = false } +cfg-types = { path = "libs/types", default-features = false } +cfg-utils = { path = "libs/utils", default-features = false } +cfg-mocks = { path = "libs/mocks", default-features = false } + +# Centrifuge uuntimes +runtime-common = { path = "runtime/common", default-features = false } +development-runtime = { path = "runtime/development", default-features = false } +altair-runtime = { path = "runtime/altair", default-features = false } +centrifuge-runtime = { path = "runtime/centrifuge", default-features = false } + +# Build dependencies +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } + [dependencies] # third-party dependencies async-trait = "0.1" @@ -158,7 +352,7 @@ runtime-common = { path = "runtime/common" } frame-benchmarking = { git = "https://github.com/paritytech/substrate", optional = true, default-features = false, branch = "polkadot-v0.9.43" } frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", optional = true, default-features = false, branch = "polkadot-v0.9.43" } # integration testing -runtime-integration-tests = { path = "runtime/integration-tests", optional = true, default-features = false } +#runtime-integration-tests = { path = "runtime/integration-tests", optional = true, default-features = false } # xcm xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } @@ -222,7 +416,7 @@ std = [ "pallet-pool-system/std", "polkadot-primitives/std", "runtime-common/std", - "runtime-integration-tests/std", + #"runtime-integration-tests/std", "sc-executor/std", "sc-service/rocksdb", "serde/std", @@ -261,7 +455,7 @@ runtime-benchmarks = [ "polkadot-primitives/runtime-benchmarks", "polkadot-service/runtime-benchmarks", "runtime-common/runtime-benchmarks", - "runtime-integration-tests/runtime-benchmarks", + #"runtime-integration-tests/runtime-benchmarks", "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] @@ -291,7 +485,7 @@ fast-runtime = [ "altair-runtime/fast-runtime", "centrifuge-runtime/fast-runtime", "development-runtime/fast-runtime", - "runtime-integration-tests/fast-runtime", + #"runtime-integration-tests/fast-runtime", ] # diff --git a/runtime/altair/Cargo.toml b/runtime/altair/Cargo.toml index 1ce5bbbe50..94b46ff52e 100644 --- a/runtime/altair/Cargo.toml +++ b/runtime/altair/Cargo.toml @@ -1,179 +1,213 @@ [package] name = "altair-runtime" version = "0.10.34" -authors = ["Centrifuge "] -edition = "2021" build = "build.rs" -license = "LGPL-3.0" -homepage = "https://centrifuge.io/" -repository = "https://github.com/centrifuge/centrifuge-chain" +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +documentation.workspace = true [dependencies] -# third-party dependencies -codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] } -hex-literal = { version = "0.3.4", optional = true } -log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.119", optional = true } -static_assertions = "1.1.0" +codec = { package = "parity-scale-codec", workspace = true } +getrandom = { workspace = true } +hex = { workspace = true } +hex-literal = { workspace = true, optional = true } +log = { workspace = true } +scale-info = { workspace = true } +serde = { workspace = true, optional = true } +static_assertions = { workspace = true } -# parachain -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/cumulus", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-aura = { workspace = true } +sp-core = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } -# polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +frame-benchmarking = { workspace = true, optional = true } # For benchmarking +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-benchmarking = { workspace = true, optional = true } # For benchmarking +frame-system-rpc-runtime-api = { workspace = true } +frame-try-runtime = { workspace = true, optional = true } # For try-runtime -# primitives -sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-pallet-session-benchmarking = { workspace = true, optional = true } # For benchmarking +cumulus-primitives-core = { workspace = true } +cumulus-primitives-timestamp = { workspace = true } +cumulus-primitives-utility = { workspace = true } -# frame dependencies -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, features = [ - "tuples-96", -], branch = "polkadot-v0.9.43" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-identity = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, features = ["historical"], branch = "polkadot-v0.9.43" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +polkadot-parachain = { workspace = true } +polkadot-runtime-common = { workspace = true } -# orml pallets -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } +xcm-primitives = { workspace = true } -# frontier pallets -fp-rpc = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -fp-self-contained = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-base-fee = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-ethereum = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-chain-id = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-dispatch = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +orml-traits = { workspace = true } +orml-xcm-support = { workspace = true } -# our custom pallets -axelar-gateway-precompile = { path = "../../pallets/liquidity-pools-gateway/axelar-gateway-precompile", default-features = false } -cfg-primitives = { path = "../../libs/primitives", default-features = false } -cfg-traits = { path = "../../libs/traits", default-features = false } -cfg-types = { path = "../../libs/types", default-features = false } -liquidity-pools-gateway-routers = { path = "../../pallets/liquidity-pools-gateway/routers", default-features = false } -pallet-anchors = { path = "../../pallets/anchors", default-features = false } -pallet-block-rewards = { path = "../../pallets/block-rewards", default-features = false } -pallet-collator-allowlist = { path = "../../pallets/collator-allowlist", default-features = false } -pallet-crowdloan-claim = { path = "../../pallets/crowdloan-claim", default-features = false } -pallet-crowdloan-reward = { path = "../../pallets/crowdloan-reward", default-features = false } -pallet-data-collector = { path = "../../pallets/data-collector", default-features = false } -pallet-ethereum-transaction = { path = "../../pallets/ethereum-transaction", default-features = false } -pallet-fees = { path = "../../pallets/fees", default-features = false } -pallet-foreign-investments = { path = "../../pallets/foreign-investments", default-features = false } -pallet-interest-accrual = { path = "../../pallets/interest-accrual", default-features = false } -pallet-investments = { path = "../../pallets/investments", default-features = false } -pallet-keystore = { path = "../../pallets/keystore", default-features = false } -pallet-liquidity-pools = { path = "../../pallets/liquidity-pools", default-features = false } -pallet-liquidity-pools-gateway = { path = "../../pallets/liquidity-pools-gateway", default-features = false } -pallet-liquidity-rewards = { path = "../../pallets/liquidity-rewards", default-features = false } -pallet-loans = { path = "../../pallets/loans", default-features = false } -pallet-migration-manager = { path = "../../pallets/migration", default-features = false } -pallet-nft-sales = { path = "../../pallets/nft-sales", default-features = false } -pallet-order-book = { path = "../../pallets/order-book", default-features = false } -pallet-permissions = { path = "../../pallets/permissions", default-features = false } -pallet-pool-registry = { path = "../../pallets/pool-registry", default-features = false } -pallet-pool-system = { path = "../../pallets/pool-system", default-features = false } -pallet-restricted-tokens = { path = "../../pallets/restricted-tokens", default-features = false } -pallet-rewards = { path = "../../pallets/rewards", default-features = false } -runtime-common = { path = "../common", default-features = false } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true } -# LiquidityPools 3rd-party dependencies -moonbeam-relay-encoder = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } -pallet-xcm-transactor = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } -xcm-primitives = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } +moonbeam-relay-encoder = { workspace = true } + +# Locals +cfg-primitives = { workspace = true } +cfg-traits = { workspace = true } +cfg-types = { workspace = true } +liquidity-pools-gateway-routers = { workspace = true } +runtime-common = { workspace = true } + +# Pallet list +axelar-gateway-precompile = { workspace = true } +chainbridge = { workspace = true } +cumulus-pallet-aura-ext = { workspace = true } +cumulus-pallet-dmp-queue = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +orml-asset-registry = { workspace = true } +orml-oracle = { workspace = true } +orml-tokens = { workspace = true } +orml-xcm = { workspace = true } +orml-xtokens = { workspace = true } +pallet-anchors = { workspace = true } +pallet-aura = { workspace = true } +pallet-authorship = { workspace = true } +pallet-balances = { workspace = true } +pallet-base-fee = { workspace = true } +pallet-block-rewards = { workspace = true } +pallet-bridge = { workspace = true } +pallet-claims = { workspace = true } +pallet-collator-allowlist = { workspace = true } +pallet-collator-selection = { workspace = true } +pallet-collective = { workspace = true } +pallet-crowdloan-claim = { workspace = true } +pallet-crowdloan-reward = { workspace = true } +pallet-data-collector = { workspace = true } +pallet-democracy = { workspace = true } +pallet-elections-phragmen = { workspace = true } +pallet-ethereum = { workspace = true } +pallet-ethereum-transaction = { workspace = true } +pallet-evm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-fees = { workspace = true } +pallet-foreign-investments = { workspace = true } +pallet-identity = { workspace = true } +pallet-interest-accrual = { workspace = true } +pallet-investments = { workspace = true } +pallet-keystore = { workspace = true } +pallet-liquidity-pools = { workspace = true } +pallet-liquidity-pools-gateway = { workspace = true } +pallet-liquidity-rewards = { workspace = true } +pallet-loans = { workspace = true } +pallet-membership = { workspace = true } +pallet-migration-manager = { workspace = true } +pallet-multisig = { workspace = true } +pallet-nft = { workspace = true } +pallet-nft-sales = { workspace = true } +pallet-order-book = { workspace = true } +pallet-permissions = { workspace = true } +pallet-pool-registry = { workspace = true } +pallet-pool-system = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-restricted-tokens = { workspace = true } +pallet-rewards = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-session = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transfer-allowlist = { workspace = true } +pallet-treasury = { workspace = true } +pallet-uniques = { workspace = true } +pallet-utility = { workspace = true } +pallet-vesting = { workspace = true } +pallet-xcm = { workspace = true } +pallet-xcm-transactor = { workspace = true } +parachain-info = { workspace = true } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +substrate-wasm-builder = { workspace = true } [features] default = ["std"] + std = [ - "axelar-gateway-precompile/std", - "cfg-primitives/std", - "cfg-traits/std", - "cfg-types/std", "codec/std", - "cumulus-pallet-aura-ext/std", - "cumulus-pallet-dmp-queue/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-session-benchmarking/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", + "getrandom/std", + "hex/std", + "scale-info/std", + "serde/std", + "log/std", + + # Substrate related + "sp-api/std", + "sp-runtime/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "frame-support/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", + "frame-executive/std", + "frame-try-runtime?/std", + "frame-system-benchmarking?/std", + "frame-benchmarking?/std", "cumulus-primitives-core/std", "cumulus-primitives-timestamp/std", "cumulus-primitives-utility/std", + "cumulus-pallet-session-benchmarking?/std", + "xcm/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm-primitives/std", + "orml-traits/std", + "orml-xcm-support/std", "fp-rpc/std", "fp-self-contained/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", + "moonbeam-relay-encoder/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "polkadot-runtime-common/std", + "polkadot-parachain/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "frame-try-runtime/std", + # Locals + "cfg-primitives/std", + "cfg-traits/std", + "cfg-types/std", + "runtime-common/std", "liquidity-pools-gateway-routers/std", - "log/std", - "moonbeam-relay-encoder/std", + + # Pallet list + "axelar-gateway-precompile/std", + "chainbridge/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", "orml-asset-registry/std", "orml-oracle/std", "orml-tokens/std", - "orml-traits/std", - "orml-xcm-support/std", "orml-xcm/std", "orml-xtokens/std", "pallet-anchors/std", @@ -182,6 +216,8 @@ std = [ "pallet-balances/std", "pallet-base-fee/std", "pallet-block-rewards/std", + "pallet-bridge/std", + "pallet-claims/std", "pallet-collator-allowlist/std", "pallet-collator-selection/std", "pallet-collective/std", @@ -190,24 +226,24 @@ std = [ "pallet-data-collector/std", "pallet-democracy/std", "pallet-elections-phragmen/std", - "pallet-ethereum-transaction/std", "pallet-ethereum/std", - "pallet-evm-chain-id/std", - "pallet-evm-precompile-dispatch/std", + "pallet-ethereum-transaction/std", "pallet-evm/std", + "pallet-evm-chain-id/std", "pallet-fees/std", "pallet-foreign-investments/std", "pallet-identity/std", "pallet-interest-accrual/std", "pallet-investments/std", "pallet-keystore/std", - "pallet-liquidity-pools-gateway/std", "pallet-liquidity-pools/std", + "pallet-liquidity-pools-gateway/std", "pallet-liquidity-rewards/std", "pallet-loans/std", "pallet-membership/std", "pallet-migration-manager/std", "pallet-multisig/std", + "pallet-nft/std", "pallet-nft-sales/std", "pallet-order-book/std", "pallet-permissions/std", @@ -219,56 +255,56 @@ std = [ "pallet-rewards/std", "pallet-scheduler/std", "pallet-session/std", + "pallet-sudo/std", "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", + "pallet-transfer-allowlist/std", "pallet-treasury/std", "pallet-uniques/std", "pallet-utility/std", "pallet-vesting/std", + "pallet-xcm/std", "pallet-xcm-transactor/std", "parachain-info/std", - "polkadot-parachain/std", - "polkadot-runtime-common/std", - "runtime-common/std", - "scale-info/std", - "serde/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-inherents/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm-primitives/std", - "xcm/std", ] + runtime-benchmarks = [ - "axelar-gateway-precompile/runtime-benchmarks", + # Enabling optional + "hex-literal", + "frame-system-benchmarking/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + + # Substrate related + "sp-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", + "xcm-primitives/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", + "polkadot-parachain/runtime-benchmarks", + + # Locals "cfg-primitives/runtime-benchmarks", "cfg-traits/runtime-benchmarks", "cfg-types/runtime-benchmarks", + "runtime-common/runtime-benchmarks", + "liquidity-pools-gateway-routers/runtime-benchmarks", + + # Pallet list + "axelar-gateway-precompile/runtime-benchmarks", + "chainbridge/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", - "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "liquidity-pools-gateway-routers/runtime-benchmarks", "orml-asset-registry/runtime-benchmarks", "orml-tokens/runtime-benchmarks", "orml-xtokens/runtime-benchmarks", "pallet-anchors/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-block-rewards/runtime-benchmarks", + "pallet-bridge/runtime-benchmarks", + "pallet-claims/runtime-benchmarks", "pallet-collator-allowlist/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "pallet-collective/runtime-benchmarks", @@ -277,9 +313,8 @@ runtime-benchmarks = [ "pallet-data-collector/runtime-benchmarks", "pallet-democracy/runtime-benchmarks", "pallet-elections-phragmen/runtime-benchmarks", - "pallet-ethereum-transaction/runtime-benchmarks", "pallet-ethereum/runtime-benchmarks", - "pallet-evm/runtime-benchmarks", + "pallet-ethereum-transaction/runtime-benchmarks", "pallet-evm/runtime-benchmarks", "pallet-fees/runtime-benchmarks", "pallet-foreign-investments/runtime-benchmarks", @@ -287,13 +322,14 @@ runtime-benchmarks = [ "pallet-interest-accrual/runtime-benchmarks", "pallet-investments/runtime-benchmarks", "pallet-keystore/runtime-benchmarks", - "pallet-liquidity-pools-gateway/runtime-benchmarks", "pallet-liquidity-pools/runtime-benchmarks", + "pallet-liquidity-pools-gateway/runtime-benchmarks", "pallet-liquidity-rewards/runtime-benchmarks", "pallet-loans/runtime-benchmarks", "pallet-membership/runtime-benchmarks", "pallet-migration-manager/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", + "pallet-nft/runtime-benchmarks", "pallet-nft-sales/runtime-benchmarks", "pallet-order-book/runtime-benchmarks", "pallet-permissions/runtime-benchmarks", @@ -304,40 +340,44 @@ runtime-benchmarks = [ "pallet-restricted-tokens/runtime-benchmarks", "pallet-rewards/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", + "pallet-transfer-allowlist/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-uniques/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", - "pallet-xcm-transactor/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "runtime-common/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", - "xcm-primitives/runtime-benchmarks", + "pallet-xcm-transactor/runtime-benchmarks", ] try-runtime = [ - "axelar-gateway-precompile/try-runtime", - "cfg-primitives/try-runtime", + # Enabling optional + "frame-try-runtime/try-runtime", + + # Substrate related + "sp-runtime/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "frame-executive/try-runtime", + "fp-self-contained/try-runtime", + "polkadot-runtime-common/try-runtime", + + # Locals "cfg-primitives/try-runtime", "cfg-traits/try-runtime", - "cfg-traits/try-runtime", "cfg-types/try-runtime", + "runtime-common/try-runtime", + "liquidity-pools-gateway-routers/try-runtime", + + # Pallet list + "axelar-gateway-precompile/try-runtime", + "chainbridge/try-runtime", "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-dmp-queue/try-runtime", "cumulus-pallet-parachain-system/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", - "fp-self-contained/try-runtime", - "frame-executive/try-runtime", - "frame-support/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime", - "liquidity-pools-gateway-routers/try-runtime", "orml-asset-registry/try-runtime", "orml-oracle/try-runtime", "orml-tokens/try-runtime", @@ -349,6 +389,8 @@ try-runtime = [ "pallet-balances/try-runtime", "pallet-base-fee/try-runtime", "pallet-block-rewards/try-runtime", + "pallet-bridge/try-runtime", + "pallet-claims/try-runtime", "pallet-collator-allowlist/try-runtime", "pallet-collator-selection/try-runtime", "pallet-collective/try-runtime", @@ -357,23 +399,24 @@ try-runtime = [ "pallet-data-collector/try-runtime", "pallet-democracy/try-runtime", "pallet-elections-phragmen/try-runtime", - "pallet-ethereum-transaction/try-runtime", "pallet-ethereum/try-runtime", - "pallet-evm-chain-id/try-runtime", + "pallet-ethereum-transaction/try-runtime", "pallet-evm/try-runtime", + "pallet-evm-chain-id/try-runtime", "pallet-fees/try-runtime", "pallet-foreign-investments/try-runtime", "pallet-identity/try-runtime", "pallet-interest-accrual/try-runtime", "pallet-investments/try-runtime", "pallet-keystore/try-runtime", - "pallet-liquidity-pools-gateway/try-runtime", "pallet-liquidity-pools/try-runtime", + "pallet-liquidity-pools-gateway/try-runtime", "pallet-liquidity-rewards/try-runtime", "pallet-loans/try-runtime", "pallet-membership/try-runtime", "pallet-migration-manager/try-runtime", "pallet-multisig/try-runtime", + "pallet-nft/try-runtime", "pallet-nft-sales/try-runtime", "pallet-order-book/try-runtime", "pallet-permissions/try-runtime", @@ -382,22 +425,20 @@ try-runtime = [ "pallet-preimage/try-runtime", "pallet-proxy/try-runtime", "pallet-restricted-tokens/try-runtime", - "pallet-restricted-tokens/try-runtime", "pallet-rewards/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", + "pallet-sudo/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", + "pallet-transfer-allowlist/try-runtime", "pallet-treasury/try-runtime", "pallet-uniques/try-runtime", "pallet-utility/try-runtime", "pallet-vesting/try-runtime", - "pallet-xcm-transactor/try-runtime", "pallet-xcm/try-runtime", + "pallet-xcm-transactor/try-runtime", "parachain-info/try-runtime", - "polkadot-runtime-common/try-runtime", - "runtime-common/try-runtime", - "sp-runtime/try-runtime", ] # A feature that should be enabled when the runtime should be build for on-chain @@ -405,6 +446,7 @@ try-runtime = [ # to make it smaller like logging for example. on-chain-release-build = [ "sp-api/disable-logging", + "runtime-common/on-chain-release-build", ] # Set timing constants (e.g. session period) to faster versions to speed up testing. diff --git a/runtime/altair/src/lib.rs b/runtime/altair/src/lib.rs index d8e0b62f98..16809071a1 100644 --- a/runtime/altair/src/lib.rs +++ b/runtime/altair/src/lib.rs @@ -1980,7 +1980,7 @@ impl_runtime_apis! { } fn metadata_at_version(version: u32) -> Option { Runtime::metadata_at_version(version) } - fn metadata_versions() -> frame_benchmarking::Vec { Runtime::metadata_versions() } + fn metadata_versions() -> sp_std::vec::Vec { Runtime::metadata_versions() } } impl sp_block_builder::BlockBuilder for Runtime { diff --git a/runtime/centrifuge/Cargo.toml b/runtime/centrifuge/Cargo.toml index 1d63f1f64a..a08abe9119 100644 --- a/runtime/centrifuge/Cargo.toml +++ b/runtime/centrifuge/Cargo.toml @@ -1,184 +1,213 @@ [package] name = "centrifuge-runtime" version = "0.10.23" -authors = ["Centrifuge "] -edition = "2021" build = "build.rs" -license = "LGPL-3.0" -homepage = "https://centrifuge.io/" -repository = "https://github.com/centrifuge/centrifuge-chain" +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +documentation.workspace = true [dependencies] -# third-party dependencies -codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] } -hex-literal = { version = "0.3.4", default-features = false } -log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.119", optional = true } -static_assertions = "1.1.0" +codec = { package = "parity-scale-codec", workspace = true } +getrandom = { workspace = true } +hex = { workspace = true } +hex-literal = { workspace = true } +log = { workspace = true } +scale-info = { workspace = true } +serde = { workspace = true, optional = true } +static_assertions = { workspace = true } -# parachain -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/cumulus", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-aura = { workspace = true } +sp-core = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } -# polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +frame-benchmarking = { workspace = true, optional = true } # For benchmarking +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-benchmarking = { workspace = true, optional = true } # For benchmarking +frame-system-rpc-runtime-api = { workspace = true } +frame-try-runtime = { workspace = true, optional = true } # For try-runtime -# primitives -sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-pallet-session-benchmarking = { workspace = true, optional = true } # For benchmarking +cumulus-primitives-core = { workspace = true } +cumulus-primitives-timestamp = { workspace = true } +cumulus-primitives-utility = { workspace = true } -# frame dependencies -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, features = ["tuples-96"], branch = "polkadot-v0.9.43" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-identity = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, features = ["historical"], branch = "polkadot-v0.9.43" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +polkadot-parachain = { workspace = true } +polkadot-runtime-common = { workspace = true } -# Orml pallets -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } +xcm-primitives = { workspace = true } -# frontier pallets -fp-rpc = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -fp-self-contained = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-base-fee = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-ethereum = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-chain-id = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-dispatch = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +orml-traits = { workspace = true } +orml-xcm-support = { workspace = true } -# Our pallets and modules -axelar-gateway-precompile = { path = "../../pallets/liquidity-pools-gateway/axelar-gateway-precompile", default-features = false } -cfg-primitives = { path = "../../libs/primitives", default-features = false } -cfg-traits = { path = "../../libs/traits", default-features = false } -cfg-types = { path = "../../libs/types", default-features = false } -liquidity-pools-gateway-routers = { path = "../../pallets/liquidity-pools-gateway/routers", default-features = false } -pallet-anchors = { path = "../../pallets/anchors", default-features = false } -pallet-block-rewards = { path = "../../pallets/block-rewards", default-features = false } -pallet-bridge = { path = "../../pallets/bridge", default-features = false } -pallet-claims = { path = "../../pallets/claims", default-features = false } -pallet-collator-allowlist = { path = "../../pallets/collator-allowlist", default-features = false } -pallet-crowdloan-claim = { path = "../../pallets/crowdloan-claim", default-features = false } -pallet-crowdloan-reward = { path = "../../pallets/crowdloan-reward", default-features = false } -pallet-data-collector = { path = "../../pallets/data-collector", default-features = false } -pallet-ethereum-transaction = { path = "../../pallets/ethereum-transaction", default-features = false } -pallet-fees = { path = "../../pallets/fees", default-features = false } -pallet-foreign-investments = { path = "../../pallets/foreign-investments", default-features = false } -pallet-interest-accrual = { path = "../../pallets/interest-accrual", default-features = false } -pallet-investments = { path = "../../pallets/investments", default-features = false } -pallet-keystore = { path = "../../pallets/keystore", default-features = false } -pallet-liquidity-pools = { path = "../../pallets/liquidity-pools", default-features = false } -pallet-liquidity-pools-gateway = { path = "../../pallets/liquidity-pools-gateway", default-features = false } -pallet-liquidity-rewards = { path = "../../pallets/liquidity-rewards", default-features = false } -pallet-loans = { path = "../../pallets/loans", default-features = false } -pallet-migration-manager = { path = "../../pallets/migration", default-features = false } -pallet-nft = { path = "../../pallets/nft", default-features = false } -pallet-order-book = { path = "../../pallets/order-book", default-features = false } -pallet-permissions = { path = "../../pallets/permissions", default-features = false } -pallet-pool-registry = { path = "../../pallets/pool-registry", default-features = false } -pallet-pool-system = { path = "../../pallets/pool-system", default-features = false } -pallet-restricted-tokens = { path = "../../pallets/restricted-tokens", default-features = false } -pallet-rewards = { path = "../../pallets/rewards", default-features = false } -runtime-common = { path = "../common", default-features = false } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true } -# LiquidityPools 3rd-party dependencies -moonbeam-relay-encoder = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } -pallet-xcm-transactor = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } -xcm-primitives = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } +moonbeam-relay-encoder = { workspace = true } -# bridge pallets -chainbridge = { git = "https://github.com/centrifuge/chainbridge-substrate.git", default-features = false, branch = "polkadot-v0.9.43" } +# Locals +cfg-primitives = { workspace = true } +cfg-traits = { workspace = true } +cfg-types = { workspace = true } +liquidity-pools-gateway-routers = { workspace = true } +runtime-common = { workspace = true } + +# Pallet list +axelar-gateway-precompile = { workspace = true } +chainbridge = { workspace = true } +cumulus-pallet-aura-ext = { workspace = true } +cumulus-pallet-dmp-queue = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +orml-asset-registry = { workspace = true } +orml-oracle = { workspace = true } +orml-tokens = { workspace = true } +orml-xcm = { workspace = true } +orml-xtokens = { workspace = true } +pallet-anchors = { workspace = true } +pallet-aura = { workspace = true } +pallet-authorship = { workspace = true } +pallet-balances = { workspace = true } +pallet-base-fee = { workspace = true } +pallet-block-rewards = { workspace = true } +pallet-bridge = { workspace = true } +pallet-claims = { workspace = true } +pallet-collator-allowlist = { workspace = true } +pallet-collator-selection = { workspace = true } +pallet-collective = { workspace = true } +pallet-crowdloan-claim = { workspace = true } +pallet-crowdloan-reward = { workspace = true } +pallet-data-collector = { workspace = true } +pallet-democracy = { workspace = true } +pallet-elections-phragmen = { workspace = true } +pallet-ethereum = { workspace = true } +pallet-ethereum-transaction = { workspace = true } +pallet-evm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-fees = { workspace = true } +pallet-foreign-investments = { workspace = true } +pallet-identity = { workspace = true } +pallet-interest-accrual = { workspace = true } +pallet-investments = { workspace = true } +pallet-keystore = { workspace = true } +pallet-liquidity-pools = { workspace = true } +pallet-liquidity-pools-gateway = { workspace = true } +pallet-liquidity-rewards = { workspace = true } +pallet-loans = { workspace = true } +pallet-membership = { workspace = true } +pallet-migration-manager = { workspace = true } +pallet-multisig = { workspace = true } +pallet-nft = { workspace = true } +pallet-nft-sales = { workspace = true } +pallet-order-book = { workspace = true } +pallet-permissions = { workspace = true } +pallet-pool-registry = { workspace = true } +pallet-pool-system = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-restricted-tokens = { workspace = true } +pallet-rewards = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-session = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transfer-allowlist = { workspace = true } +pallet-treasury = { workspace = true } +pallet-uniques = { workspace = true } +pallet-utility = { workspace = true } +pallet-vesting = { workspace = true } +pallet-xcm = { workspace = true } +pallet-xcm-transactor = { workspace = true } +parachain-info = { workspace = true } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +substrate-wasm-builder = { workspace = true } [features] default = ["std"] + std = [ - "axelar-gateway-precompile/std", + "codec/std", + "getrandom/std", + "hex/std", + "scale-info/std", + "serde/std", + "log/std", + + # Substrate related + "sp-api/std", + "sp-runtime/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "frame-support/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", + "frame-executive/std", + "frame-try-runtime?/std", + "frame-system-benchmarking?/std", + "frame-benchmarking?/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "cumulus-pallet-session-benchmarking?/std", + "xcm/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm-primitives/std", + "orml-traits/std", + "orml-xcm-support/std", + "fp-rpc/std", + "fp-self-contained/std", + "moonbeam-relay-encoder/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "polkadot-runtime-common/std", + "polkadot-parachain/std", + + # Locals "cfg-primitives/std", "cfg-traits/std", "cfg-types/std", + "runtime-common/std", + "liquidity-pools-gateway-routers/std", + + # Pallet list + "axelar-gateway-precompile/std", "chainbridge/std", - "codec/std", "cumulus-pallet-aura-ext/std", "cumulus-pallet-dmp-queue/std", "cumulus-pallet-parachain-system/std", - "cumulus-pallet-session-benchmarking/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-core/std", - "cumulus-primitives-timestamp/std", - "cumulus-primitives-utility/std", - "fp-rpc/std", - "fp-self-contained/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", - - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "frame-try-runtime/std", - "liquidity-pools-gateway-routers/std", - "log/std", - "moonbeam-relay-encoder/std", "orml-asset-registry/std", "orml-oracle/std", "orml-tokens/std", - "orml-traits/std", - "orml-xcm-support/std", "orml-xcm/std", "orml-xtokens/std", "pallet-anchors/std", @@ -197,25 +226,25 @@ std = [ "pallet-data-collector/std", "pallet-democracy/std", "pallet-elections-phragmen/std", - "pallet-ethereum-transaction/std", "pallet-ethereum/std", - "pallet-evm-chain-id/std", - "pallet-evm-precompile-dispatch/std", + "pallet-ethereum-transaction/std", "pallet-evm/std", + "pallet-evm-chain-id/std", "pallet-fees/std", "pallet-foreign-investments/std", "pallet-identity/std", "pallet-interest-accrual/std", "pallet-investments/std", "pallet-keystore/std", - "pallet-liquidity-pools-gateway/std", "pallet-liquidity-pools/std", + "pallet-liquidity-pools-gateway/std", "pallet-liquidity-rewards/std", "pallet-loans/std", "pallet-membership/std", "pallet-migration-manager/std", "pallet-multisig/std", "pallet-nft/std", + "pallet-nft-sales/std", "pallet-order-book/std", "pallet-permissions/std", "pallet-pool-registry/std", @@ -226,53 +255,47 @@ std = [ "pallet-rewards/std", "pallet-scheduler/std", "pallet-session/std", + "pallet-sudo/std", "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", + "pallet-transfer-allowlist/std", "pallet-treasury/std", "pallet-uniques/std", "pallet-utility/std", "pallet-vesting/std", - "pallet-xcm-transactor/std", "pallet-xcm/std", + "pallet-xcm-transactor/std", "parachain-info/std", - "polkadot-parachain/std", - "polkadot-runtime-common/std", - "runtime-common/std", - "scale-info/std", - "serde", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-inherents/std", - "sp-io/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm-primitives/std", - "xcm/std", ] runtime-benchmarks = [ - "axelar-gateway-precompile/runtime-benchmarks", + # Enabling optional + "frame-system-benchmarking/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + + # Substrate related + "sp-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", + "xcm-primitives/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", + "polkadot-parachain/runtime-benchmarks", + + # Locals "cfg-primitives/runtime-benchmarks", "cfg-traits/runtime-benchmarks", "cfg-types/runtime-benchmarks", + "runtime-common/runtime-benchmarks", + "liquidity-pools-gateway-routers/runtime-benchmarks", + + # Pallet list + "axelar-gateway-precompile/runtime-benchmarks", "chainbridge/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", - "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "liquidity-pools-gateway-routers/runtime-benchmarks", "orml-asset-registry/runtime-benchmarks", "orml-tokens/runtime-benchmarks", "orml-xtokens/runtime-benchmarks", @@ -289,8 +312,8 @@ runtime-benchmarks = [ "pallet-data-collector/runtime-benchmarks", "pallet-democracy/runtime-benchmarks", "pallet-elections-phragmen/runtime-benchmarks", - "pallet-ethereum-transaction/runtime-benchmarks", "pallet-ethereum/runtime-benchmarks", + "pallet-ethereum-transaction/runtime-benchmarks", "pallet-evm/runtime-benchmarks", "pallet-fees/runtime-benchmarks", "pallet-foreign-investments/runtime-benchmarks", @@ -298,14 +321,15 @@ runtime-benchmarks = [ "pallet-interest-accrual/runtime-benchmarks", "pallet-investments/runtime-benchmarks", "pallet-keystore/runtime-benchmarks", - "pallet-liquidity-pools-gateway/runtime-benchmarks", "pallet-liquidity-pools/runtime-benchmarks", + "pallet-liquidity-pools-gateway/runtime-benchmarks", "pallet-liquidity-rewards/runtime-benchmarks", "pallet-loans/runtime-benchmarks", "pallet-membership/runtime-benchmarks", "pallet-migration-manager/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-nft/runtime-benchmarks", + "pallet-nft-sales/runtime-benchmarks", "pallet-order-book/runtime-benchmarks", "pallet-permissions/runtime-benchmarks", "pallet-pool-registry/runtime-benchmarks", @@ -315,39 +339,44 @@ runtime-benchmarks = [ "pallet-restricted-tokens/runtime-benchmarks", "pallet-rewards/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", + "pallet-transfer-allowlist/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-uniques/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", - "pallet-xcm-transactor/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "runtime-common/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", - "xcm-primitives/runtime-benchmarks", + "pallet-xcm-transactor/runtime-benchmarks", ] try-runtime = [ - "axelar-gateway-precompile/try-runtime", + # Enabling optional + "frame-try-runtime/try-runtime", + + # Substrate related + "sp-runtime/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "frame-executive/try-runtime", + "fp-self-contained/try-runtime", + "polkadot-runtime-common/try-runtime", + + # Locals "cfg-primitives/try-runtime", "cfg-traits/try-runtime", "cfg-types/try-runtime", + "runtime-common/try-runtime", + "liquidity-pools-gateway-routers/try-runtime", + + # Pallet list + "axelar-gateway-precompile/try-runtime", "chainbridge/try-runtime", "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-dmp-queue/try-runtime", "cumulus-pallet-parachain-system/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", - "fp-self-contained/try-runtime", - "frame-executive/try-runtime", - "frame-support/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime", - "liquidity-pools-gateway-routers/try-runtime", "orml-asset-registry/try-runtime", "orml-oracle/try-runtime", "orml-tokens/try-runtime", @@ -369,24 +398,25 @@ try-runtime = [ "pallet-data-collector/try-runtime", "pallet-democracy/try-runtime", "pallet-elections-phragmen/try-runtime", - "pallet-ethereum-transaction/try-runtime", "pallet-ethereum/try-runtime", - "pallet-evm-chain-id/try-runtime", + "pallet-ethereum-transaction/try-runtime", "pallet-evm/try-runtime", + "pallet-evm-chain-id/try-runtime", "pallet-fees/try-runtime", "pallet-foreign-investments/try-runtime", "pallet-identity/try-runtime", "pallet-interest-accrual/try-runtime", "pallet-investments/try-runtime", "pallet-keystore/try-runtime", - "pallet-liquidity-pools-gateway/try-runtime", "pallet-liquidity-pools/try-runtime", + "pallet-liquidity-pools-gateway/try-runtime", "pallet-liquidity-rewards/try-runtime", "pallet-loans/try-runtime", "pallet-membership/try-runtime", "pallet-migration-manager/try-runtime", "pallet-multisig/try-runtime", "pallet-nft/try-runtime", + "pallet-nft-sales/try-runtime", "pallet-order-book/try-runtime", "pallet-permissions/try-runtime", "pallet-pool-registry/try-runtime", @@ -397,18 +427,17 @@ try-runtime = [ "pallet-rewards/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", + "pallet-sudo/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", + "pallet-transfer-allowlist/try-runtime", "pallet-treasury/try-runtime", "pallet-uniques/try-runtime", "pallet-utility/try-runtime", "pallet-vesting/try-runtime", - "pallet-xcm-transactor/try-runtime", "pallet-xcm/try-runtime", + "pallet-xcm-transactor/try-runtime", "parachain-info/try-runtime", - "polkadot-runtime-common/try-runtime", - "runtime-common/try-runtime", - "sp-runtime/try-runtime", ] # A feature that should be enabled when the runtime should be build for on-chain @@ -416,6 +445,7 @@ try-runtime = [ # to make it smaller like logging for example. on-chain-release-build = [ "sp-api/disable-logging", + "runtime-common/on-chain-release-build", ] # Set timing constants (e.g. session period) to faster versions to speed up testing. diff --git a/runtime/centrifuge/src/lib.rs b/runtime/centrifuge/src/lib.rs index 37787deb79..69b9da5ae9 100644 --- a/runtime/centrifuge/src/lib.rs +++ b/runtime/centrifuge/src/lib.rs @@ -2017,7 +2017,7 @@ impl_runtime_apis! { } fn metadata_at_version(version: u32) -> Option { Runtime::metadata_at_version(version) } - fn metadata_versions() -> frame_benchmarking::Vec { Runtime::metadata_versions() } + fn metadata_versions() -> sp_std::vec::Vec { Runtime::metadata_versions() } } impl sp_block_builder::BlockBuilder for Runtime { diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 7c2542b97c..d7d76cdc15 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,203 +1,379 @@ [package] name = "runtime-common" version = "1.0.0" -authors = ["Centrifuge "] -edition = "2021" -license = "LGPL-3.0" -homepage = "https://centrifuge.io/" -repository = "https://github.com/centrifuge/centrifuge-chain" +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +documentation.workspace = true [dependencies] -hex-literal = { version = "0.3.4", default-features = false } -serde = { version = "1.0.119" } -smallvec = "1.6.1" - -# Substrate dependencies -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } -sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } - -# Polkadot dependencies -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } - -# ORML dependencies -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } - -# Frontier dependencies -pallet-base-fee = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-ethereum = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-chain-id = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-blake2 = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-bn128 = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-dispatch = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-modexp = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-sha3fips = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-simple = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } - -# There is a bug in the frontier repo that adds pallet-ethereum without a try-runtime dependency -# for this crate which makes our compilation fail with the i_know_what_i_am_doing error. -# It seem fixed in 0.9.39, and this dependency can be removed from this file safely. -fp-self-contained = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } - -# Moonbeam dependencies -xcm-primitives = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } - -# Local Dependencies -axelar-gateway-precompile = { path = "../../pallets/liquidity-pools-gateway/axelar-gateway-precompile", default-features = false } -cfg-primitives = { path = "../../libs/primitives", default-features = false } -cfg-traits = { path = "../../libs/traits", default-features = false } -cfg-types = { path = "../../libs/types", default-features = false } -cfg-utils = { path = "../../libs/utils", default-features = false } -pallet-anchors = { path = "../../pallets/anchors", default-features = false } -pallet-data-collector = { path = "../../pallets/data-collector", default-features = false } -pallet-investments = { path = "../../pallets/investments", default-features = false } -pallet-liquidity-pools = { path = "../../pallets/liquidity-pools", default-features = false } -pallet-liquidity-pools-gateway = { path = "../../pallets/liquidity-pools-gateway", default-features = false } -pallet-loans = { path = "../../pallets/loans", default-features = false } -pallet-pool-system = { path = "../../pallets/pool-system", default-features = false } -pallet-restricted-tokens = { path = "../../pallets/restricted-tokens", default-features = false } - -# Used for migrations -log = "0.4" -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +codec = { package = "parity-scale-codec", workspace = true } +hex-literal = { workspace = true } +log = { workspace = true } +scale-info = { workspace = true } +serde = { workspace = true } +smallvec = { workspace = true } + +frame-support = { workspace = true } +frame-system = { workspace = true } + +sp-api = { workspace = true } +sp-arithmetic = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +polkadot-parachain = { workspace = true } +xcm = { workspace = true } +xcm-executor = { workspace = true } + +orml-traits = { workspace = true } + +pallet-evm-precompile-blake2 = { workspace = true } +pallet-evm-precompile-bn128 = { workspace = true } +pallet-evm-precompile-dispatch = { workspace = true } +pallet-evm-precompile-modexp = { workspace = true } +pallet-evm-precompile-sha3fips = { workspace = true } +pallet-evm-precompile-simple = { workspace = true } + +xcm-primitives = { workspace = true } + +# Local +cfg-primitives = { workspace = true } +cfg-traits = { workspace = true } +cfg-types = { workspace = true } +cfg-utils = { workspace = true } + +# Pallets in the export list +axelar-gateway-precompile = { workspace = true } +chainbridge = { workspace = true } +cumulus-pallet-aura-ext = { workspace = true } +cumulus-pallet-dmp-queue = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +orml-asset-registry = { workspace = true } +orml-oracle = { workspace = true } +orml-tokens = { workspace = true } +orml-xcm = { workspace = true } +orml-xtokens = { workspace = true } +pallet-anchors = { workspace = true } +pallet-aura = { workspace = true } +pallet-authorship = { workspace = true } +pallet-balances = { workspace = true } +pallet-base-fee = { workspace = true } +pallet-block-rewards = { workspace = true } +pallet-bridge = { workspace = true } +pallet-claims = { workspace = true } +pallet-collator-allowlist = { workspace = true } +pallet-collator-selection = { workspace = true } +pallet-collective = { workspace = true } +pallet-crowdloan-claim = { workspace = true } +pallet-crowdloan-reward = { workspace = true } +pallet-data-collector = { workspace = true } +pallet-democracy = { workspace = true } +pallet-elections-phragmen = { workspace = true } +pallet-ethereum = { workspace = true } +pallet-ethereum-transaction = { workspace = true } +pallet-evm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-fees = { workspace = true } +pallet-foreign-investments = { workspace = true } +pallet-identity = { workspace = true } +pallet-interest-accrual = { workspace = true } +pallet-investments = { workspace = true } +pallet-keystore = { workspace = true } +pallet-liquidity-pools = { workspace = true } +pallet-liquidity-pools-gateway = { workspace = true } +pallet-liquidity-rewards = { workspace = true } +pallet-loans = { workspace = true } +pallet-membership = { workspace = true } +pallet-migration-manager = { workspace = true } +pallet-multisig = { workspace = true } +pallet-nft = { workspace = true } +pallet-nft-sales = { workspace = true } +pallet-order-book = { workspace = true } +pallet-permissions = { workspace = true } +pallet-pool-registry = { workspace = true } +pallet-pool-system = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-restricted-tokens = { workspace = true } +pallet-rewards = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-session = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transfer-allowlist = { workspace = true } +pallet-treasury = { workspace = true } +pallet-uniques = { workspace = true } +pallet-utility = { workspace = true } +pallet-vesting = { workspace = true } +pallet-xcm = { workspace = true } +pallet-xcm-transactor = { workspace = true } +parachain-info = { workspace = true } [dev-dependencies] -cfg-mocks = { path = "../../libs/mocks", features = ["runtime-benchmarks", "std"] } -hex-literal = "0.3.4" -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.43" } +cfg-mocks = { workspace = true } [features] default = ["std"] std = [ - "axelar-gateway-precompile/std", + "codec/std", + "log/std", + + # Substrate related + "frame-support/std", + "frame-system/std", + "orml-traits/std", + "polkadot-parachain/std", + "scale-info/std", + "serde/std", + "sp-api/std", + "sp-arithmetic/std", + "sp-core/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "xcm-executor/std", + "xcm-primitives/std", + "xcm/std", + + # Locals "cfg-primitives/std", "cfg-traits/std", "cfg-types/std", "cfg-utils/std", - "codec/std", - "fp-self-contained/std", - "frame-support/std", - "frame-support/std", - "frame-system/std", - "log/std", + "cfg-mocks/std", + + # Pallet exporting list + "axelar-gateway-precompile/std", + "chainbridge/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", "orml-asset-registry/std", "orml-oracle/std", "orml-tokens/std", - "orml-traits/std", + "orml-xcm/std", + "orml-xtokens/std", "pallet-anchors/std", + "pallet-aura/std", "pallet-authorship/std", "pallet-balances/std", "pallet-base-fee/std", + "pallet-block-rewards/std", + "pallet-bridge/std", + "pallet-claims/std", + "pallet-collator-allowlist/std", + "pallet-collator-selection/std", + "pallet-collective/std", + "pallet-crowdloan-claim/std", + "pallet-crowdloan-reward/std", "pallet-data-collector/std", + "pallet-democracy/std", + "pallet-elections-phragmen/std", "pallet-ethereum/std", - "pallet-evm-chain-id/std", - "pallet-evm-precompile-blake2/std", - "pallet-evm-precompile-bn128/std", - "pallet-evm-precompile-dispatch/std", - "pallet-evm-precompile-modexp/std", - "pallet-evm-precompile-sha3fips/std", - "pallet-evm-precompile-simple/std", + "pallet-ethereum-transaction/std", "pallet-evm/std", + "pallet-evm-chain-id/std", + "pallet-fees/std", + "pallet-foreign-investments/std", + "pallet-identity/std", + "pallet-interest-accrual/std", "pallet-investments/std", - "pallet-liquidity-pools-gateway/std", + "pallet-keystore/std", "pallet-liquidity-pools/std", + "pallet-liquidity-pools-gateway/std", + "pallet-liquidity-rewards/std", "pallet-loans/std", + "pallet-membership/std", + "pallet-migration-manager/std", + "pallet-multisig/std", + "pallet-nft/std", + "pallet-nft-sales/std", + "pallet-order-book/std", + "pallet-permissions/std", + "pallet-pool-registry/std", "pallet-pool-system/std", + "pallet-preimage/std", + "pallet-proxy/std", "pallet-restricted-tokens/std", + "pallet-rewards/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment/std", + "pallet-transfer-allowlist/std", "pallet-treasury/std", + "pallet-uniques/std", + "pallet-utility/std", + "pallet-vesting/std", + "pallet-xcm/std", + "pallet-xcm-transactor/std", "parachain-info/std", - "polkadot-parachain/std", - "scale-info/std", - "serde/std", - "sp-api/std", - "sp-arithmetic/std", - "sp-core/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "xcm-executor/std", - "xcm-primitives/std", - "xcm/std", ] runtime-benchmarks = [ - "axelar-gateway-precompile/runtime-benchmarks", - "cfg-mocks/runtime-benchmarks", + # Substrate related + "sp-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", + "xcm-primitives/runtime-benchmarks", + + # Locals "cfg-primitives/runtime-benchmarks", "cfg-traits/runtime-benchmarks", "cfg-types/runtime-benchmarks", "cfg-utils/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", + "cfg-mocks/runtime-benchmarks", + + # Pallet exporting list + "axelar-gateway-precompile/runtime-benchmarks", + "chainbridge/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", "orml-asset-registry/runtime-benchmarks", "orml-tokens/runtime-benchmarks", + "orml-xtokens/runtime-benchmarks", "pallet-anchors/runtime-benchmarks", "pallet-balances/runtime-benchmarks", + "pallet-block-rewards/runtime-benchmarks", + "pallet-bridge/runtime-benchmarks", + "pallet-claims/runtime-benchmarks", + "pallet-collator-allowlist/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-crowdloan-claim/runtime-benchmarks", + "pallet-crowdloan-reward/runtime-benchmarks", "pallet-data-collector/runtime-benchmarks", + "pallet-democracy/runtime-benchmarks", + "pallet-elections-phragmen/runtime-benchmarks", "pallet-ethereum/runtime-benchmarks", + "pallet-ethereum-transaction/runtime-benchmarks", "pallet-evm/runtime-benchmarks", + "pallet-fees/runtime-benchmarks", + "pallet-foreign-investments/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-interest-accrual/runtime-benchmarks", "pallet-investments/runtime-benchmarks", - "pallet-liquidity-pools-gateway/runtime-benchmarks", + "pallet-keystore/runtime-benchmarks", "pallet-liquidity-pools/runtime-benchmarks", + "pallet-liquidity-pools-gateway/runtime-benchmarks", + "pallet-liquidity-rewards/runtime-benchmarks", "pallet-loans/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", + "pallet-migration-manager/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-nft/runtime-benchmarks", + "pallet-nft-sales/runtime-benchmarks", + "pallet-order-book/runtime-benchmarks", + "pallet-permissions/runtime-benchmarks", + "pallet-pool-registry/runtime-benchmarks", "pallet-pool-system/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", "pallet-restricted-tokens/runtime-benchmarks", + "pallet-rewards/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-transfer-allowlist/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", - "xcm-primitives/runtime-benchmarks", -] - -on-chain-release-build = [ - "sp-api/disable-logging", + "pallet-uniques/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-vesting/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "pallet-xcm-transactor/runtime-benchmarks", ] try-runtime = [ - "axelar-gateway-precompile/try-runtime", - "cfg-mocks/try-runtime", - "cfg-primitives/try-runtime", + "sp-runtime/try-runtime", "cfg-primitives/try-runtime", "cfg-traits/try-runtime", "cfg-types/try-runtime", "cfg-utils/try-runtime", - "fp-self-contained/try-runtime", + "cfg-mocks/try-runtime", "frame-support/try-runtime", "frame-system/try-runtime", + + # Pallet exporting list + "axelar-gateway-precompile/try-runtime", + "chainbridge/try-runtime", + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "orml-asset-registry/try-runtime", "orml-oracle/try-runtime", "orml-tokens/try-runtime", + "orml-xcm/try-runtime", + "orml-xtokens/try-runtime", "pallet-anchors/try-runtime", + "pallet-aura/try-runtime", "pallet-authorship/try-runtime", "pallet-balances/try-runtime", "pallet-base-fee/try-runtime", + "pallet-block-rewards/try-runtime", + "pallet-bridge/try-runtime", + "pallet-claims/try-runtime", + "pallet-collator-allowlist/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-collective/try-runtime", + "pallet-crowdloan-claim/try-runtime", + "pallet-crowdloan-reward/try-runtime", "pallet-data-collector/try-runtime", + "pallet-democracy/try-runtime", + "pallet-elections-phragmen/try-runtime", "pallet-ethereum/try-runtime", - "pallet-evm-chain-id/try-runtime", + "pallet-ethereum-transaction/try-runtime", "pallet-evm/try-runtime", + "pallet-evm-chain-id/try-runtime", + "pallet-fees/try-runtime", + "pallet-foreign-investments/try-runtime", + "pallet-identity/try-runtime", + "pallet-interest-accrual/try-runtime", "pallet-investments/try-runtime", - "pallet-liquidity-pools-gateway/try-runtime", + "pallet-keystore/try-runtime", "pallet-liquidity-pools/try-runtime", + "pallet-liquidity-pools-gateway/try-runtime", + "pallet-liquidity-rewards/try-runtime", "pallet-loans/try-runtime", + "pallet-membership/try-runtime", + "pallet-migration-manager/try-runtime", + "pallet-multisig/try-runtime", + "pallet-nft/try-runtime", + "pallet-nft-sales/try-runtime", + "pallet-order-book/try-runtime", + "pallet-permissions/try-runtime", + "pallet-pool-registry/try-runtime", "pallet-pool-system/try-runtime", + "pallet-preimage/try-runtime", + "pallet-proxy/try-runtime", "pallet-restricted-tokens/try-runtime", + "pallet-rewards/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-transfer-allowlist/try-runtime", "pallet-treasury/try-runtime", + "pallet-uniques/try-runtime", + "pallet-utility/try-runtime", + "pallet-vesting/try-runtime", + "pallet-xcm/try-runtime", + "pallet-xcm-transactor/try-runtime", "parachain-info/try-runtime", - "sp-runtime/try-runtime", +] +on-chain-release-build = [ + "sp-api/disable-logging", ] diff --git a/runtime/common/src/fees.rs b/runtime/common/src/fees.rs new file mode 100644 index 0000000000..ff25996ca9 --- /dev/null +++ b/runtime/common/src/fees.rs @@ -0,0 +1,243 @@ +use cfg_primitives::{ + constants::{CENTI_CFG, TREASURY_FEE_RATIO}, + types::Balance, +}; +use frame_support::{ + traits::{Currency, Imbalance, OnUnbalanced}, + weights::{ + constants::ExtrinsicBaseWeight, WeightToFeeCoefficient, WeightToFeeCoefficients, + WeightToFeePolynomial, + }, +}; +use smallvec::smallvec; +use sp_arithmetic::Perbill; + +pub type NegativeImbalance = as Currency< + ::AccountId, +>>::NegativeImbalance; + +struct ToAuthor(sp_std::marker::PhantomData); +impl OnUnbalanced> for ToAuthor +where + R: pallet_balances::Config + pallet_authorship::Config, +{ + fn on_nonzero_unbalanced(amount: NegativeImbalance) { + if let Some(author) = >::author() { + >::resolve_creating(&author, amount); + } + } +} + +pub struct DealWithFees(sp_std::marker::PhantomData); +impl OnUnbalanced> for DealWithFees +where + R: pallet_balances::Config + pallet_treasury::Config + pallet_authorship::Config, + pallet_treasury::Pallet: OnUnbalanced>, +{ + fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { + if let Some(fees) = fees_then_tips.next() { + // for fees, split the destination + let (treasury_amount, mut author_amount) = fees.ration( + TREASURY_FEE_RATIO.deconstruct(), + (Perbill::one() - TREASURY_FEE_RATIO).deconstruct(), + ); + if let Some(tips) = fees_then_tips.next() { + // for tips, if any, 100% to author + tips.merge_into(&mut author_amount); + } + + use pallet_treasury::Pallet as Treasury; + as OnUnbalanced<_>>::on_unbalanced(treasury_amount); + as OnUnbalanced<_>>::on_unbalanced(author_amount); + } + } +} + +/// Handles converting a weight scalar to a fee value, based on the scale +/// and granularity of the node's balance type. +/// +/// This should typically create a mapping between the following ranges: +/// - [0, frame_system::MaximumBlockWeight] +/// - [Balance::min, Balance::max] +/// +/// Yet, it can be used for any other sort of change to weight-fee. Some +/// examples being: +/// - Setting it to `0` will essentially disable the weight fee. +/// - Setting it to `1` will cause the literal `#[weight = x]` values to be +/// charged. +pub struct WeightToFee; +impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + + fn polynomial() -> WeightToFeeCoefficients { + let p = CENTI_CFG; + let q = 10 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); + + smallvec!(WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + }) + } +} + +#[cfg(test)] +mod test { + use cfg_primitives::{AccountId, TREASURY_FEE_RATIO}; + use frame_support::{ + parameter_types, + traits::{Currency, FindAuthor}, + PalletId, + }; + use sp_core::{ConstU64, H256}; + use sp_io::TestExternalities; + use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + Perbill, + }; + use sp_std::convert::{TryFrom, TryInto}; + + use super::*; + + type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; + type Block = frame_system::mocking::MockBlock; + + const TEST_ACCOUNT: AccountId = AccountId::new([1; 32]); + + frame_support::construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Authorship: pallet_authorship::{Pallet, Storage}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, + } + ); + + parameter_types! { + pub const BlockHashCount: u64 = 250; + } + + impl frame_system::Config for Runtime { + type AccountData = pallet_balances::AccountData; + type AccountId = AccountId; + type BaseCallFilter = frame_support::traits::Everything; + type BlockHashCount = BlockHashCount; + type BlockLength = (); + type BlockNumber = u64; + type BlockWeights = (); + type DbWeight = (); + type Hash = H256; + type Hashing = BlakeTwo256; + type Header = Header; + type Index = u64; + type Lookup = IdentityLookup; + type MaxConsumers = frame_support::traits::ConstU32<16>; + type OnKilledAccount = (); + type OnNewAccount = (); + type OnSetCode = (); + type PalletInfo = PalletInfo; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type SS58Prefix = (); + type SystemWeightInfo = (); + type Version = (); + } + + impl pallet_balances::Config for Runtime { + type AccountStore = System; + type Balance = u64; + type DustRemoval = (); + type ExistentialDeposit = ConstU64<1>; + type FreezeIdentifier = (); + type HoldIdentifier = (); + type MaxFreezes = (); + type MaxHolds = frame_support::traits::ConstU32<1>; + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); + } + + parameter_types! { + pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + pub const MaxApprovals: u32 = 100; + } + + impl pallet_treasury::Config for Runtime { + type ApproveOrigin = frame_system::EnsureRoot; + type Burn = (); + type BurnDestination = (); + type Currency = pallet_balances::Pallet; + type MaxApprovals = MaxApprovals; + type OnSlash = (); + type PalletId = TreasuryPalletId; + type ProposalBond = (); + type ProposalBondMaximum = (); + type ProposalBondMinimum = (); + type RejectOrigin = frame_system::EnsureRoot; + type RuntimeEvent = RuntimeEvent; + type SpendFunds = (); + type SpendOrigin = frame_support::traits::NeverEnsureOrigin; + type SpendPeriod = (); + type WeightInfo = (); + } + + pub struct OneAuthor; + impl FindAuthor for OneAuthor { + fn find_author<'a, I>(_: I) -> Option + where + I: 'a, + { + Some(TEST_ACCOUNT) + } + } + impl pallet_authorship::Config for Runtime { + type EventHandler = (); + type FindAuthor = OneAuthor; + } + + fn new_test_ext() -> TestExternalities { + let mut t = frame_system::GenesisConfig::default() + .build_storage::() + .unwrap(); + + pallet_balances::GenesisConfig::::default() + .assimilate_storage(&mut t) + .unwrap(); + + TestExternalities::new(t) + } + + #[test] + fn test_fees_and_tip_split() { + new_test_ext().execute_with(|| { + const FEE: u64 = 10; + const TIP: u64 = 20; + + let fee = Balances::issue(FEE); + let tip = Balances::issue(TIP); + + assert_eq!(Balances::free_balance(Treasury::account_id()), 0); + assert_eq!(Balances::free_balance(TEST_ACCOUNT), 0); + + DealWithFees::on_unbalanceds(vec![fee, tip].into_iter()); + + assert_eq!( + Balances::free_balance(Treasury::account_id()), + TREASURY_FEE_RATIO * FEE + ); + assert_eq!( + Balances::free_balance(TEST_ACCOUNT), + TIP + (Perbill::one() - TREASURY_FEE_RATIO) * FEE + ); + }); + } +} diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index a53eb904fa..766e7fddba 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -15,12 +15,10 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(test)] -mod tests; - pub mod account_conversion; pub mod apis; pub mod evm; +pub mod fees; pub mod gateway; pub mod migrations; pub mod oracle; @@ -91,92 +89,6 @@ pub mod xcm_fees { } } -pub mod fees { - use cfg_primitives::{ - constants::{CENTI_CFG, TREASURY_FEE_RATIO}, - types::Balance, - }; - use frame_support::{ - traits::{Currency, Imbalance, OnUnbalanced}, - weights::{ - constants::ExtrinsicBaseWeight, WeightToFeeCoefficient, WeightToFeeCoefficients, - WeightToFeePolynomial, - }, - }; - use smallvec::smallvec; - use sp_arithmetic::Perbill; - - pub type NegativeImbalance = as Currency< - ::AccountId, - >>::NegativeImbalance; - - struct ToAuthor(sp_std::marker::PhantomData); - impl OnUnbalanced> for ToAuthor - where - R: pallet_balances::Config + pallet_authorship::Config, - { - fn on_nonzero_unbalanced(amount: NegativeImbalance) { - if let Some(author) = >::author() { - >::resolve_creating(&author, amount); - } - } - } - - pub struct DealWithFees(sp_std::marker::PhantomData); - impl OnUnbalanced> for DealWithFees - where - R: pallet_balances::Config + pallet_treasury::Config + pallet_authorship::Config, - pallet_treasury::Pallet: OnUnbalanced>, - { - fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { - if let Some(fees) = fees_then_tips.next() { - // for fees, split the destination - let (treasury_amount, mut author_amount) = fees.ration( - TREASURY_FEE_RATIO.deconstruct(), - (Perbill::one() - TREASURY_FEE_RATIO).deconstruct(), - ); - if let Some(tips) = fees_then_tips.next() { - // for tips, if any, 100% to author - tips.merge_into(&mut author_amount); - } - - use pallet_treasury::Pallet as Treasury; - as OnUnbalanced<_>>::on_unbalanced(treasury_amount); - as OnUnbalanced<_>>::on_unbalanced(author_amount); - } - } - } - - /// Handles converting a weight scalar to a fee value, based on the scale - /// and granularity of the node's balance type. - /// - /// This should typically create a mapping between the following ranges: - /// - [0, frame_system::MaximumBlockWeight] - /// - [Balance::min, Balance::max] - /// - /// Yet, it can be used for any other sort of change to weight-fee. Some - /// examples being: - /// - Setting it to `0` will essentially disable the weight fee. - /// - Setting it to `1` will cause the literal `#[weight = x]` values to - /// be charged. - pub struct WeightToFee; - impl WeightToFeePolynomial for WeightToFee { - type Balance = Balance; - - fn polynomial() -> WeightToFeeCoefficients { - let p = CENTI_CFG; - let q = 10 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); - - smallvec!(WeightToFeeCoefficient { - degree: 1, - negative: false, - coeff_frac: Perbill::from_rational(p % q, q), - coeff_integer: p / q, - }) - } - } -} - /// AssetRegistry's AssetProcessor pub mod asset_registry { use cfg_primitives::types::{AccountId, Balance}; diff --git a/runtime/common/src/tests/mock.rs b/runtime/common/src/tests/mock.rs deleted file mode 100644 index 73a2a001e7..0000000000 --- a/runtime/common/src/tests/mock.rs +++ /dev/null @@ -1,132 +0,0 @@ -use cfg_primitives::AccountId; -use frame_support::{parameter_types, traits::FindAuthor, PalletId}; -use sp_core::{ConstU64, H256}; -use sp_io::TestExternalities; -use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, -}; -use sp_std::convert::{TryFrom, TryInto}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; -type Block = frame_system::mocking::MockBlock; -const TEST_ACCOUNT: AccountId = AccountId::new([1; 32]); - -frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Authorship: pallet_authorship::{Pallet, Storage}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, - } -); - -parameter_types! { - pub const BlockHashCount: u64 = 250; -} - -impl frame_system::Config for Runtime { - type AccountData = pallet_balances::AccountData; - type AccountId = AccountId; - type BaseCallFilter = frame_support::traits::Everything; - type BlockHashCount = BlockHashCount; - type BlockLength = (); - type BlockNumber = u64; - type BlockWeights = (); - type DbWeight = (); - type Hash = H256; - type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; - type Lookup = IdentityLookup; - type MaxConsumers = frame_support::traits::ConstU32<16>; - type OnKilledAccount = (); - type OnNewAccount = (); - type OnSetCode = (); - type PalletInfo = PalletInfo; - type RuntimeCall = RuntimeCall; - type RuntimeEvent = RuntimeEvent; - type RuntimeOrigin = RuntimeOrigin; - type SS58Prefix = (); - type SystemWeightInfo = (); - type Version = (); -} - -impl pallet_balances::Config for Runtime { - type AccountStore = System; - type Balance = u64; - type DustRemoval = (); - type ExistentialDeposit = ConstU64<1>; - type FreezeIdentifier = (); - type HoldIdentifier = (); - type MaxFreezes = (); - type MaxHolds = frame_support::traits::ConstU32<1>; - type MaxLocks = (); - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); -} - -parameter_types! { - pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); - pub const MaxApprovals: u32 = 100; -} - -impl pallet_treasury::Config for Runtime { - type ApproveOrigin = frame_system::EnsureRoot; - type Burn = (); - type BurnDestination = (); - type Currency = pallet_balances::Pallet; - type MaxApprovals = MaxApprovals; - type OnSlash = (); - type PalletId = TreasuryPalletId; - type ProposalBond = (); - type ProposalBondMaximum = (); - type ProposalBondMinimum = (); - type RejectOrigin = frame_system::EnsureRoot; - type RuntimeEvent = RuntimeEvent; - type SpendFunds = (); - type SpendOrigin = frame_support::traits::NeverEnsureOrigin; - type SpendPeriod = (); - type WeightInfo = (); -} - -pub struct OneAuthor; -impl FindAuthor for OneAuthor { - fn find_author<'a, I>(_: I) -> Option - where - I: 'a, - { - Some(TEST_ACCOUNT) - } -} -impl pallet_authorship::Config for Runtime { - type EventHandler = (); - type FindAuthor = OneAuthor; -} - -pub struct TestExternalitiesBuilder {} - -impl Default for TestExternalitiesBuilder { - fn default() -> Self { - Self {} - } -} - -impl TestExternalitiesBuilder { - pub(crate) fn build(self) -> TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap(); - - pallet_balances::GenesisConfig::::default() - .assimilate_storage(&mut t) - .unwrap(); - - TestExternalities::new(t) - } -} diff --git a/runtime/common/src/tests/mod.rs b/runtime/common/src/tests/mod.rs deleted file mode 100644 index 48464a8c23..0000000000 --- a/runtime/common/src/tests/mod.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2021 Centrifuge Foundation (centrifuge.io). -// This file is part of Centrifuge chain project. - -// Centrifuge 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 (see http://www.gnu.org/licenses). - -// Centrifuge 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. - -use cfg_primitives::{AccountId, TREASURY_FEE_RATIO}; -use frame_support::traits::{Currency, OnUnbalanced}; -use mock::*; -use sp_runtime::Perbill; - -use super::fees::*; - -mod mock; - -const TEST_ACCOUNT: AccountId = AccountId::new([1; 32]); - -#[test] -fn test_fees_and_tip_split() { - TestExternalitiesBuilder::default() - .build() - .execute_with(|| { - const FEE: u64 = 10; - const TIP: u64 = 20; - - let fee = Balances::issue(FEE); - let tip = Balances::issue(TIP); - - assert_eq!(Balances::free_balance(Treasury::account_id()), 0); - assert_eq!(Balances::free_balance(TEST_ACCOUNT), 0); - - DealWithFees::on_unbalanceds(vec![fee, tip].into_iter()); - - assert_eq!( - Balances::free_balance(Treasury::account_id()), - TREASURY_FEE_RATIO * FEE - ); - assert_eq!( - Balances::free_balance(TEST_ACCOUNT), - TIP + (Perbill::one() - TREASURY_FEE_RATIO) * FEE - ); - }); -} diff --git a/runtime/development/Cargo.toml b/runtime/development/Cargo.toml index 6eb25b893e..397cd27a90 100644 --- a/runtime/development/Cargo.toml +++ b/runtime/development/Cargo.toml @@ -1,198 +1,211 @@ [package] name = "development-runtime" version = "0.10.32" -authors = ["Centrifuge "] -edition = "2021" build = "build.rs" -license = "LGPL-3.0" -homepage = "https://centrifuge.io/" -repository = "https://github.com/centrifuge/centrifuge-chain" +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +documentation.workspace = true [dependencies] -# third-party dependencies -codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] } -getrandom = { version = "0.2", features = ["js"] } -hex = { version = "0.4.3", default_features = false } -hex-literal = { version = "0.3.4", optional = true } -scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.119", optional = true } -static_assertions = "1.1.0" +codec = { package = "parity-scale-codec", workspace = true } +getrandom = { workspace = true } +hex = { workspace = true } +hex-literal = { workspace = true, optional = true } +scale-info = { workspace = true } +serde = { workspace = true, optional = true } +static_assertions = { workspace = true } -# parachain -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/cumulus", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } -parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.43" } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-aura = { workspace = true } +sp-core = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } -# polkadot dependencies -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +frame-benchmarking = { workspace = true, optional = true } # For benchmarking +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-benchmarking = { workspace = true, optional = true } # For benchmarking +frame-system-rpc-runtime-api = { workspace = true } +frame-try-runtime = { workspace = true, optional = true } # For try-runtime -# primitives -sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +cumulus-pallet-session-benchmarking = { workspace = true, optional = true } # For benchmarking +cumulus-primitives-core = { workspace = true } +cumulus-primitives-timestamp = { workspace = true } +cumulus-primitives-utility = { workspace = true } -# frame dependencies -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, features = [ - "tuples-96", -], branch = "polkadot-v0.9.43" } # tuples feature can be remove on 0.9.42 -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-identity = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-preimage = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, features = ["historical"], branch = "polkadot-v0.9.43" } -pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-vesting = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +polkadot-parachain = { workspace = true } +polkadot-runtime-common = { workspace = true } -# orml pallets -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } +xcm-primitives = { workspace = true } -# frontier pallets -fp-rpc = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -fp-self-contained = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-base-fee = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-ethereum = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-chain-id = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-precompile-dispatch = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } +orml-traits = { workspace = true } +orml-xcm-support = { workspace = true } -cfg-primitives = { path = "../../libs/primitives", default-features = false } -cfg-traits = { path = "../../libs/traits", default-features = false } -cfg-types = { path = "../../libs/types", default-features = false } -runtime-common = { path = "../common", default-features = false } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true } -# bridge pallets -chainbridge = { git = "https://github.com/centrifuge/chainbridge-substrate.git", default-features = false, branch = "polkadot-v0.9.43" } +moonbeam-relay-encoder = { workspace = true } -# our custom pallets -axelar-gateway-precompile = { path = "../../pallets/liquidity-pools-gateway/axelar-gateway-precompile", default-features = false } -liquidity-pools-gateway-routers = { path = "../../pallets/liquidity-pools-gateway/routers", default-features = false } -pallet-anchors = { path = "../../pallets/anchors", default-features = false } -pallet-block-rewards = { path = "../../pallets/block-rewards", default-features = false } -pallet-bridge = { path = "../../pallets/bridge", default-features = false } -pallet-claims = { path = "../../pallets/claims", default-features = false } -pallet-collator-allowlist = { path = "../../pallets/collator-allowlist", default-features = false } -pallet-crowdloan-claim = { path = "../../pallets/crowdloan-claim", default-features = false } -pallet-crowdloan-reward = { path = "../../pallets/crowdloan-reward", default-features = false } -pallet-data-collector = { path = "../../pallets/data-collector", default-features = false } -pallet-ethereum-transaction = { path = "../../pallets/ethereum-transaction", default-features = false } -pallet-fees = { path = "../../pallets/fees", default-features = false } -pallet-foreign-investments = { path = "../../pallets/foreign-investments", default-features = false } -pallet-interest-accrual = { path = "../../pallets/interest-accrual", default-features = false } -pallet-investments = { path = "../../pallets/investments", default-features = false } -pallet-keystore = { path = "../../pallets/keystore", default-features = false } -pallet-liquidity-pools = { path = "../../pallets/liquidity-pools", default-features = false } -pallet-liquidity-pools-gateway = { path = "../../pallets/liquidity-pools-gateway", default-features = false } -pallet-liquidity-rewards = { path = "../../pallets/liquidity-rewards", default-features = false } -pallet-loans = { path = "../../pallets/loans", default-features = false } -pallet-migration-manager = { path = "../../pallets/migration", default-features = false } -pallet-nft = { path = "../../pallets/nft", default-features = false } -pallet-nft-sales = { path = "../../pallets/nft-sales", default-features = false } -pallet-order-book = { path = "../../pallets/order-book", default-features = false } -pallet-permissions = { path = "../../pallets/permissions", default-features = false } -pallet-pool-registry = { path = "../../pallets/pool-registry", default-features = false } -pallet-pool-system = { path = "../../pallets/pool-system", default-features = false } -pallet-restricted-tokens = { path = "../../pallets/restricted-tokens", default-features = false } -pallet-rewards = { path = "../../pallets/rewards", default-features = false } -pallet-transfer-allowlist = { path = "../../pallets/transfer-allowlist", default-features = false } +# Locals +cfg-primitives = { workspace = true } +cfg-traits = { workspace = true } +cfg-types = { workspace = true } +liquidity-pools-gateway-routers = { workspace = true } +runtime-common = { workspace = true } -# LiquidityPools 3rd-party dependencies -moonbeam-relay-encoder = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } -pallet-xcm-transactor = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } -xcm-primitives = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } +# Pallet list +axelar-gateway-precompile = { workspace = true } +chainbridge = { workspace = true } +cumulus-pallet-aura-ext = { workspace = true } +cumulus-pallet-dmp-queue = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +orml-asset-registry = { workspace = true } +orml-oracle = { workspace = true } +orml-tokens = { workspace = true } +orml-xcm = { workspace = true } +orml-xtokens = { workspace = true } +pallet-anchors = { workspace = true } +pallet-aura = { workspace = true } +pallet-authorship = { workspace = true } +pallet-balances = { workspace = true } +pallet-base-fee = { workspace = true } +pallet-block-rewards = { workspace = true } +pallet-bridge = { workspace = true } +pallet-claims = { workspace = true } +pallet-collator-allowlist = { workspace = true } +pallet-collator-selection = { workspace = true } +pallet-collective = { workspace = true } +pallet-crowdloan-claim = { workspace = true } +pallet-crowdloan-reward = { workspace = true } +pallet-data-collector = { workspace = true } +pallet-democracy = { workspace = true } +pallet-elections-phragmen = { workspace = true } +pallet-ethereum = { workspace = true } +pallet-ethereum-transaction = { workspace = true } +pallet-evm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-fees = { workspace = true } +pallet-foreign-investments = { workspace = true } +pallet-identity = { workspace = true } +pallet-interest-accrual = { workspace = true } +pallet-investments = { workspace = true } +pallet-keystore = { workspace = true } +pallet-liquidity-pools = { workspace = true } +pallet-liquidity-pools-gateway = { workspace = true } +pallet-liquidity-rewards = { workspace = true } +pallet-loans = { workspace = true } +pallet-membership = { workspace = true } +pallet-migration-manager = { workspace = true } +pallet-multisig = { workspace = true } +pallet-nft = { workspace = true } +pallet-nft-sales = { workspace = true } +pallet-order-book = { workspace = true } +pallet-permissions = { workspace = true } +pallet-pool-registry = { workspace = true } +pallet-pool-system = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-restricted-tokens = { workspace = true } +pallet-rewards = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-session = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transfer-allowlist = { workspace = true } +pallet-treasury = { workspace = true } +pallet-uniques = { workspace = true } +pallet-utility = { workspace = true } +pallet-vesting = { workspace = true } +pallet-xcm = { workspace = true } +pallet-xcm-transactor = { workspace = true } +parachain-info = { workspace = true } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +substrate-wasm-builder = { workspace = true } [features] default = ["std"] -instant-voting = [] -fast-runtime = [] + std = [ - "axelar-gateway-precompile/std", + "codec/std", + "getrandom/std", + "hex/std", + "scale-info/std", + "serde/std", + + # Substrate related + "sp-api/std", + "sp-runtime/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "frame-support/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", + "frame-executive/std", + "frame-try-runtime?/std", + "frame-system-benchmarking?/std", + "frame-benchmarking?/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "cumulus-pallet-session-benchmarking?/std", + "xcm/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm-primitives/std", + "orml-traits/std", + "orml-xcm-support/std", + "fp-rpc/std", + "fp-self-contained/std", + "moonbeam-relay-encoder/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "polkadot-runtime-common/std", + "polkadot-parachain/std", + + # Locals "cfg-primitives/std", "cfg-traits/std", "cfg-types/std", + "runtime-common/std", + "liquidity-pools-gateway-routers/std", + + # Pallet list + "axelar-gateway-precompile/std", "chainbridge/std", - "chainbridge/std", - "codec/std", "cumulus-pallet-aura-ext/std", "cumulus-pallet-dmp-queue/std", "cumulus-pallet-parachain-system/std", - "cumulus-pallet-session-benchmarking/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-core/std", - "cumulus-primitives-timestamp/std", - "cumulus-primitives-utility/std", - "fp-rpc/std", - "fp-rpc/std", - "fp-self-contained/std", - "fp-self-contained/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", - - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "frame-try-runtime/std", - "getrandom/std", - "hex/std", - "liquidity-pools-gateway-routers/std", - "moonbeam-relay-encoder/std", - "moonbeam-relay-encoder/std", "orml-asset-registry/std", "orml-oracle/std", "orml-tokens/std", - "orml-traits/std", - "orml-xcm-support/std", "orml-xcm/std", "orml-xtokens/std", "pallet-anchors/std", @@ -211,26 +224,25 @@ std = [ "pallet-data-collector/std", "pallet-democracy/std", "pallet-elections-phragmen/std", - "pallet-ethereum-transaction/std", "pallet-ethereum/std", - "pallet-evm-chain-id/std", - "pallet-evm-precompile-dispatch/std", + "pallet-ethereum-transaction/std", "pallet-evm/std", + "pallet-evm-chain-id/std", "pallet-fees/std", "pallet-foreign-investments/std", "pallet-identity/std", "pallet-interest-accrual/std", "pallet-investments/std", "pallet-keystore/std", - "pallet-liquidity-pools-gateway/std", "pallet-liquidity-pools/std", + "pallet-liquidity-pools-gateway/std", "pallet-liquidity-rewards/std", "pallet-loans/std", "pallet-membership/std", "pallet-migration-manager/std", "pallet-multisig/std", - "pallet-nft-sales/std", "pallet-nft/std", + "pallet-nft-sales/std", "pallet-order-book/std", "pallet-permissions/std", "pallet-pool-registry/std", @@ -243,53 +255,46 @@ std = [ "pallet-session/std", "pallet-sudo/std", "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-transfer-allowlist/std", "pallet-treasury/std", "pallet-uniques/std", "pallet-utility/std", "pallet-vesting/std", + "pallet-xcm/std", "pallet-xcm-transactor/std", "parachain-info/std", - "polkadot-parachain/std", - "polkadot-runtime-common/std", - "runtime-common/std", - "scale-info/std", - "serde", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-inherents/std", - "sp-io/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm-primitives/std", - "xcm/std", ] runtime-benchmarks = [ - "axelar-gateway-precompile/runtime-benchmarks", + # Enabling optional + "hex-literal", + "frame-system-benchmarking/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + + # Substrate related + "sp-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", + "xcm-primitives/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", + "polkadot-parachain/runtime-benchmarks", + + # Locals "cfg-primitives/runtime-benchmarks", "cfg-traits/runtime-benchmarks", "cfg-types/runtime-benchmarks", + "runtime-common/runtime-benchmarks", + "liquidity-pools-gateway-routers/runtime-benchmarks", + + # Pallet list + "axelar-gateway-precompile/runtime-benchmarks", "chainbridge/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", - "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "liquidity-pools-gateway-routers/runtime-benchmarks", "orml-asset-registry/runtime-benchmarks", "orml-tokens/runtime-benchmarks", "orml-xtokens/runtime-benchmarks", @@ -306,8 +311,8 @@ runtime-benchmarks = [ "pallet-data-collector/runtime-benchmarks", "pallet-democracy/runtime-benchmarks", "pallet-elections-phragmen/runtime-benchmarks", - "pallet-ethereum-transaction/runtime-benchmarks", "pallet-ethereum/runtime-benchmarks", + "pallet-ethereum-transaction/runtime-benchmarks", "pallet-evm/runtime-benchmarks", "pallet-fees/runtime-benchmarks", "pallet-foreign-investments/runtime-benchmarks", @@ -315,13 +320,14 @@ runtime-benchmarks = [ "pallet-interest-accrual/runtime-benchmarks", "pallet-investments/runtime-benchmarks", "pallet-keystore/runtime-benchmarks", - "pallet-liquidity-pools-gateway/runtime-benchmarks", "pallet-liquidity-pools/runtime-benchmarks", + "pallet-liquidity-pools-gateway/runtime-benchmarks", "pallet-liquidity-rewards/runtime-benchmarks", "pallet-loans/runtime-benchmarks", "pallet-membership/runtime-benchmarks", "pallet-migration-manager/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", + "pallet-nft/runtime-benchmarks", "pallet-nft-sales/runtime-benchmarks", "pallet-order-book/runtime-benchmarks", "pallet-permissions/runtime-benchmarks", @@ -339,37 +345,37 @@ runtime-benchmarks = [ "pallet-uniques/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", - "pallet-xcm-transactor/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "runtime-common/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", - "xcm-primitives/runtime-benchmarks", + "pallet-xcm-transactor/runtime-benchmarks", ] try-runtime = [ - "axelar-gateway-precompile/try-runtime", - "cfg-primitives/try-runtime", + # Enabling optional + "frame-try-runtime/try-runtime", + + # Substrate related + "sp-runtime/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "frame-executive/try-runtime", + "fp-self-contained/try-runtime", + "polkadot-runtime-common/try-runtime", + + # Locals "cfg-primitives/try-runtime", "cfg-traits/try-runtime", - "cfg-traits/try-runtime", "cfg-types/try-runtime", + "runtime-common/try-runtime", + "liquidity-pools-gateway-routers/try-runtime", + + # Pallet list + "axelar-gateway-precompile/try-runtime", "chainbridge/try-runtime", "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-dmp-queue/try-runtime", "cumulus-pallet-parachain-system/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", - "fp-self-contained/try-runtime", - "fp-self-contained/try-runtime", - "frame-executive/try-runtime", - "frame-support/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime", - "liquidity-pools-gateway-routers/try-runtime", "orml-asset-registry/try-runtime", "orml-oracle/try-runtime", "orml-tokens/try-runtime", @@ -391,25 +397,25 @@ try-runtime = [ "pallet-data-collector/try-runtime", "pallet-democracy/try-runtime", "pallet-elections-phragmen/try-runtime", - "pallet-ethereum-transaction/try-runtime", "pallet-ethereum/try-runtime", - "pallet-evm-chain-id/try-runtime", + "pallet-ethereum-transaction/try-runtime", "pallet-evm/try-runtime", + "pallet-evm-chain-id/try-runtime", "pallet-fees/try-runtime", "pallet-foreign-investments/try-runtime", "pallet-identity/try-runtime", "pallet-interest-accrual/try-runtime", "pallet-investments/try-runtime", "pallet-keystore/try-runtime", - "pallet-liquidity-pools-gateway/try-runtime", "pallet-liquidity-pools/try-runtime", + "pallet-liquidity-pools-gateway/try-runtime", "pallet-liquidity-rewards/try-runtime", "pallet-loans/try-runtime", "pallet-membership/try-runtime", "pallet-migration-manager/try-runtime", "pallet-multisig/try-runtime", - "pallet-nft-sales/try-runtime", "pallet-nft/try-runtime", + "pallet-nft-sales/try-runtime", "pallet-order-book/try-runtime", "pallet-permissions/try-runtime", "pallet-pool-registry/try-runtime", @@ -428,12 +434,9 @@ try-runtime = [ "pallet-uniques/try-runtime", "pallet-utility/try-runtime", "pallet-vesting/try-runtime", - "pallet-xcm-transactor/try-runtime", "pallet-xcm/try-runtime", + "pallet-xcm-transactor/try-runtime", "parachain-info/try-runtime", - "polkadot-runtime-common/try-runtime", - "runtime-common/try-runtime", - "sp-runtime/try-runtime", ] # A feature that should be enabled when the runtime should be build for on-chain @@ -441,4 +444,11 @@ try-runtime = [ # to make it smaller like logging for example. on-chain-release-build = [ "sp-api/disable-logging", + "runtime-common/on-chain-release-build", ] + +# Used by integration testing +instant-voting = [] + +# Set timing constants (e.g. session period) to faster versions to speed up testing. +fast-runtime = [] diff --git a/runtime/development/src/lib.rs b/runtime/development/src/lib.rs index 19e314dd37..e826c70794 100644 --- a/runtime/development/src/lib.rs +++ b/runtime/development/src/lib.rs @@ -2107,7 +2107,7 @@ impl_runtime_apis! { } fn metadata_at_version(version: u32) -> Option { Runtime::metadata_at_version(version) } - fn metadata_versions() -> frame_benchmarking::Vec { Runtime::metadata_versions() } + fn metadata_versions() -> sp_std::vec::Vec { Runtime::metadata_versions() } } impl sp_block_builder::BlockBuilder for Runtime { diff --git a/runtime/integration-tests/Cargo.toml b/runtime/integration-tests/Cargo.toml index e3fcd8915b..3094845c8e 100644 --- a/runtime/integration-tests/Cargo.toml +++ b/runtime/integration-tests/Cargo.toml @@ -1,249 +1,159 @@ [package] name = "runtime-integration-tests" version = "0.1.0" -authors = ["Centrifuge "] -edition = "2021" -license = "LGPL-3.0" -homepage = "https://centrifuge.io/" -repository = "https://github.com/centrifuge/centrifuge-chain" +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +documentation.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] } -fudge = { git = "https://github.com/centrifuge/fudge", branch = "polkadot-v0.9.43" } -fudge-core = { git = "https://github.com/centrifuge/fudge", branch = "polkadot-v0.9.43" } -lazy_static = "1.4.0" -serde = { version = "1.0.119" } -thiserror = "1.0.30" -tokio = { version = "1.15", features = ["macros"] } -tracing-subscriber = "0.2" - -# Substrate -## Substrate-Frame -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-beefy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-message-queue = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } - -## Substrate-Primitives -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -#sp-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -fp-self-contained = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v0.9.43" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-consensus-beefy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } - -## Substrate-Client -node-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -#sc-consensus-uncles = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sc-service = { git = "https://github.com/paritytech/substrate", features = ["rocksdb", "test-helpers"], branch = "polkadot-v0.9.43" } - -# Polkadot -kusama-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -rococo-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" } - -# Cumulus -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" } -cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" } - -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" } - -# Orml pallets -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.43" } -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.43" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.43" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.43" } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.43" } - -# Local -altair-runtime = { path = "../altair" } -centrifuge-runtime = { path = "../centrifuge" } -cfg-primitives = { path = "../../libs/primitives" } -cfg-traits = { path = "../../libs/traits" } -development-runtime = { path = "../development" } -runtime-common = { path = "../common" } - -[dev-dependencies] -getrandom = { version = "0.2", features = ["js"] } -hex = { version = "0.4.3", default_features = false } - -cfg-traits = { path = "../../libs/traits" } -cfg-types = { path = "../../libs/types" } -cfg-utils = { path = "../../libs/utils" } - -ethabi = { version = "16.0", default-features = false } -ethereum = { version = "0.14.0", default-features = false } - -pallet-ethereum = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } -pallet-evm-chain-id = { git = "https://github.com/moonbeam-foundation/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.43" } - -axelar-gateway-precompile = { path = "../../pallets/liquidity-pools-gateway/axelar-gateway-precompile" } -liquidity-pools-gateway-routers = { path = "../../pallets/liquidity-pools-gateway/routers" } -pallet-block-rewards = { path = "../../pallets/block-rewards" } -pallet-ethereum-transaction = { path = "../../pallets/ethereum-transaction" } -pallet-foreign-investments = { path = "../../pallets/foreign-investments" } -pallet-investments = { path = "../../pallets/investments" } -pallet-liquidity-pools = { path = "../../pallets/liquidity-pools" } -pallet-liquidity-pools-gateway = { path = "../../pallets/liquidity-pools-gateway" } -pallet-loans = { path = "../../pallets/loans" } -pallet-order-book = { path = "../../pallets/order-book" } -pallet-permissions = { path = "../../pallets/permissions" } -pallet-pool-registry = { path = "../../pallets/pool-registry" } -pallet-pool-system = { path = "../../pallets/pool-system" } -pallet-restricted-tokens = { path = "../../pallets/restricted-tokens" } -pallet-rewards = { path = "../../pallets/rewards" } - -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -pallet-xcm-transactor = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "96ac7576f93bb6828415bf3edeef9e8c4b5b4adf" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.43" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = true, branch = "release-v0.9.43" } - -pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" } +codec = { package = "parity-scale-codec", workspace = true } +ethabi = { workspace = true, features = ["std"] } +ethereum = { workspace = true, features = ["std"] } +fudge = { workspace = true } +fudge-core = { workspace = true } +getrandom = { workspace = true } +hex = { workspace = true } +lazy_static = { workspace = true } +serde = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true } +tracing-subscriber = { workspace = true } + +node-primitives = { workspace = true, features = ["std"] } +sc-block-builder = { workspace = true } +sc-client-api = { workspace = true } +sc-executor = { workspace = true, features = ["std"] } +sc-service = { workspace = true, features = ["rocksdb", "test-helpers"] } + +sp-api = { workspace = true, features = ["std"] } +sp-block-builder = { workspace = true, features = ["std"] } +sp-consensus-aura = { workspace = true, features = ["std"] } +sp-consensus-babe = { workspace = true, features = ["std"] } +sp-consensus-beefy = { workspace = true, features = ["std"] } +sp-consensus-slots = { workspace = true, features = ["std"] } +sp-core = { workspace = true, features = ["std"] } +sp-inherents = { workspace = true, features = ["std"] } +sp-io = { workspace = true, features = ["std"] } +sp-runtime = { workspace = true, features = ["std"] } +sp-std = { workspace = true, features = ["std"] } +sp-timestamp = { workspace = true, features = ["std"] } +sp-tracing = { workspace = true, features = ["std"] } +sp-transaction-pool = { workspace = true, features = ["std"] } + +frame-support = { workspace = true, features = ["std"] } +frame-system = { workspace = true, features = ["std"] } + +cumulus-primitives-core = { workspace = true, features = ["std"] } +cumulus-primitives-parachain-inherent = { workspace = true, features = ["std"] } +cumulus-test-relay-sproof-builder = { workspace = true, features = ["std"] } + +kusama-runtime = { workspace = true, features = ["std"] } +polkadot-core-primitives = { workspace = true, features = ["std"] } +polkadot-parachain = { workspace = true, features = ["std"] } +polkadot-primitives = { workspace = true, features = ["std"] } +polkadot-runtime = { workspace = true, features = ["std"] } +polkadot-runtime-common = { workspace = true, features = ["std"] } +polkadot-runtime-parachains = { workspace = true, features = ["std"] } +rococo-runtime = { workspace = true, features = ["std"] } + +pallet-babe = { workspace = true, features = ["std"] } +pallet-grandpa = { workspace = true, features = ["std"] } +pallet-im-online = { workspace = true, features = ["std"] } + +xcm = { workspace = true, features = ["std"] } +xcm-executor = { workspace = true, features = ["std"] } + +orml-traits = { workspace = true, features = ["std"] } + +fp-self-contained = { workspace = true, features = ["std"] } + +# Locals +altair-runtime = { workspace = true, features = ["std"] } +centrifuge-runtime = { workspace = true, features = ["std"] } +cfg-primitives = { workspace = true, features = ["std"] } +cfg-traits = { workspace = true, features = ["std"] } +cfg-types = { workspace = true, features = ["std"] } +cfg-utils = { workspace = true, features = ["std"] } +development-runtime = { workspace = true, features = ["std"] } +liquidity-pools-gateway-routers = { workspace = true, features = ["std"] } +runtime-common = { workspace = true, features = ["std"] } + +# Pallet list +axelar-gateway-precompile = { workspace = true, features = ["std"] } +chainbridge = { workspace = true, features = ["std"] } +cumulus-pallet-aura-ext = { workspace = true, features = ["std"] } +cumulus-pallet-dmp-queue = { workspace = true, features = ["std"] } +cumulus-pallet-parachain-system = { workspace = true, features = ["std"] } +cumulus-pallet-xcm = { workspace = true, features = ["std"] } +cumulus-pallet-xcmp-queue = { workspace = true, features = ["std"] } +orml-asset-registry = { workspace = true, features = ["std"] } +orml-oracle = { workspace = true, features = ["std"] } +orml-tokens = { workspace = true, features = ["std"] } +orml-xcm = { workspace = true, features = ["std"] } +orml-xtokens = { workspace = true, features = ["std"] } +pallet-anchors = { workspace = true, features = ["std"] } +pallet-aura = { workspace = true, features = ["std"] } +pallet-authorship = { workspace = true, features = ["std"] } +pallet-balances = { workspace = true, features = ["std"] } +pallet-base-fee = { workspace = true, features = ["std"] } +pallet-block-rewards = { workspace = true, features = ["std"] } +pallet-bridge = { workspace = true, features = ["std"] } +pallet-claims = { workspace = true, features = ["std"] } +pallet-collator-allowlist = { workspace = true, features = ["std"] } +pallet-collator-selection = { workspace = true, features = ["std"] } +pallet-collective = { workspace = true, features = ["std"] } +pallet-crowdloan-claim = { workspace = true, features = ["std"] } +pallet-crowdloan-reward = { workspace = true, features = ["std"] } +pallet-data-collector = { workspace = true, features = ["std"] } +pallet-democracy = { workspace = true, features = ["std"] } +pallet-elections-phragmen = { workspace = true, features = ["std"] } +pallet-ethereum = { workspace = true, features = ["std"] } +pallet-ethereum-transaction = { workspace = true, features = ["std"] } +pallet-evm = { workspace = true, features = ["std"] } +pallet-evm-chain-id = { workspace = true, features = ["std"] } +pallet-fees = { workspace = true, features = ["std"] } +pallet-foreign-investments = { workspace = true, features = ["std"] } +pallet-identity = { workspace = true, features = ["std"] } +pallet-interest-accrual = { workspace = true, features = ["std"] } +pallet-investments = { workspace = true, features = ["std"] } +pallet-keystore = { workspace = true, features = ["std"] } +pallet-liquidity-pools = { workspace = true, features = ["std"] } +pallet-liquidity-pools-gateway = { workspace = true, features = ["std"] } +pallet-liquidity-rewards = { workspace = true, features = ["std"] } +pallet-loans = { workspace = true, features = ["std"] } +pallet-membership = { workspace = true, features = ["std"] } +pallet-migration-manager = { workspace = true, features = ["std"] } +pallet-multisig = { workspace = true, features = ["std"] } +pallet-nft = { workspace = true, features = ["std"] } +pallet-nft-sales = { workspace = true, features = ["std"] } +pallet-order-book = { workspace = true, features = ["std"] } +pallet-permissions = { workspace = true, features = ["std"] } +pallet-pool-registry = { workspace = true, features = ["std"] } +pallet-pool-system = { workspace = true, features = ["std"] } +pallet-preimage = { workspace = true, features = ["std"] } +pallet-proxy = { workspace = true, features = ["std"] } +pallet-restricted-tokens = { workspace = true, features = ["std"] } +pallet-rewards = { workspace = true, features = ["std"] } +pallet-scheduler = { workspace = true, features = ["std"] } +pallet-session = { workspace = true, features = ["std"] } +pallet-sudo = { workspace = true, features = ["std"] } +pallet-timestamp = { workspace = true, features = ["std"] } +pallet-transaction-payment = { workspace = true, features = ["std"] } +pallet-transfer-allowlist = { workspace = true, features = ["std"] } +pallet-treasury = { workspace = true, features = ["std"] } +pallet-uniques = { workspace = true, features = ["std"] } +pallet-utility = { workspace = true, features = ["std"] } +pallet-vesting = { workspace = true, features = ["std"] } +pallet-xcm = { workspace = true, features = ["std"] } +pallet-xcm-transactor = { workspace = true, features = ["std"] } +parachain-info = { workspace = true, features = ["std"] } [features] default = [ - "runtime-development", "development-runtime/instant-voting", ] -fast-runtime = ["development-runtime/fast-runtime"] -std = [ - "altair-runtime/std", - "centrifuge-runtime/std", - "cfg-primitives/std", - "codec/std", - "cumulus-pallet-parachain-system/std", - "cumulus-primitives-core/std", - "cumulus-primitives-parachain-inherent/std", - "cumulus-test-relay-sproof-builder/std", - "development-runtime/std", - "ethabi/std", - "fp-self-contained/std", - "frame-benchmarking/std", - "frame-support/std", - "frame-system/std", - "getrandom/std", - "kusama-runtime/std", - "node-primitives/std", - "orml-asset-registry/std", - "orml-oracle/std", - "orml-tokens/std", - "orml-traits/std", - "orml-xtokens/std", - "pallet-aura/std", - "pallet-authorship/std", - "pallet-balances/std", - "pallet-collective/std", - "pallet-democracy/std", - "pallet-beefy/std", - "pallet-foreign-investments/std", - "pallet-investments/std", - "pallet-message-queue/std", - "pallet-order-book/std", - "pallet-preimage/std", - "pallet-timestamp/std", - "pallet-transaction-payment/std", - "pallet-treasury/std", - "pallet-uniques/std", - "pallet-xcm/std", - "parachain-info/std", - "polkadot-core-primitives/std", - "polkadot-parachain/std", - "polkadot-primitives/std", - "polkadot-runtime-common/std", - "polkadot-runtime-parachains/std", - "polkadot-runtime/std", - "rococo-runtime/std", - "runtime-common/std", - "sc-executor/std", - "serde/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-consensus-babe/std", - "sp-consensus-slots/std", - "sp-core/std", - "sp-inherents/std", - "sp-runtime/std", - "sp-timestamp/std", - "sp-tracing/std", - "sp-transaction-pool/std", - "xcm/std", -] -runtime-benchmarks = [ - "altair-runtime/runtime-benchmarks", - "centrifuge-runtime/runtime-benchmarks", - "cfg-primitives/runtime-benchmarks", - "cumulus-pallet-parachain-system/runtime-benchmarks", - "default", - "development-runtime/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "fudge/runtime-benchmarks", - "kusama-runtime/runtime-benchmarks", - "orml-asset-registry/runtime-benchmarks", - "orml-tokens/runtime-benchmarks", - "orml-xtokens/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-collective/runtime-benchmarks", - "pallet-democracy/runtime-benchmarks", - "pallet-foreign-investments/runtime-benchmarks", - "pallet-investments/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", - "pallet-order-book/runtime-benchmarks", - "pallet-preimage/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-treasury/runtime-benchmarks", - "pallet-uniques/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", - "polkadot-primitives/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "polkadot-runtime-parachains/runtime-benchmarks", - "polkadot-runtime/runtime-benchmarks", - "rococo-runtime/runtime-benchmarks", - "runtime-common/runtime-benchmarks", - "sc-service/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", -] -runtime-development = [] -runtime-altair = [] -runtime-centrifuge = [] +fast-runtime = ["development-runtime/fast-runtime"] diff --git a/runtime/integration-tests/src/utils/extrinsics.rs b/runtime/integration-tests/src/utils/extrinsics.rs index 84ec5819c8..54d2c792c6 100644 --- a/runtime/integration-tests/src/utils/extrinsics.rs +++ b/runtime/integration-tests/src/utils/extrinsics.rs @@ -151,8 +151,6 @@ fn signed_extra_relay(nonce: RelayIndex) -> RelaySignedExtra { frame_system::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), pallet_transaction_payment::ChargeTransactionPayment::::from(0), - #[cfg(not(feature = "runtime-development"))] - polkadot_runtime_common::claims::PrevalidateAttests::::new(), ) } diff --git a/scripts/runtime-weight-template.hbs b/scripts/runtime-weight-template.hbs deleted file mode 100644 index b4b436d761..0000000000 --- a/scripts/runtime-weight-template.hbs +++ /dev/null @@ -1,47 +0,0 @@ -//! Autogenerated weights for {{pallet}} -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} -//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` -//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} - -// Executed Command: -{{#each args as |arg|~}} -// {{arg}} -{{/each}} - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; -use {{pallet}}::weights::WeightInfo; - -/// Weights for {{pallet}} using the Substrate node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl WeightInfo for SubstrateWeight { - {{~#each benchmarks as |benchmark|}} - fn {{benchmark.name~}} - ( - {{~#each benchmark.components as |c| ~}} - {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} - ) -> Weight { - Weight::from_ref_time({{underscore benchmark.base_weight}}) - {{~#each benchmark.component_weight as |cw|}} - // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}} as u64)) - {{~/each}} - {{~#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64)) - {{~/if}} - {{~#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}}as u64))) - {{~/each}} - {{~#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64)) - {{~/if}} - {{~#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) - {{~/each}} - } - {{~/each}} -} \ No newline at end of file