From f65a4803ad652f2320c2d596eb398f7cbcf3cb04 Mon Sep 17 00:00:00 2001 From: Marian Vanderka Date: Thu, 5 Dec 2024 18:43:32 +0100 Subject: [PATCH] Fix/rewards market GASP-1681 (#855) --- Cargo.lock | 272 +++++++++--------- Cargo.toml | 265 +++++++++-------- pallets/bootstrap/src/mock.rs | 29 +- pallets/fee-lock/Cargo.toml | 1 + pallets/fee-lock/src/benchmarking.rs | 8 +- pallets/fee-lock/src/lib.rs | 44 ++- pallets/fee-lock/src/mock.rs | 70 ++--- pallets/fee-lock/src/tests.rs | 93 +----- pallets/market/src/lib.rs | 92 +++++- pallets/parachain-staking/src/lib.rs | 34 ++- pallets/parachain-staking/src/mock.rs | 77 +++-- pallets/proof-of-stake/src/benchmarking.rs | 14 +- pallets/proof-of-stake/src/lib.rs | 84 ++---- pallets/proof-of-stake/src/mock.rs | 96 ++++--- pallets/proof-of-stake/src/tests.rs | 192 +++++++------ pallets/stable-swap/src/lib.rs | 36 +-- pallets/xyk/Cargo.toml | 1 + pallets/xyk/src/lib.rs | 18 +- pallets/xyk/src/mock.rs | 28 +- pallets/xyk/src/tests.rs | 6 + .../integration-test/src/proof_of_stake.rs | 6 +- rollup/runtime/src/lib.rs | 19 +- rollup/runtime/src/runtime_config.rs | 9 + 23 files changed, 757 insertions(+), 737 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3bbb0e1c26..391fac45e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2565,7 +2565,7 @@ dependencies = [ [[package]] name = "extrinsic-shuffler" version = "4.0.0-dev" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "derive_more", "log", @@ -2748,7 +2748,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "12.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", ] @@ -2771,7 +2771,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-support", "frame-support-procedural", @@ -2796,7 +2796,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "32.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "Inflector", "array-bytes 6.2.3", @@ -2850,7 +2850,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "aquamarine 0.3.3", "extrinsic-shuffler", @@ -2906,7 +2906,7 @@ dependencies = [ [[package]] name = "frame-support" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "aquamarine 0.5.0", "array-bytes 6.2.3", @@ -2948,7 +2948,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "23.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "Inflector", "cfg-expr", @@ -2967,7 +2967,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "10.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.2.0", @@ -2979,7 +2979,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "11.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "proc-macro2", "quote", @@ -2989,7 +2989,7 @@ dependencies = [ [[package]] name = "frame-system" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "cfg-if", "docify", @@ -3011,7 +3011,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -3026,7 +3026,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "sp-api", @@ -3035,7 +3035,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.34.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-support", "parity-scale-codec", @@ -3654,7 +3654,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.14", - "socket2 0.4.10", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -4937,7 +4937,7 @@ dependencies = [ [[package]] name = "mangata-support" version = "0.1.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-support", "mangata-types", @@ -4950,7 +4950,7 @@ dependencies = [ [[package]] name = "mangata-types" version = "0.1.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "scale-info", @@ -5652,7 +5652,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "27.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-support", "frame-system", @@ -5669,7 +5669,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-support", "frame-system", @@ -5684,7 +5684,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5708,7 +5708,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "docify", "frame-benchmarking", @@ -5756,7 +5756,7 @@ dependencies = [ [[package]] name = "pallet-collective-mangata" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5809,6 +5809,7 @@ dependencies = [ "log", "mangata-support", "mangata-types", + "mockall", "orml-tokens", "orml-traits", "pallet-xyk", @@ -5827,7 +5828,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5850,7 +5851,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5947,7 +5948,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6049,7 +6050,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6126,7 +6127,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6171,7 +6172,7 @@ dependencies = [ [[package]] name = "pallet-sudo-mangata" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "docify", "frame-benchmarking", @@ -6205,7 +6206,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "27.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "docify", "frame-benchmarking", @@ -6225,7 +6226,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-support", "frame-system", @@ -6241,7 +6242,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "30.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6257,7 +6258,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6269,7 +6270,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "27.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "docify", "frame-benchmarking", @@ -6288,7 +6289,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6304,7 +6305,7 @@ dependencies = [ [[package]] name = "pallet-utility-mangata" version = "4.0.0-dev" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6320,7 +6321,7 @@ dependencies = [ [[package]] name = "pallet-vesting-mangata" version = "4.0.0-dev" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6349,6 +6350,7 @@ dependencies = [ "log", "mangata-support", "mangata-types", + "mockall", "orml-tokens", "orml-traits", "pallet-bootstrap", @@ -6407,8 +6409,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" dependencies = [ "bitcoin_hashes", - "rand 0.7.3", - "rand_core 0.5.1", + "rand 0.8.5", + "rand_core 0.6.4", "serde", "unicode-normalization", ] @@ -8144,7 +8146,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "23.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "log", "sp-core", @@ -8155,7 +8157,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship-ver" version = "0.10.0-dev" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "aquamarine 0.3.3", "futures", @@ -8181,7 +8183,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "sp-api", @@ -8196,7 +8198,7 @@ dependencies = [ [[package]] name = "sc-block-builder-ver" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "aquamarine 0.1.12", "extrinsic-shuffler", @@ -8216,7 +8218,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "27.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "docify", @@ -8242,7 +8244,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "11.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", @@ -8253,7 +8255,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.36.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "chrono", @@ -8294,7 +8296,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "fnv", "futures", @@ -8321,7 +8323,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.35.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "hash-db", "kvdb", @@ -8347,7 +8349,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "futures", @@ -8372,7 +8374,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.34.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "futures", @@ -8401,7 +8403,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.19.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "ahash 0.8.11", "array-bytes 6.2.3", @@ -8444,7 +8446,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "futures", @@ -8469,7 +8471,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.32.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -8492,7 +8494,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.29.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "polkavm", "sc-allocator", @@ -8505,7 +8507,7 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" version = "0.29.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "log", "polkavm", @@ -8516,7 +8518,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.29.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "anyhow", "cfg-if", @@ -8534,7 +8536,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "ansi_term", "futures", @@ -8551,7 +8553,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "25.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "parking_lot 0.12.3", @@ -8565,7 +8567,7 @@ dependencies = [ [[package]] name = "sc-mixnet" version = "0.4.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 4.2.0", "arrayvec 0.7.6", @@ -8594,7 +8596,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.34.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "async-channel", @@ -8637,7 +8639,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-channel", "cid", @@ -8657,7 +8659,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -8674,7 +8676,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.34.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "ahash 0.8.11", "futures", @@ -8693,7 +8695,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "async-channel", @@ -8714,7 +8716,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "async-channel", @@ -8750,7 +8752,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "futures", @@ -8769,7 +8771,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "29.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "bytes", @@ -8803,7 +8805,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.17.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8812,7 +8814,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "29.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "futures", "jsonrpsee", @@ -8844,7 +8846,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.33.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -8864,7 +8866,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "11.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "futures", "governor", @@ -8882,7 +8884,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.34.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "futures", @@ -8913,7 +8915,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.35.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "directories", @@ -8978,7 +8980,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.30.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "log", "parity-scale-codec", @@ -8989,7 +8991,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "27.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "derive_more", "futures", @@ -9010,7 +9012,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "15.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "chrono", "futures", @@ -9029,7 +9031,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "ansi_term", "chrono", @@ -9059,7 +9061,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", @@ -9070,7 +9072,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "futures", @@ -9097,7 +9099,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "futures", @@ -9113,7 +9115,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "14.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-channel", "futures", @@ -9659,7 +9661,7 @@ dependencies = [ [[package]] name = "sp-api" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "hash-db", "log", @@ -9681,7 +9683,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "15.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "Inflector", "blake2 0.10.6", @@ -9695,7 +9697,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "30.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "scale-info", @@ -9708,7 +9710,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "23.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "integer-sqrt", "num-traits", @@ -9740,7 +9742,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "sp-api", "sp-inherents", @@ -9751,7 +9753,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "futures", "log", @@ -9769,7 +9771,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.32.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "futures", @@ -9784,7 +9786,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.32.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "parity-scale-codec", @@ -9801,7 +9803,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.32.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "parity-scale-codec", @@ -9820,7 +9822,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "13.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "finality-grandpa", "log", @@ -9838,7 +9840,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.32.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "scale-info", @@ -9850,7 +9852,7 @@ dependencies = [ [[package]] name = "sp-core" version = "28.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "bandersnatch_vrfs", @@ -9918,7 +9920,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "blake2b_simd", "byteorder", @@ -9931,7 +9933,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "quote", "sp-crypto-hashing", @@ -9941,7 +9943,7 @@ dependencies = [ [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -9950,7 +9952,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "proc-macro2", "quote", @@ -9960,7 +9962,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "environmental", "parity-scale-codec", @@ -9971,7 +9973,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.7.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "serde_json", "sp-api", @@ -9982,7 +9984,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9996,7 +9998,7 @@ dependencies = [ [[package]] name = "sp-io" version = "30.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "bytes", "ed25519-dalek", @@ -10022,7 +10024,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "31.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "sp-core", "sp-runtime", @@ -10032,7 +10034,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.34.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -10043,7 +10045,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "thiserror", "zstd 0.12.4", @@ -10052,7 +10054,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.6.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -10063,7 +10065,7 @@ dependencies = [ [[package]] name = "sp-mixnet" version = "0.4.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "scale-info", @@ -10075,7 +10077,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "sp-api", "sp-core", @@ -10085,7 +10087,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "backtrace", "lazy_static", @@ -10095,7 +10097,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "rustc-hash", "serde", @@ -10105,7 +10107,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "31.0.1" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -10136,7 +10138,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10155,7 +10157,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "Inflector", "expander", @@ -10168,7 +10170,7 @@ dependencies = [ [[package]] name = "sp-session" version = "27.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "scale-info", @@ -10183,7 +10185,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10197,7 +10199,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.35.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "hash-db", "log", @@ -10218,7 +10220,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "10.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "aes-gcm", "curve25519-dalek 4.1.1", @@ -10243,12 +10245,12 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -10261,7 +10263,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "parity-scale-codec", @@ -10274,7 +10276,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "sp-std", @@ -10286,7 +10288,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "sp-api", "sp-runtime", @@ -10295,7 +10297,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "26.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "parity-scale-codec", @@ -10310,7 +10312,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "29.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "ahash 0.8.11", "hash-db", @@ -10334,7 +10336,7 @@ dependencies = [ [[package]] name = "sp-ver" version = "4.0.0-dev" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "async-trait", "parity-scale-codec", @@ -10351,7 +10353,7 @@ dependencies = [ [[package]] name = "sp-version" version = "29.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -10368,7 +10370,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "13.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10379,7 +10381,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -10392,7 +10394,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "27.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -10551,7 +10553,7 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.4.7" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -10563,12 +10565,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "hyper", "log", @@ -10593,7 +10595,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "async-trait", @@ -10620,7 +10622,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "array-bytes 6.2.3", "frame-executive", @@ -10663,7 +10665,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "futures", "sc-block-builder", @@ -10682,7 +10684,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "17.0.0" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "build-helper", "cargo_metadata", @@ -11345,7 +11347,7 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand 0.7.3", + "rand 0.8.5", "static_assertions", ] @@ -11484,7 +11486,7 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "ver-api" version = "4.0.0-dev" -source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#6268216a84f6a965f97e55e17423938d27d78fa8" +source = "git+https://github.com/gasp-xyz/polkadot-sdk?branch=eth-rollup-develop#e5bbc9b3eaa4f69cd39000bb69f6963f36dd93b8" dependencies = [ "derive_more", "frame-support", diff --git a/Cargo.toml b/Cargo.toml index 05fca9bf65..a3fe0adcdb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -196,139 +196,139 @@ sp-crypto-ec-utils = { git = "https://github.com/gasp-xyz/polkadot-sdk", branch # # patch generated by './scripts/dev_manifest.sh ../polkadot-sdk' # [patch."https://github.com/gasp-xyz/polkadot-sdk"] -# substrate-test-runtime = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# substrate-test-runtime-client = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# substrate-test-client = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-transaction-payment = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-transaction-payment-rpc = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-collective-mangata = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-proxy = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-identity = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-sudo-mangata = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# mangata-support = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-utility-mangata = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-authorship = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-grandpa = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-vesting-mangata = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-system = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-system-benchmarking = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-system-rpc-runtime-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-support = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-support-procedural = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-support-procedural-tools = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-support-procedural-tools-derive = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-balances = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-aura = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-benchmarking = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-treasury = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-try-runtime = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-timestamp = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-babe = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-membership = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-utility = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-executive = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# pallet-session = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# substrate-wasm-builder = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# fork-tree = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# substrate-build-script-utils = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# frame-benchmarking-cli = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# substrate-bip39 = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# substrate-prometheus-endpoint = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-database = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-runtime-interface = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-runtime-interface-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-consensus-grandpa = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-consensus = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-consensus-aura = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-consensus-babe = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-consensus-slots = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-tracing = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-crypto-hashing = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-crypto-hashing-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-ver = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-maybe-compressed-blob = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-core = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-state-machine = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-keystore = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-metadata-ir = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-statement-store = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-weights = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-io = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-runtime = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-inherents = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-transaction-pool = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-std = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-storage = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-panic-handler = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-debug-derive = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-blockchain = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-externalities = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-mixnet = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-trie = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# mangata-types = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-version = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-version-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-block-builder = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-keyring = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-staking = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-wasm-interface = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-transaction-storage-proof = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# extrinsic-shuffler = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-arithmetic = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-api-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-offchain = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-timestamp = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-application-crypto = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-rpc = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# ver-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-genesis-builder = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sp-session = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-consensus-grandpa = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-consensus = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-consensus-aura = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-consensus-slots = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-tracing = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-tracing-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-rpc-spec-v2 = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-state-db = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-proposer-metrics = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-keystore = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-basic-authorship-ver = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-rpc-server = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-network = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-network-bitswap = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-network-transactions = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-network-common = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-network-light = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-network-sync = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-informant = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-transaction-pool = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-transaction-pool-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-utils = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-cli = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-chain-spec = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-chain-spec-derive = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-block-builder-ver = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-mixnet = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-block-builder = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-allocator = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-network-gossip = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-client-db = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-client-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-sysinfo = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-executor = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-executor-wasmtime = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-executor-common = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-executor-polkavm = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-telemetry = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-offchain = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-service = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-rpc = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } -# sc-rpc-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/market-mint-ratio" } +# substrate-test-runtime = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# substrate-test-runtime-client = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# substrate-test-client = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-transaction-payment = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-transaction-payment-rpc = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-collective-mangata = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-proxy = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-identity = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-sudo-mangata = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# mangata-support = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-utility-mangata = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-authorship = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-grandpa = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-vesting-mangata = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-system = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-system-benchmarking = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-system-rpc-runtime-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-support = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-support-procedural = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-support-procedural-tools = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-support-procedural-tools-derive = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-balances = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-aura = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-benchmarking = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-treasury = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-try-runtime = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-timestamp = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-babe = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-membership = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-utility = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-executive = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# pallet-session = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# substrate-wasm-builder = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# fork-tree = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# substrate-build-script-utils = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# frame-benchmarking-cli = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# substrate-bip39 = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# substrate-prometheus-endpoint = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-database = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-runtime-interface = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-runtime-interface-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-consensus-grandpa = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-consensus = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-consensus-aura = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-consensus-babe = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-consensus-slots = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-tracing = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-crypto-hashing = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-crypto-hashing-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-ver = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-maybe-compressed-blob = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-core = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-state-machine = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-keystore = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-metadata-ir = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-statement-store = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-weights = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-io = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-runtime = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-inherents = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-transaction-pool = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-std = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-storage = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-panic-handler = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-debug-derive = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-blockchain = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-externalities = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-mixnet = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-trie = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# mangata-types = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-version = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-version-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-block-builder = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-keyring = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-staking = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-wasm-interface = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-transaction-storage-proof = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# extrinsic-shuffler = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-arithmetic = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-api-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-offchain = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-timestamp = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-application-crypto = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-rpc = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# ver-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-genesis-builder = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sp-session = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-consensus-grandpa = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-consensus = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-consensus-aura = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-consensus-slots = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-tracing = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-tracing-proc-macro = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-rpc-spec-v2 = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-state-db = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-proposer-metrics = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-keystore = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-basic-authorship-ver = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-rpc-server = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-network = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-network-bitswap = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-network-transactions = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-network-common = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-network-light = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-network-sync = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-informant = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-transaction-pool = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-transaction-pool-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-utils = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-cli = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-chain-spec = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-chain-spec-derive = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-block-builder-ver = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-mixnet = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-block-builder = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-allocator = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-network-gossip = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-client-db = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-client-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-sysinfo = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-executor = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-executor-wasmtime = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-executor-common = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-executor-polkavm = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-telemetry = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-offchain = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-service = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-rpc = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } +# sc-rpc-api = { git = "https://github.com//gasp-xyz/polkadot-sdk", branch = "fix/rewards-market" } -# patch generated by './scripts/dev_manifest.sh ../polkadot-sdk/' +# # patch generated by './scripts/dev_manifest.sh ../polkadot-sdk/' # [patch."https://github.com/gasp-xyz/polkadot-sdk"] # substrate-wasm-builder = { path = "../polkadot-sdk/substrate/utils/wasm-builder" } # frame-benchmarking-cli = { path = "../polkadot-sdk/substrate/utils/frame/benchmarking-cli" } @@ -468,4 +468,3 @@ sp-crypto-ec-utils = { git = "https://github.com/gasp-xyz/polkadot-sdk", branch # orml-asset-registry = { path = "../open-runtime-module-library/asset-registry" } # orml-traits = { path = "../open-runtime-module-library/traits" } # orml-utilities = { path = "../open-runtime-module-library/utilities" } - diff --git a/pallets/bootstrap/src/mock.rs b/pallets/bootstrap/src/mock.rs index ccab63956d..ebdd07859f 100644 --- a/pallets/bootstrap/src/mock.rs +++ b/pallets/bootstrap/src/mock.rs @@ -25,7 +25,10 @@ use frame_support::{ WithdrawReasons, }, }; -use mangata_support::traits::ActivationReservesProviderTrait; +use mangata_support::{ + pools::{PoolInfo, Valuate, ValuateFor}, + traits::ActivationReservesProviderTrait, +}; use mangata_types::multipurpose_liquidity::ActivateKind; use orml_tokens::MultiTokenCurrencyAdapter; use orml_traits::parameter_type_with_key; @@ -139,6 +142,28 @@ impl pallet_xyk::Config for Test { type FeeLockWeight = (); } +mockall::mock! { + pub ValuationApi {} + + impl Valuate for ValuationApi { + type CurrencyId = TokenId; + type Balance = Balance; + + fn find_paired_pool(base_id: TokenId, asset_id: TokenId) -> Result, DispatchError>; + + fn check_can_valuate(base_id: TokenId, pool_id: TokenId) -> Result<(), DispatchError>; + + fn check_pool_exist(pool_id: TokenId) -> Result<(), DispatchError>; + + fn get_reserve_and_lp_supply(base_id: TokenId, pool_id: TokenId) -> Option<(Balance, Balance)>; + + fn get_valuation_for_paired(base_id: TokenId, pool_id: TokenId, amount: Balance) -> Balance; + + fn find_valuation(base_id: TokenId, asset_id: TokenId, amount: Balance) -> Result; + } +} +impl ValuateFor for MockValuationApi {} + impl pallet_proof_of_stake::Config for Test { type RuntimeEvent = RuntimeEvent; type ActivationReservesProvider = TokensActivationPassthrough; @@ -150,7 +175,7 @@ impl pallet_proof_of_stake::Config for Test { type RewardsSchedulesLimit = ConstU32<10>; type Min3rdPartyRewardValutationPerSession = ConstU128<10>; type Min3rdPartyRewardVolume = ConstU128<10>; - type ValuationApi = Xyk; + type ValuationApi = MockValuationApi; type SchedulesPerBlock = ConstU32<5>; type NontransferableTokens = Nothing; } diff --git a/pallets/fee-lock/Cargo.toml b/pallets/fee-lock/Cargo.toml index 2b3aefbed9..8110fc295a 100644 --- a/pallets/fee-lock/Cargo.toml +++ b/pallets/fee-lock/Cargo.toml @@ -34,6 +34,7 @@ env_logger.workspace = true lazy_static.workspace = true serial_test.workspace = true test-case.workspace = true +mockall.workspace = true sp-io = { workspace = true, default-features = false } diff --git a/pallets/fee-lock/src/benchmarking.rs b/pallets/fee-lock/src/benchmarking.rs index 897d2303b8..197d4ffc38 100644 --- a/pallets/fee-lock/src/benchmarking.rs +++ b/pallets/fee-lock/src/benchmarking.rs @@ -103,13 +103,9 @@ benchmarks! { // Order of tokens in the create_pool call below is important #[cfg(not(test))] - assert_ok!(::PoolReservesProvider::create_pool(caller, valuating_token_id, pool_amount, token_id, pool_amount.saturating_mul(2u8.into()))); + assert_ok!(::Xyk::create_pool(caller, valuating_token_id, pool_amount, token_id, pool_amount.saturating_mul(2u8.into()))); - // We want to avoid having the value being 1000, since that is what get_swap_valuation_for_token returns if the valuating_token_id is the native token id - #[cfg(test)] - let value: BalanceOf = 500_u32.into(); - #[cfg(not(test))] - let value: BalanceOf = 2000_u32.into(); + let value: BalanceOf = 1980_u32.into(); let mut valuation: Option> = None; }: {valuation = FeeLock::::get_swap_valuation_for_token(valuating_token_id, valuating_token_amount);} verify{ diff --git a/pallets/fee-lock/src/lib.rs b/pallets/fee-lock/src/lib.rs index bff9b206f7..e1e8d621f3 100644 --- a/pallets/fee-lock/src/lib.rs +++ b/pallets/fee-lock/src/lib.rs @@ -10,13 +10,14 @@ use frame_support::{ transactional, }; use frame_system::{ensure_signed, pallet_prelude::*}; -use mangata_support::traits::{FeeLockTriggerTrait, Valuate, XykFunctionsTrait}; +use mangata_support::{ + pools::ValuateFor, + traits::{FeeLockTriggerTrait, XykFunctionsTrait}, +}; use orml_tokens::{MultiTokenCurrencyExtended, MultiTokenReservableCurrency}; -use sp_arithmetic::per_things::Rounding; -use sp_runtime::helpers_128bit::multiply_by_rational_with_rounding; use sp_runtime::{ - traits::{Bounded, CheckedAdd, SaturatedConversion, Zero}, + traits::{CheckedAdd, Zero}, Saturating, }; use sp_std::{convert::TryInto, prelude::*}; @@ -225,14 +226,16 @@ pub mod pallet { type MaxCuratedTokens: Get; type Tokens: MultiTokenCurrencyExtended + MultiTokenReservableCurrency; - #[cfg(not(all(feature = "runtime-benchmarks", not(test))))] - type PoolReservesProvider: Valuate, CurrencyIdOf>; - #[cfg(all(feature = "runtime-benchmarks", not(test)))] - type PoolReservesProvider: Valuate, CurrencyIdOf> - + XykFunctionsTrait, CurrencyIdOf>; + type ValuateForNative: ValuateFor< + Self::NativeTokenId, + Balance = BalanceOf, + CurrencyId = CurrencyIdOf, + >; #[pallet::constant] type NativeTokenId: Get>; type WeightInfo: WeightInfo; + #[cfg(all(feature = "runtime-benchmarks", not(test)))] + type Xyk: XykFunctionsTrait, CurrencyIdOf>; } #[pallet::genesis_config] @@ -393,25 +396,10 @@ impl FeeLockTriggerTrait, CurrencyIdOf> if T::NativeTokenId::get() == valuating_token_id { return Some(valuating_token_amount) } - let (native_token_pool_reserve, valuating_token_pool_reserve) = - , CurrencyIdOf>>::get_reserves( - T::NativeTokenId::get(), - valuating_token_id, - ) - .ok()?; - if native_token_pool_reserve.is_zero() || valuating_token_pool_reserve.is_zero() { - return None - } - Some( - multiply_by_rational_with_rounding( - valuating_token_amount.into(), - native_token_pool_reserve.into(), - valuating_token_pool_reserve.into(), - Rounding::Down, - ) - .map(SaturatedConversion::saturated_into) - .unwrap_or(BalanceOf::::max_value()), - ) + let value = + T::ValuateForNative::find_valuation_for(valuating_token_id, valuating_token_amount) + .ok()?; + Some(value) } fn process_fee_lock(who: &T::AccountId) -> DispatchResult { diff --git a/pallets/fee-lock/src/mock.rs b/pallets/fee-lock/src/mock.rs index 954fc21b3e..97aaa011d8 100644 --- a/pallets/fee-lock/src/mock.rs +++ b/pallets/fee-lock/src/mock.rs @@ -10,6 +10,7 @@ use frame_support::{ PalletId, }; use frame_system as system; +use mangata_support::pools::{PoolInfo, Valuate, ValuateFor}; use orml_traits::parameter_type_with_key; use sp_runtime::{traits::AccountIdConversion, BuildStorage}; use sp_std::convert::TryFrom; @@ -77,63 +78,48 @@ parameter_types! { pub const BnbTreasurySubAccDerive: [u8; 4] = *b"bnbt"; } -pub struct MockPoolReservesProvider(PhantomData); +pub struct MockValuateForNative {} +impl ValuateFor for MockValuateForNative {} +impl Valuate for MockValuateForNative { + type Balance = Balance; + type CurrencyId = TokenId; -impl Valuate for MockPoolReservesProvider { - fn get_liquidity_asset( - _first_asset_id: TokenId, - _second_asset_id: TokenId, - ) -> Result { + fn find_paired_pool( + base_id: Self::CurrencyId, + asset_id: Self::CurrencyId, + ) -> Result, DispatchError> { unimplemented!() } - fn get_liquidity_token_mga_pool( - _liquidity_token_id: TokenId, - ) -> Result<(TokenId, TokenId), DispatchError> { + fn check_can_valuate(_: Self::CurrencyId, _: Self::CurrencyId) -> Result<(), DispatchError> { unimplemented!() } - fn valuate_liquidity_token( - _liquidity_token_id: TokenId, - _liquidity_token_amount: Balance, - ) -> Balance { + fn check_pool_exist(pool_id: Self::CurrencyId) -> Result<(), DispatchError> { unimplemented!() } - fn scale_liquidity_by_mga_valuation( - _mga_valuation: Balance, - _liquidity_token_amount: Balance, - _mga_token_amount: Balance, - ) -> Balance { + fn get_reserve_and_lp_supply( + _: Self::CurrencyId, + pool_id: Self::CurrencyId, + ) -> Option<(Self::Balance, Self::Balance)> { unimplemented!() } - fn get_pool_state(_liquidity_token_id: TokenId) -> Option<(Balance, Balance)> { + fn get_valuation_for_paired( + _: Self::CurrencyId, + _: Self::CurrencyId, + amount: Self::Balance, + ) -> Self::Balance { unimplemented!() } - fn get_reserves( - first_asset_id: TokenId, - second_asset_id: TokenId, - ) -> Result<(Balance, Balance), DispatchError> { - match (first_asset_id, second_asset_id) { - (0, 1) => Ok((5000, 10000)), - (0, 2) => Ok((10000, 5000)), - (0, 3) => Ok((0, 10000)), - (0, 4) => Ok((5000, 0)), - _ => Err(pallet_fee_lock::Error::::UnexpectedFailure.into()), - } - } - - fn is_liquidity_token(liquidity_asset_id: TokenId) -> bool { - unimplemented!() - } - - fn valuate_non_liquidity_token( - liquidity_token_id: TokenId, - liquidity_token_amount: Balance, - ) -> Balance { - unimplemented!() + fn find_valuation( + _: Self::CurrencyId, + _: Self::CurrencyId, + _: Self::Balance, + ) -> Result { + Ok(1980_u128) } } @@ -146,7 +132,7 @@ impl pallet_fee_lock::Config for Test { type RuntimeEvent = RuntimeEvent; type MaxCuratedTokens = MaxCuratedTokens; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; - type PoolReservesProvider = MockPoolReservesProvider; + type ValuateForNative = MockValuateForNative; type NativeTokenId = NativeCurrencyId; type WeightInfo = (); } diff --git a/pallets/fee-lock/src/tests.rs b/pallets/fee-lock/src/tests.rs index 0b9bcac80a..b51943b7e5 100644 --- a/pallets/fee-lock/src/tests.rs +++ b/pallets/fee-lock/src/tests.rs @@ -623,6 +623,7 @@ fn unlock_fee_works() { } #[test] +// valuation removed, we are not testing mocks & external apis fn whitelist_and_valuation_works() { new_test_ext().execute_with(|| { assert_ok!(FeeLock::update_fee_lock_metadata( @@ -654,98 +655,6 @@ fn whitelist_and_valuation_works() { assert!(>::is_whitelisted(2)); assert!(!>::is_whitelisted(3)); - - assert_eq!( - >::get_swap_valuation_for_token(0, 1000), - Some(1000) - ); - assert_eq!( - >::get_swap_valuation_for_token(0, 0), - Some(0) - ); - assert_eq!( - >::get_swap_valuation_for_token( - 0, - u128::max_value() - ), - Some(u128::max_value()) - ); - - assert_eq!( - >::get_swap_valuation_for_token(1, 1000), - Some(500) - ); - assert_eq!( - >::get_swap_valuation_for_token(1, 0), - Some(0) - ); - assert_eq!( - >::get_swap_valuation_for_token( - 1, - u128::max_value() - ), - Some(u128::max_value() / 2) - ); - assert_eq!( - >::get_swap_valuation_for_token(2, 1000), - Some(2000) - ); - assert_eq!( - >::get_swap_valuation_for_token(2, 0), - Some(0) - ); - assert_eq!( - >::get_swap_valuation_for_token( - 2, - u128::max_value() - ), - Some(u128::max_value()) - ); - assert_eq!( - >::get_swap_valuation_for_token(3, 1000), - None - ); - assert_eq!( - >::get_swap_valuation_for_token(3, 0), - None - ); - assert_eq!( - >::get_swap_valuation_for_token( - 3, - u128::max_value() - ), - None - ); - assert_eq!( - >::get_swap_valuation_for_token(4, 1000), - None - ); - assert_eq!( - >::get_swap_valuation_for_token(4, 0), - None - ); - assert_eq!( - >::get_swap_valuation_for_token( - 4, - u128::max_value() - ), - None - ); - assert_eq!( - >::get_swap_valuation_for_token(5, 1000), - None - ); - assert_eq!( - >::get_swap_valuation_for_token(5, 0), - None - ); - assert_eq!( - >::get_swap_valuation_for_token( - 5, - u128::max_value() - ), - None - ); }) } diff --git a/pallets/market/src/lib.rs b/pallets/market/src/lib.rs index ed8fcb6647..e4de2789e3 100644 --- a/pallets/market/src/lib.rs +++ b/pallets/market/src/lib.rs @@ -19,10 +19,10 @@ use frame_support::{ }; use frame_system::pallet_prelude::*; use mangata_support::{ - pools::{Inspect, Mutate, SwapResult, TreasuryBurn}, + pools::{ComputeBalances, Inspect, Mutate, PoolPair, SwapResult, TreasuryBurn, Valuate}, traits::{ AssetRegistryProviderTrait, GetMaintenanceStatusTrait, ProofOfStakeRewardsApi, - XykFunctionsTrait, + Valuate as ValuateXyk, XykFunctionsTrait, }, }; use mangata_types::multipurpose_liquidity::ActivateKind; @@ -61,7 +61,7 @@ pub enum PoolKind { pub struct PoolInfo { pub pool_id: CurrencyId, pub kind: PoolKind, - pub pool: mangata_support::pools::PoolInfo, + pub pool: PoolPair, } impl PoolInfo { @@ -124,14 +124,14 @@ pub mod pallet { /// Xyk pools type Xyk: XykFunctionsTrait - + TreasuryBurn; + + Inspect + + ValuateXyk + + TreasuryBurn + + ComputeBalances; /// StableSwap pools - type StableSwap: Mutate< - Self::AccountId, - CurrencyId = Self::CurrencyId, - Balance = Self::Balance, - >; + type StableSwap: Mutate + + ComputeBalances; /// Reward apis for native asset LP tokens activation type Rewards: ProofOfStakeRewardsApi; @@ -916,7 +916,7 @@ pub mod pallet { } } - fn get_pool_info(pool_id: PoolIdOf) -> Result, Error> { + pub(crate) fn get_pool_info(pool_id: PoolIdOf) -> Result, Error> { if let Some(pool) = T::Xyk::get_pool_info(pool_id) { return Ok(PoolInfo { pool_id, kind: PoolKind::Xyk, pool }) } @@ -984,7 +984,7 @@ pub mod pallet { activate: bool, ) -> Result<(T::Balance, T::Balance), DispatchError> { let (asset_with_amount, asset_other) = - pool_info.same_and_other(asset_id).ok_or(Error::::MultiSwapPathInvalid)?; + pool_info.same_and_other(asset_id).ok_or(Error::::NoSuchPool)?; let amounts = match pool_info.kind { PoolKind::Xyk => { @@ -1096,6 +1096,76 @@ pub mod pallet { } } +// for now ignore the stable swap +// native token is not a stablecoin +// so we don't expect a direct stable pool of (native, token_x) +// stables can be used for multipath evals eg. token_x -> usdc -> usdt -> native +impl Valuate for Pallet { + type CurrencyId = T::CurrencyId; + type Balance = T::Balance; + + // a pool's pair has to be connected to base + fn check_can_valuate( + base_id: Self::CurrencyId, + pool_id: Self::CurrencyId, + ) -> Result<(), DispatchError> { + let pair = Self::get_pool_info(pool_id)?.pool; + if pair.0 == base_id || pair.1 == base_id { + return Ok(()); + } + Err(Error::::NoSuchPool.into()) + } + + fn check_pool_exist(pool_id: Self::CurrencyId) -> Result<(), DispatchError> { + Self::get_pool_info(pool_id)?; + Ok(()) + } + + fn find_paired_pool( + base_id: Self::CurrencyId, + asset_id: Self::CurrencyId, + ) -> Result, DispatchError> { + let pool_id = T::Xyk::get_liquidity_asset(base_id, asset_id)?; + let maybe_pool = Self::get_pools(Some(pool_id)); + let (info, reserves) = maybe_pool.first().ok_or(Error::::NoSuchPool)?; + Ok((pool_id, info.pool, *reserves)) + } + + fn find_valuation( + _: Self::CurrencyId, + asset_id: Self::CurrencyId, + amount: Self::Balance, + ) -> Result { + Ok(T::Xyk::valuate_non_liquidity_token(asset_id, amount)) + } + + fn get_reserve_and_lp_supply( + base_id: Self::CurrencyId, + pool_id: Self::CurrencyId, + ) -> Option<(Self::Balance, Self::Balance)> { + let maybe_pool = Self::get_pools(Some(pool_id)); + let (info, reserves) = maybe_pool.first()?; + let reserve = match info.pool { + (id, _) if id == base_id => reserves.0, + (_, id) if id == base_id => reserves.1, + _ => Zero::zero(), + }; + let issuance = T::Currency::total_issuance(pool_id); + if reserve.is_zero() || issuance.is_zero() { + return None; + } + Some((reserve, issuance)) + } + + fn get_valuation_for_paired( + _: Self::CurrencyId, + pool_id: Self::CurrencyId, + amount: Self::Balance, + ) -> Self::Balance { + T::Xyk::valuate_liquidity_token(pool_id, amount) + } +} + #[derive(Clone, Eq, PartialEq, Encode, Decode, Default, TypeInfo)] #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] diff --git a/pallets/parachain-staking/src/lib.rs b/pallets/parachain-staking/src/lib.rs index 2845a513e0..3d5b3bb7e1 100644 --- a/pallets/parachain-staking/src/lib.rs +++ b/pallets/parachain-staking/src/lib.rs @@ -150,9 +150,12 @@ use frame_support::{ transactional, }; use frame_system::{pallet_prelude::*, RawOrigin}; -pub use mangata_support::traits::{ - ComputeIssuance, GetIssuance, PoolCreateApi, ProofOfStakeRewardsApi, - SequencerStakingRewardsTrait, StakingReservesProviderTrait, Valuate, XykFunctionsTrait, +pub use mangata_support::{ + pools::ValuateFor, + traits::{ + ComputeIssuance, GetIssuance, PoolCreateApi, ProofOfStakeRewardsApi, + SequencerStakingRewardsTrait, StakingReservesProviderTrait, XykFunctionsTrait, + }, }; pub use mangata_types::multipurpose_liquidity::BondKind; use orml_tokens::{MultiTokenCurrencyExtended, MultiTokenReservableCurrency}; @@ -1499,7 +1502,11 @@ pub mod pallet { type NativeTokenId: Get>; /// The valuator for our staking liquidity tokens, i.e., XYK /// This should never return (_, Zero::zero()) - type StakingLiquidityTokenValuator: Valuate, CurrencyIdOf>; + type ValuateForNative: ValuateFor< + Self::NativeTokenId, + Balance = BalanceOf, + CurrencyId = CurrencyIdOf, + >; /// The module used for computing and getting issuance type Issuance: ComputeIssuance + GetIssuance>; #[pallet::constant] @@ -2534,12 +2541,9 @@ pub mod pallet { let added_liquidity_token: CurrencyIdOf = match paired_or_liquidity_token { PairedOrLiquidityToken::Paired(x) => - T::StakingLiquidityTokenValuator::get_liquidity_asset( - x.into(), - T::NativeTokenId::get().into(), - )?, + T::ValuateForNative::find_paired_pool_for(x)?.0, PairedOrLiquidityToken::Liquidity(x) => { - T::StakingLiquidityTokenValuator::get_liquidity_token_mga_pool(x.into())?; + T::ValuateForNative::check_can_valuate_for(x)?; x }, }; @@ -2573,10 +2577,7 @@ pub mod pallet { let removed_liquidity_token: CurrencyIdOf = match paired_or_liquidity_token { PairedOrLiquidityToken::Paired(x) => - T::StakingLiquidityTokenValuator::get_liquidity_asset( - x.into(), - T::NativeTokenId::get().into(), - )?, + T::ValuateForNative::find_paired_pool_for(x)?.0, PairedOrLiquidityToken::Liquidity(x) => x, }; @@ -3314,7 +3315,7 @@ pub mod pallet { let mut staking_liquidity_tokens = >::get(); for (token, valuation) in staking_liquidity_tokens.iter_mut() { - *valuation = T::StakingLiquidityTokenValuator::get_pool_state((*token).into()); + *valuation = T::ValuateForNative::get_reserve_and_lp_supply_for(*token); } >::put(staking_liquidity_tokens); @@ -3376,10 +3377,7 @@ pub mod pallet { if liquidity_token == T::NativeTokenId::get() { bond.checked_div(&2_u32.into()).unwrap_or_default() } else { - T::StakingLiquidityTokenValuator::valuate_liquidity_token( - liquidity_token.into(), - bond, - ) + T::ValuateForNative::get_valuation_for_paired_for(liquidity_token, bond) } } diff --git a/pallets/parachain-staking/src/mock.rs b/pallets/parachain-staking/src/mock.rs index e68bb9803a..0481a27fb0 100644 --- a/pallets/parachain-staking/src/mock.rs +++ b/pallets/parachain-staking/src/mock.rs @@ -18,17 +18,17 @@ use crate as stake; use crate::{ pallet, AwardedPts, BondKind, ComputeIssuance, Config, DispatchError, GetIssuance, Points, - RoundCollatorRewardInfo, StakingReservesProviderTrait, Valuate, + RoundCollatorRewardInfo, StakingReservesProviderTrait, }; use codec::{Decode, Encode}; use frame_support::{ assert_ok, construct_runtime, derive_impl, parameter_types, traits::{ - Contains, Everything, MultiTokenCurrency, MultiTokenVestingSchedule, Nothing, OnFinalize, - OnInitialize, + Contains, MultiTokenCurrency, MultiTokenVestingSchedule, Nothing, OnFinalize, OnInitialize, }, PalletId, }; +use mangata_support::pools::{PoolInfo, Valuate, ValuateFor}; use orml_tokens::{MultiTokenCurrencyExtended, MultiTokenReservableCurrency}; use orml_traits::parameter_type_with_key; use scale_info::TypeInfo; @@ -280,7 +280,7 @@ impl Config for Test { type MinCandidateStk = MinCollatorStk; type MinDelegation = MinDelegation; type NativeTokenId = MgaTokenId; - type StakingLiquidityTokenValuator = TestTokenValuator; + type ValuateForNative = TestTokenValuator; type Issuance = MockIssuance; type StakingIssuanceVault = StakingIssuanceVault; type FallbackProvider = (); @@ -290,38 +290,31 @@ impl Config for Test { #[derive(Default, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct TestTokenValuator {} +impl ValuateFor for TestTokenValuator {} +impl Valuate for TestTokenValuator { + type Balance = Balance; + type CurrencyId = TokenId; -impl Valuate for TestTokenValuator { - fn get_liquidity_asset( - first_asset_id: TokenId, - _second_asset_id: TokenId, - ) -> Result { - Ok(first_asset_id / 100) - } - - fn get_liquidity_token_mga_pool( - _liquidity_token_id: TokenId, - ) -> Result<(TokenId, TokenId), DispatchError> { - Ok((0_u32, 1_u32)) + fn find_paired_pool( + base_id: Self::CurrencyId, + asset_id: Self::CurrencyId, + ) -> Result, DispatchError> { + Ok((asset_id / 100, (base_id, asset_id), (0, 0))) } - fn valuate_liquidity_token( - _liquidity_token_id: TokenId, - liquidity_token_amount: Balance, - ) -> Balance { - liquidity_token_amount + fn check_can_valuate(_: Self::CurrencyId, _: Self::CurrencyId) -> Result<(), DispatchError> { + Ok(()) } - fn scale_liquidity_by_mga_valuation( - _mga_valuation: Balance, - _liquidity_token_amount: Balance, - _mga_token_amount: Balance, - ) -> Balance { - unimplemented!("Not required in tests!") + fn check_pool_exist(pool_id: Self::CurrencyId) -> Result<(), DispatchError> { + Ok(()) } - fn get_pool_state(liquidity_token_id: TokenId) -> Option<(Balance, Balance)> { - match liquidity_token_id { + fn get_reserve_and_lp_supply( + _: Self::CurrencyId, + pool_id: Self::CurrencyId, + ) -> Option<(Self::Balance, Self::Balance)> { + match pool_id { 1 => Some((1, 1)), 2 => Some((2, 1)), 3 => Some((5, 1)), @@ -332,22 +325,20 @@ impl Valuate for TestTokenValuator { } } - fn get_reserves( - _first_asset_id: TokenId, - _second_asset_id: TokenId, - ) -> Result<(Balance, Balance), DispatchError> { - todo!() + fn get_valuation_for_paired( + _: Self::CurrencyId, + _: Self::CurrencyId, + amount: Self::Balance, + ) -> Self::Balance { + amount } - fn is_liquidity_token(liquidity_asset_id: TokenId) -> bool { - todo!() - } - - fn valuate_non_liquidity_token( - liquidity_token_id: TokenId, - liquidity_token_amount: Balance, - ) -> Balance { - todo!() + fn find_valuation( + _: Self::CurrencyId, + _: Self::CurrencyId, + _: Self::Balance, + ) -> Result { + unimplemented!("Not required in tests!") } } diff --git a/pallets/proof-of-stake/src/benchmarking.rs b/pallets/proof-of-stake/src/benchmarking.rs index bddf073100..cde299c986 100644 --- a/pallets/proof-of-stake/src/benchmarking.rs +++ b/pallets/proof-of-stake/src/benchmarking.rs @@ -34,7 +34,7 @@ where type TokensOf = ::Currency; type AccountIdOf = ::AccountId; -type XykOf = ::ValuationApi; +type XykOf = ::Xyk; fn forward_to_next_session() where @@ -282,7 +282,7 @@ benchmarks! { PoS::::reward_pool( RawOrigin::Signed(caller.clone().into()).into(), - (native_asset_id, token_id), + reward_token, reward_token.into(), (REWARDS_AMOUNT).to_balance::(), 10u32.into(), @@ -294,7 +294,7 @@ benchmarks! { let reward_token = token_id + One::one(); PoS::::reward_pool( RawOrigin::Signed(caller.clone().into()).into(), - (native_asset_id, token_id), + reward_token, reward_token.into(), REWARDS_AMOUNT.to_balance::(), 2u32.into(), @@ -313,7 +313,7 @@ benchmarks! { (schedules_limit - 1 ) as u64 ); - }: reward_pool(RawOrigin::Signed(caller.clone().into()), (native_asset_id,token_id), reward_token.into(), REWARDS_AMOUNT.to_balance::(), 10u32.into()) + }: reward_pool(RawOrigin::Signed(caller.clone().into()), reward_token, reward_token.into(), REWARDS_AMOUNT.to_balance::(), 10u32.into()) verify { assert_eq!( @@ -357,7 +357,7 @@ benchmarks! { PoS::::reward_pool( RawOrigin::Signed(caller.clone().into()).into(), - (native_asset_id, first_token_id), + liquidity_asset_id, reward_token_id.into(), REWARDS_AMOUNT.to_balance::(), 2u32.into(), @@ -407,7 +407,7 @@ benchmarks! { PoS::::reward_pool( RawOrigin::Signed(caller.clone().into()).into(), - (native_asset_id, first_token_id), + liquidity_asset_id, reward_token_id.into(), REWARDS_AMOUNT.to_balance::(), 2u32.into(), @@ -488,7 +488,7 @@ benchmarks! { PoS::::reward_pool( RawOrigin::Signed(caller.clone().into()).into(), - (native_asset_id, first_token_id), + liquidity_asset_id, reward_token_id.into(), REWARDS_AMOUNT.to_balance::(), 2u32.into(), diff --git a/pallets/proof-of-stake/src/lib.rs b/pallets/proof-of-stake/src/lib.rs index e9c0a0e51f..8e32aaa8fa 100644 --- a/pallets/proof-of-stake/src/lib.rs +++ b/pallets/proof-of-stake/src/lib.rs @@ -161,10 +161,9 @@ use frame_support::{ dispatch::{DispatchErrorWithPostInfo, DispatchResult, PostDispatchInfo}, ensure, storage::bounded_btree_map::BoundedBTreeMap, - traits::Currency, }; use frame_system::ensure_signed; -use mangata_support::traits::Valuate; +use mangata_support::pools::{Valuate, ValuateFor}; use mangata_types::multipurpose_liquidity::ActivateKind; use orml_tokens::{MultiTokenCurrencyExtended, MultiTokenReservableCurrency}; use sp_core::U256; @@ -394,33 +393,6 @@ pub mod pallet { #[cfg(not(feature = "runtime-benchmarks"))] impl PoSBenchmarkingConfig for T {} - #[cfg(not(feature = "runtime-benchmarks"))] - pub trait ValutationApiTrait: Valuate, CurrencyIdOf> {} - - #[cfg(feature = "runtime-benchmarks")] - pub trait ValutationApiTrait: - Valuate, CurrencyIdOf> - + XykFunctionsTrait, BalanceOf, CurrencyIdOf> - { - } - - #[cfg(not(feature = "runtime-benchmarks"))] - impl ValutationApiTrait for T - where - C: Config, - T: Valuate, CurrencyIdOf>, - { - } - - #[cfg(feature = "runtime-benchmarks")] - impl ValutationApiTrait for T - where - C: Config, - T: Valuate, CurrencyIdOf>, - T: XykFunctionsTrait, BalanceOf, CurrencyIdOf>, - { - } - #[pallet::config] pub trait Config: frame_system::Config + PoSBenchmarkingConfig { type RuntimeEvent: From> + IsType<::RuntimeEvent>; @@ -445,10 +417,18 @@ pub mod pallet { type SchedulesPerBlock: Get; type WeightInfo: WeightInfo; - type ValuationApi: ValutationApiTrait; + + type ValuationApi: ValuateFor< + ::NativeCurrencyId, + CurrencyId = CurrencyIdOf, + Balance = BalanceOf, + >; /// Tokens which cannot be transfered by extrinsics/user or use in pool, unless foundation override type NontransferableTokens: Contains>; + + #[cfg(feature = "runtime-benchmarks")] + type Xyk: XykFunctionsTrait, CurrencyIdOf>; } #[pallet::error] @@ -703,7 +683,7 @@ pub mod pallet { ensure_root(origin)?; ensure!( - <::ValuationApi as Valuate, CurrencyIdOf>>::is_liquidity_token(liquidity_token_id), + T::ValuationApi::check_pool_exist(liquidity_token_id).is_ok(), Error::::SoloTokenPromotionForbiddenError ); @@ -769,7 +749,7 @@ pub mod pallet { #[pallet::weight(<::WeightInfo>::reward_pool())] pub fn reward_pool( origin: OriginFor, - pool: (CurrencyIdOf, CurrencyIdOf), + pool_id: CurrencyIdOf, token_id: CurrencyIdOf, amount: BalanceOf, schedule_end: SessionId, @@ -781,7 +761,7 @@ pub mod pallet { Error::::NontransferableToken ); - Self::reward_pool_impl(sender, pool, token_id, amount, schedule_end) + Self::reward_pool_impl(sender, pool_id, token_id, amount, schedule_end) } /// Increases number of tokens used for liquidity mining purposes. @@ -1496,13 +1476,12 @@ impl Pallet { pub(crate) fn reward_pool_impl( sender: T::AccountId, - pool: (CurrencyIdOf, CurrencyIdOf), + pool_id: CurrencyIdOf, token_id: CurrencyIdOf, amount: BalanceOf, schedule_end: SessionId, ) -> DispatchResult { - let liquidity_token_id = ::ValuationApi::get_liquidity_asset(pool.0, pool.1) - .map_err(|_| Error::::PoolDoesNotExist)?; + T::ValuationApi::check_pool_exist(pool_id).map_err(|_| Error::::PoolDoesNotExist)?; let current_session = Self::session_index(); ensure!( @@ -1525,7 +1504,7 @@ impl Pallet { ensure!(Self::verify_rewards_min_volume(token_id), Error::::TooSmallVolume); - RewardTokensPerPool::::insert(liquidity_token_id, token_id, ()); + RewardTokensPerPool::::insert(pool_id, token_id, ()); T::Currency::transfer( token_id.into(), @@ -1541,7 +1520,7 @@ impl Pallet { let schedule = Schedule { scheduled_at: Self::session_index(), last_session: schedule_end, - liq_token: liquidity_token_id, + liq_token: pool_id, reward_token: token_id, amount_per_session, }; @@ -1577,10 +1556,7 @@ impl Pallet { } Pallet::::deposit_event(Event::ThirdPartySuccessfulPoolPromotion( - sender, - liquidity_token_id, - token_id, - amount, + sender, pool_id, token_id, amount, )); Ok(()) @@ -1590,7 +1566,7 @@ impl Pallet { token_id: CurrencyIdOf, amount_per_session: BalanceOf, ) -> bool { - if ::ValuationApi::valuate_liquidity_token(token_id, amount_per_session).into() >= + if T::ValuationApi::get_valuation_for_paired_for(token_id, amount_per_session).into() >= T::Min3rdPartyRewardValutationPerSession::get() { return true @@ -1602,7 +1578,8 @@ impl Pallet { return true } - if ::ValuationApi::valuate_non_liquidity_token(token_id, amount_per_session) + if T::ValuationApi::find_valuation_for(token_id, amount_per_session) + .unwrap_or_default() .into() >= T::Min3rdPartyRewardValutationPerSession::get() { return true @@ -1616,14 +1593,16 @@ impl Pallet { return true } - if let Some((mga_reserves, _)) = ::ValuationApi::get_pool_state(token_id) { - return mga_reserves.into() >= T::Min3rdPartyRewardVolume::get() + if let Some((native_reserves, _)) = + ::ValuationApi::get_reserve_and_lp_supply_for(token_id) + { + return native_reserves.into() >= T::Min3rdPartyRewardVolume::get() } - if let Ok((mga_reserves, _)) = - ::ValuationApi::get_reserves(Self::native_token_id(), token_id) - { - return mga_reserves.into() >= T::Min3rdPartyRewardVolume::get() + if let Ok((_, ids, reserves)) = T::ValuationApi::find_paired_pool_for(token_id) { + let native_reserves = + if ids.0 == Self::native_token_id() { reserves.0 } else { reserves.1 }; + return native_reserves.into() >= T::Min3rdPartyRewardVolume::get() } return false @@ -1634,13 +1613,12 @@ impl ProofOfStakeRewardsApi, CurrencyIdOf< #[cfg(feature = "runtime-benchmarks")] fn enable_3rdparty_rewards( account: T::AccountId, - pool: (CurrencyIdOf, CurrencyIdOf), + pool: CurrencyIdOf, reward_token_id: CurrencyIdOf, last_session: u32, amount: BalanceOf, ) { - let liquidity_token_id = - ::ValuationApi::get_liquidity_asset(pool.0, pool.1).expect("pool exist"); + ::ValuationApi::check_pool_exist(pool).expect("pool exist"); Pallet::::reward_pool_impl( account.clone(), pool, diff --git a/pallets/proof-of-stake/src/mock.rs b/pallets/proof-of-stake/src/mock.rs index 71912312e5..d5997c01ef 100644 --- a/pallets/proof-of-stake/src/mock.rs +++ b/pallets/proof-of-stake/src/mock.rs @@ -15,7 +15,7 @@ use frame_support::{ PalletId, }; use frame_system as system; -pub use mangata_support::traits::ProofOfStakeRewardsApi; +pub use mangata_support::pools::{PoolInfo, Valuate}; use orml_tokens::{MultiTokenCurrencyAdapter, MultiTokenCurrencyExtended}; use orml_traits::{asset_registry::AssetMetadata, parameter_type_with_key}; use pallet_xyk::AssetMetadataMutationTrait; @@ -174,51 +174,71 @@ lazy_static::lazy_static! { }; } +#[cfg(not(feature = "runtime-benchmarks"))] mockall::mock! { pub ValuationApi {} - impl Valuate for ValuationApi { + impl Valuate for ValuationApi { + type CurrencyId = TokenId; + type Balance = Balance; - fn get_liquidity_asset( - first_asset_id: TokenId, - second_asset_id: TokenId, - ) -> Result; + fn find_paired_pool(base_id: TokenId, asset_id: TokenId) -> Result, DispatchError>; - fn get_liquidity_token_mga_pool( - liquidity_token_id: TokenId, - ) -> Result<(TokenId, TokenId), DispatchError>; + fn check_can_valuate(base_id: TokenId, pool_id: TokenId) -> Result<(), DispatchError>; - fn is_liquidity_token( - liquidity_token_id: TokenId, - ) -> bool; + fn check_pool_exist(pool_id: TokenId) -> Result<(), DispatchError>; - fn valuate_liquidity_token( - liquidity_token_id: TokenId, - liquidity_token_amount: Balance, - ) -> Balance; + fn get_reserve_and_lp_supply(base_id: TokenId, pool_id: TokenId) -> Option<(Balance, Balance)>; - fn valuate_non_liquidity_token( - liquidity_token_id: TokenId, - liquidity_token_amount: Balance, - ) -> Balance; + fn get_valuation_for_paired(base_id: TokenId, pool_id: TokenId, amount: Balance) -> Balance; - fn scale_liquidity_by_mga_valuation( - mga_valuation: Balance, - liquidity_token_amount: Balance, - mga_token_amount: Balance, - ) -> Balance; + fn find_valuation(base_id: TokenId, asset_id: TokenId, amount: Balance) -> Result; + } +} - fn get_pool_state(liquidity_token_id: TokenId) -> Option<(Balance, Balance)>; +#[cfg(feature = "runtime-benchmarks")] +pub struct MockValuationApi; +#[cfg(feature = "runtime-benchmarks")] +impl Valuate for MockValuationApi { + type CurrencyId = TokenId; + type Balance = Balance; - fn get_reserves( - first_asset_id: TokenId, - second_asset_id: TokenId, - ) -> Result<(Balance, Balance), DispatchError>; + fn find_paired_pool( + base_id: TokenId, + asset_id: TokenId, + ) -> Result, DispatchError> { + unimplemented!() + } + fn check_can_valuate(base_id: TokenId, pool_id: TokenId) -> Result<(), DispatchError> { + unimplemented!() + } + fn check_pool_exist(pool_id: TokenId) -> Result<(), DispatchError> { + Ok(()) + } + + fn get_reserve_and_lp_supply(base_id: TokenId, pool_id: TokenId) -> Option<(Balance, Balance)> { + let volume = + <::Min3rdPartyRewardVolume as Get>::get() * 1_000_000u128; + Some((volume, volume / 2)) + } + + fn get_valuation_for_paired(base_id: TokenId, pool_id: TokenId, amount: Balance) -> Balance { + min_req_volume() + } + + fn find_valuation( + base_id: TokenId, + asset_id: TokenId, + amount: Balance, + ) -> Result { + unimplemented!() } } +impl ValuateFor for MockValuationApi {} + pub struct AssetMetadataMutation; impl AssetMetadataMutationTrait for AssetMetadataMutation { fn set_asset_info( @@ -293,9 +313,10 @@ impl pos::Config for Test { type Min3rdPartyRewardValutationPerSession = ConstU128<100_000>; type Min3rdPartyRewardVolume = ConstU128<10>; type WeightInfo = (); - type ValuationApi = Xyk; + type ValuationApi = MockValuationApi; type SchedulesPerBlock = ConstU32<5>; type NontransferableTokens = Nothing; + type Xyk = Xyk; } pub struct TokensActivationPassthrough(PhantomData); @@ -417,15 +438,16 @@ impl ExtBuilder { self.ext } + #[cfg(not(feature = "runtime-benchmarks"))] pub fn execute_with_default_mocks(mut self, f: impl FnOnce() -> R) -> R { self.ext.execute_with(|| { - let is_liquidity_token_mock = MockValuationApi::is_liquidity_token_context(); - is_liquidity_token_mock.expect().return_const(true); - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(10u32)); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); + let is_liquidity_token_mock = MockValuationApi::check_pool_exist_context(); + is_liquidity_token_mock.expect().return_const(Ok(())); + let get_liquidity_asset_mock = MockValuationApi::find_paired_pool_context(); + get_liquidity_asset_mock.expect().return_const(Ok((10u32, (0, 0), (0, 0)))); + let valuate_liquidity_token_mock = MockValuationApi::get_valuation_for_paired_context(); valuate_liquidity_token_mock.expect().return_const(11u128); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); + let get_pool_state_mock = MockValuationApi::get_reserve_and_lp_supply_context(); get_pool_state_mock .expect() .return_const(Some((min_req_volume(), min_req_volume()))); diff --git a/pallets/proof-of-stake/src/tests.rs b/pallets/proof-of-stake/src/tests.rs index fe41cf7b4f..f66c8062f0 100644 --- a/pallets/proof-of-stake/src/tests.rs +++ b/pallets/proof-of-stake/src/tests.rs @@ -7,8 +7,6 @@ use frame_support::{assert_err, assert_err_ignore_postinfo, assert_ok}; use mockall::predicate::eq; use serial_test::serial; -use mangata_support::traits::{ComputeIssuance, GetIssuance}; - fn mint_and_activate_tokens(who: AccountId, token_id: TokenId, amount: Balance) { TokensOf::::mint(token_id, &who, amount).unwrap(); ProofOfStake::activate_liquidity_for_native_rewards( @@ -31,8 +29,8 @@ fn initialize_liquidity_rewards() { TokensOf::::create(&acc_id, amount).unwrap(); TokensOf::::create(&acc_id, 10000).unwrap(); - let is_liquidity_token_mock = MockValuationApi::is_liquidity_token_context(); - is_liquidity_token_mock.expect().return_const(true); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); ProofOfStake::update_pool_promotion(RuntimeOrigin::root(), 4, 2u8).unwrap(); PromotedPoolRewards::::mutate(|pools| { @@ -1199,7 +1197,7 @@ fn claim_rewards_from_pool_that_has_been_disabled() { } const MILLION: u128 = 1_000_000; -const REWARDED_PAIR: (TokenId, TokenId) = (0u32, 4u32); +const REWARDED_PAIR: TokenId = 10_u32; const FIRST_REWARDED_PAIR: (TokenId, TokenId) = (0u32, 4u32); const SECOND_REWARDED_PAIR: (TokenId, TokenId) = (0u32, 5u32); const REWARD_AMOUNT: u128 = 10_000u128; @@ -1296,12 +1294,13 @@ fn cannot_reward_unexisting_pool() { .issue(ALICE, REWARD_TOKEN, REWARD_AMOUNT) .build() .execute_with(|| { - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock .expect() .return_const(Err(Error::::PoolDoesNotExist.into())); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(11u128); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(11u128); assert_err!( ProofOfStake::reward_pool( @@ -1921,14 +1920,14 @@ fn reject_schedule_with_too_little_rewards_per_session() { .build() .execute_with(|| { System::set_block_number(1); - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(10u32)); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(1u128); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(1u128); - let valuate_non_liquidity_token_mock = - MockValuationApi::valuate_non_liquidity_token_context(); - valuate_non_liquidity_token_mock.expect().return_const(0u128); + let find_valuation_mock = MockValuationApi::find_valuation_context(); + find_valuation_mock.expect().return_const(Ok(0u128)); roll_to_session::(4); @@ -1953,12 +1952,14 @@ fn accept_schedule_valuated_in_native_token() { .build() .execute_with(|| { System::set_block_number(1); - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(10u32)); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(0u128); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); - get_pool_state_mock + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(0u128); + let get_reserve_and_lp_supply_mock = + MockValuationApi::get_reserve_and_lp_supply_context(); + get_reserve_and_lp_supply_mock .expect() .return_const(Some((min_req_volume(), min_req_volume()))); @@ -1983,17 +1984,18 @@ fn accept_schedule_valuated_in_token_paired_with_native_token() { .build() .execute_with(|| { System::set_block_number(1); - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(10u32)); - - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(0u128); - - let valuate_non_liquidity_token_mock = - MockValuationApi::valuate_non_liquidity_token_context(); - valuate_non_liquidity_token_mock.expect().return_const(10u128); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); - get_pool_state_mock + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); + + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(0u128); + + let find_valuation_mock = MockValuationApi::find_valuation_context(); + find_valuation_mock.expect().return_const(Ok(10u128)); + let get_reserve_and_lp_supply_mock = + MockValuationApi::get_reserve_and_lp_supply_context(); + get_reserve_and_lp_supply_mock .expect() .return_const(Some((min_req_volume(), min_req_volume()))); @@ -2096,24 +2098,25 @@ fn overlapping_3rdparty_rewards_works() { .execute_with(|| { System::set_block_number(1); const LIQUIDITY_TOKEN: u32 = 5; - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(LIQUIDITY_TOKEN)); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(11u128); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); - get_pool_state_mock + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(11u128); + let get_reserve_and_lp_supply_mock = + MockValuationApi::get_reserve_and_lp_supply_context(); + get_reserve_and_lp_supply_mock .expect() .return_const(Some((min_req_volume(), min_req_volume()))); let first_reward_token = TokensOf::::create(&ALICE, MILLION).unwrap(); TokensOf::::mint(LIQUIDITY_TOKEN, &BOB, 200).unwrap(); - let pair: (TokenId, TokenId) = (0u32.into(), 4u32.into()); let amount = 10_000u128; ProofOfStake::reward_pool( RuntimeOrigin::signed(ALICE), - pair, + LIQUIDITY_TOKEN, first_reward_token, amount, 10u32.into(), @@ -2134,7 +2137,7 @@ fn overlapping_3rdparty_rewards_works() { let second_reward_token_id = TokensOf::::create(&ALICE, MILLION).unwrap(); ProofOfStake::reward_pool( RuntimeOrigin::signed(ALICE), - pair, + LIQUIDITY_TOKEN, second_reward_token_id, 100_000, 15u32.into(), @@ -2330,28 +2333,23 @@ fn calculate_and_claim_rewards_from_multiple_schedules_using_single_liquidity() .issue(BOB, SECOND_LIQUIDITY_TOKEN, 100) .build() .execute_with(|| { - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock - .expect() - .with(eq(FIRST_REWARDED_PAIR.0), eq(FIRST_REWARDED_PAIR.1)) - .return_const(Ok(FIRST_LIQUIDITY_TOKEN)); - get_liquidity_asset_mock - .expect() - .with(eq(SECOND_REWARDED_PAIR.0), eq(SECOND_REWARDED_PAIR.1)) - .return_const(Ok(SECOND_LIQUIDITY_TOKEN)); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(11u128); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(11u128); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); - get_pool_state_mock + let get_reserve_and_lp_supply_mock = + MockValuationApi::get_reserve_and_lp_supply_context(); + get_reserve_and_lp_supply_mock .expect() .return_const(Some((min_req_volume(), min_req_volume()))); System::set_block_number(1); ProofOfStake::reward_pool( RuntimeOrigin::signed(ALICE), - FIRST_REWARDED_PAIR, + FIRST_LIQUIDITY_TOKEN, FIRST_REWARD_TOKEN, REWARD_AMOUNT, 10u32.into(), @@ -2373,7 +2371,7 @@ fn calculate_and_claim_rewards_from_multiple_schedules_using_single_liquidity() ); ProofOfStake::reward_pool( RuntimeOrigin::signed(ALICE), - FIRST_REWARDED_PAIR, + FIRST_LIQUIDITY_TOKEN, SECOND_REWARD_TOKEN, 2 * REWARD_AMOUNT, 12u32.into(), @@ -2408,7 +2406,7 @@ fn calculate_and_claim_rewards_from_multiple_schedules_using_single_liquidity() ); ProofOfStake::reward_pool( RuntimeOrigin::signed(ALICE), - SECOND_REWARDED_PAIR, + SECOND_LIQUIDITY_TOKEN, FIRST_REWARD_TOKEN, REWARD_AMOUNT, 14u32.into(), @@ -2434,7 +2432,7 @@ fn calculate_and_claim_rewards_from_multiple_schedules_using_single_liquidity() ); ProofOfStake::reward_pool( RuntimeOrigin::signed(ALICE), - SECOND_REWARDED_PAIR, + SECOND_LIQUIDITY_TOKEN, SECOND_REWARD_TOKEN, 2 * REWARD_AMOUNT, 15u32.into(), @@ -4062,18 +4060,19 @@ fn reject_3rdparty_rewards_with_non_liq_token_and_too_small_volume() { System::set_block_number(1); let too_small_volume = Some((min_req_volume() - 1, min_req_volume() - 1)); - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(LIQUIDITY_TOKEN)); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(0u128); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(0u128); - let valuate_non_liquidity_token_mock = - MockValuationApi::valuate_non_liquidity_token_context(); - valuate_non_liquidity_token_mock.expect().return_const(10u128); + let find_valuation_mock = MockValuationApi::find_valuation_context(); + find_valuation_mock.expect().return_const(Ok(10u128)); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); - get_pool_state_mock.expect().return_const(too_small_volume); + let get_reserve_and_lp_supply_mock = + MockValuationApi::get_reserve_and_lp_supply_context(); + get_reserve_and_lp_supply_mock.expect().return_const(too_small_volume); roll_to_session::(4); @@ -4100,18 +4099,19 @@ fn accept_3rdparty_rewards_with_non_liq_token_and_proper_valuation() { System::set_block_number(1); let min_volume = Some((min_req_volume(), min_req_volume())); - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(LIQUIDITY_TOKEN)); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(0u128); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(0u128); - let valuate_non_liquidity_token_mock = - MockValuationApi::valuate_non_liquidity_token_context(); - valuate_non_liquidity_token_mock.expect().return_const(10u128); + let find_valuation_mock = MockValuationApi::find_valuation_context(); + find_valuation_mock.expect().return_const(Ok(10u128)); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); - get_pool_state_mock.expect().return_const(min_volume); + let get_reserve_and_lp_supply_mock = + MockValuationApi::get_reserve_and_lp_supply_context(); + get_reserve_and_lp_supply_mock.expect().return_const(min_volume); roll_to_session::(4); @@ -4135,17 +4135,19 @@ fn reject_3rdparty_rewards_with_liq_token_and_too_small_volume() { System::set_block_number(1); let too_small_volume = Some((min_req_volume() - 1, min_req_volume() - 1)); - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(LIQUIDITY_TOKEN)); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(10u128); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(10u128); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); - get_pool_state_mock.expect().return_const(None); + let get_reserve_and_lp_supply_mock = + MockValuationApi::get_reserve_and_lp_supply_context(); + get_reserve_and_lp_supply_mock.expect().return_const(None); - let get_reserves_mock = MockValuationApi::get_reserves_context(); - get_reserves_mock.expect().return_const(Ok((9u128, 0u128))); + let find_paired_pool_mock = MockValuationApi::find_paired_pool_context(); + find_paired_pool_mock.expect().return_const(Ok((0, (0, 5), (9, 0u128)))); roll_to_session::(4); @@ -4171,17 +4173,21 @@ fn accept_3rdparty_rewards_with_liq_token_and_min_volume() { .execute_with(|| { System::set_block_number(1); - let get_liquidity_asset_mock = MockValuationApi::get_liquidity_asset_context(); - get_liquidity_asset_mock.expect().return_const(Ok(LIQUIDITY_TOKEN)); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); - let valuate_liquidity_token_mock = MockValuationApi::valuate_liquidity_token_context(); - valuate_liquidity_token_mock.expect().return_const(10u128); + let get_valuation_for_paired_mock = + MockValuationApi::get_valuation_for_paired_context(); + get_valuation_for_paired_mock.expect().return_const(10u128); - let get_pool_state_mock = MockValuationApi::get_pool_state_context(); - get_pool_state_mock.expect().return_const(None); + let get_reserve_and_lp_supply_mock = + MockValuationApi::get_reserve_and_lp_supply_context(); + get_reserve_and_lp_supply_mock.expect().return_const(None); - let get_reserves_mock = MockValuationApi::get_reserves_context(); - get_reserves_mock.expect().return_const(Ok((min_req_volume(), 0u128))); + let find_paired_pool_mock = MockValuationApi::find_paired_pool_context(); + find_paired_pool_mock + .expect() + .return_const(Ok((0, (0, 5), (min_req_volume(), 0u128)))); roll_to_session::(4); diff --git a/pallets/stable-swap/src/lib.rs b/pallets/stable-swap/src/lib.rs index 929b516eff..f8785837b0 100644 --- a/pallets/stable-swap/src/lib.rs +++ b/pallets/stable-swap/src/lib.rs @@ -3,7 +3,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{ - ensure, fail, + ensure, pallet_prelude::*, traits::{ tokens::{Balance, CurrencyId}, @@ -13,7 +13,9 @@ use frame_support::{ }; use frame_system::pallet_prelude::*; -use mangata_support::pools::{Inspect, Mutate, SwapResult}; +use mangata_support::pools::{ + ComputeBalances, Inspect, Mutate, PoolPair, PoolReserves, SwapResult, +}; use sp_arithmetic::traits::Unsigned; use sp_runtime::traits::{ checked_pow, AccountIdConversion, CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, Ensure, One, @@ -1702,28 +1704,35 @@ pub mod pallet { } } -impl Inspect for Pallet { +impl Inspect for Pallet { type CurrencyId = T::CurrencyId; type Balance = T::Balance; - fn get_pool_info( - pool_id: Self::CurrencyId, - ) -> Option> { + fn get_pool_info(pool_id: Self::CurrencyId) -> Option> { let info = Pools::::get(pool_id)?; let asset1 = info.assets.get(0)?; let asset2 = info.assets.get(1)?; Some((*asset1, *asset2)) } - fn get_pool_reserves( - pool_id: Self::CurrencyId, - ) -> Option> { + fn get_pool_reserves(pool_id: Self::CurrencyId) -> Option> { let reserves = Self::get_pool_reserves(&pool_id).ok()?; let balance1 = reserves.get(0)?; let balance2 = reserves.get(1)?; Some((*balance1, *balance2)) } + fn get_non_empty_pools() -> Option> { + let result = Pools::::iter_values() + .map(|v| v.lp_token) + .filter(|v| !T::Currency::total_issuance((*v).into()).is_zero()) + .collect(); + + Some(result) + } +} + +impl ComputeBalances for Pallet { fn get_dy( pool_id: Self::CurrencyId, asset_in: Self::CurrencyId, @@ -1770,15 +1779,6 @@ impl Inspect for Pallet { Some((*asset1, *asset2)) } - fn get_non_empty_pools() -> Option> { - let result = Pools::::iter_values() - .map(|v| v.lp_token) - .filter(|v| !T::Currency::total_issuance((*v).into()).is_zero()) - .collect(); - - Some(result) - } - fn get_mint_amount( pool_id: Self::CurrencyId, amounts: (Self::Balance, Self::Balance), diff --git a/pallets/xyk/Cargo.toml b/pallets/xyk/Cargo.toml index 7c9b631131..6797bc35b5 100644 --- a/pallets/xyk/Cargo.toml +++ b/pallets/xyk/Cargo.toml @@ -44,6 +44,7 @@ lazy_static.workspace = true serial_test.workspace = true similar-asserts.workspace = true test-case.workspace = true +mockall.workspace = true pallet-proof-of-stake = { path = "../proof-of-stake" } diff --git a/pallets/xyk/src/lib.rs b/pallets/xyk/src/lib.rs index a1b038e5cc..c7711a6ec5 100644 --- a/pallets/xyk/src/lib.rs +++ b/pallets/xyk/src/lib.rs @@ -309,7 +309,7 @@ use frame_support::{ }; use frame_system::pallet_prelude::*; use mangata_support::{ - pools::{Inspect, PoolInfo, PoolReserves, TreasuryBurn}, + pools::{ComputeBalances, Inspect, PoolPair, PoolReserves, TreasuryBurn}, traits::{ ActivationReservesProviderTrait, GetMaintenanceStatusTrait, PoolCreateApi, PreValidateSwaps, ProofOfStakeRewardsApi, Valuate, XykFunctionsTrait, @@ -3681,11 +3681,11 @@ impl PoolCreateApi, CurrencyIdOf> for P } } -impl Inspect for Pallet { +impl Inspect for Pallet { type CurrencyId = CurrencyIdOf; type Balance = BalanceOf; - fn get_pool_info(pool_id: Self::CurrencyId) -> Option> { + fn get_pool_info(pool_id: Self::CurrencyId) -> Option> { LiquidityPools::::get(pool_id) } @@ -3694,6 +3694,12 @@ impl Inspect for Pallet { Some(Pools::::get(info)) } + fn get_non_empty_pools() -> Option> { + Self::get_liq_tokens_for_trading().ok() + } +} + +impl ComputeBalances for Pallet { fn get_dy( _: Self::CurrencyId, asset_in: Self::CurrencyId, @@ -3748,10 +3754,6 @@ impl Inspect for Pallet { Self::get_burn_amount(pool.0, pool.1, lp_burn_amount).ok() } - fn get_non_empty_pools() -> Option> { - Self::get_liq_tokens_for_trading().ok() - } - fn get_mint_amount( pool_id: Self::CurrencyId, amounts: (Self::Balance, Self::Balance), @@ -3820,7 +3822,7 @@ impl Inspect for Pallet { } } -impl TreasuryBurn for Pallet { +impl TreasuryBurn for Pallet { fn settle_treasury_and_burn( asset_id: Self::CurrencyId, burn_amount: Self::Balance, diff --git a/pallets/xyk/src/mock.rs b/pallets/xyk/src/mock.rs index a082f83b00..9b46956732 100644 --- a/pallets/xyk/src/mock.rs +++ b/pallets/xyk/src/mock.rs @@ -11,7 +11,7 @@ use frame_support::{ PalletId, }; use frame_system as system; -pub use mangata_support::traits::ProofOfStakeRewardsApi; +pub use mangata_support::pools::{PoolInfo, ValuateFor}; use mangata_types::assets::CustomMetadata; use orml_tokens::{MultiTokenCurrencyAdapter, MultiTokenCurrencyExtended}; use orml_traits::{asset_registry::AssetMetadata, parameter_type_with_key}; @@ -299,6 +299,28 @@ impl Config for Test { type FeeLockWeight = (); } +mockall::mock! { + pub ValuationApi {} + + impl mangata_support::pools::Valuate for ValuationApi { + type CurrencyId = TokenId; + type Balance = Balance; + + fn find_paired_pool(base_id: TokenId, asset_id: TokenId) -> Result, DispatchError>; + + fn check_can_valuate(base_id: TokenId, pool_id: TokenId) -> Result<(), DispatchError>; + + fn check_pool_exist(pool_id: TokenId) -> Result<(), DispatchError>; + + fn get_reserve_and_lp_supply(base_id: TokenId, pool_id: TokenId) -> Option<(Balance, Balance)>; + + fn get_valuation_for_paired(base_id: TokenId, pool_id: TokenId, amount: Balance) -> Balance; + + fn find_valuation(base_id: TokenId, asset_id: TokenId, amount: Balance) -> Result; + } +} +impl ValuateFor for MockValuationApi {} + #[cfg(not(feature = "runtime-benchmarks"))] impl pallet_proof_of_stake::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -311,7 +333,7 @@ impl pallet_proof_of_stake::Config for Test { type RewardsSchedulesLimit = ConstU32<10>; type Min3rdPartyRewardValutationPerSession = ConstU128<10>; type Min3rdPartyRewardVolume = ConstU128<10>; - type ValuationApi = XykStorage; + type ValuationApi = MockValuationApi; type SchedulesPerBlock = ConstU32<5>; type NontransferableTokens = Nothing; } @@ -328,7 +350,7 @@ impl pallet_proof_of_stake::Config for Test { type RewardsSchedulesLimit = ConstU32<10>; type Min3rdPartyRewardValutationPerSession = ConstU128<10>; type Min3rdPartyRewardVolume = ConstU128<10>; - type ValuationApi = XykStorage; + type ValuationApi = MockValuationApi; type SchedulesPerBlock = ConstU32<5>; type NontransferableTokens = Nothing; } diff --git a/pallets/xyk/src/tests.rs b/pallets/xyk/src/tests.rs index f70ac4875e..5ebdabe7bb 100644 --- a/pallets/xyk/src/tests.rs +++ b/pallets/xyk/src/tests.rs @@ -2490,6 +2490,9 @@ fn test_compound_rewards(amount: u128, part_permille: u32, surplus: u128) { let amount_permille = Permill::from_parts(part_permille); System::set_block_number(1); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); + // MockPromotedPoolApi::instance().lock().unwrap().clear(); XykStorage::create_new_token(&2, amount); @@ -2530,6 +2533,9 @@ fn test_compound_rewards_pool_assets_order_swapped() { System::set_block_number(1); // MockPromotedPoolApi::instance().lock().unwrap().clear(); + let check_pool_exist_mock = MockValuationApi::check_pool_exist_context(); + check_pool_exist_mock.expect().return_const(Ok(())); + XykStorage::create_new_token(&2, amount); XykStorage::create_new_token(&2, amount); XykStorage::create_pool(RuntimeOrigin::signed(2), 1, amount / 2, 0, amount / 2).unwrap(); diff --git a/rollup/runtime/integration-test/src/proof_of_stake.rs b/rollup/runtime/integration-test/src/proof_of_stake.rs index 6fef461e30..01118aef05 100644 --- a/rollup/runtime/integration-test/src/proof_of_stake.rs +++ b/rollup/runtime/integration-test/src/proof_of_stake.rs @@ -1,6 +1,7 @@ use crate::setup::*; use frame_support::traits::{OnFinalize, OnInitialize}; use orml_tokens::MultiTokenCurrencyExtended; +use pallet_market::PoolKind; type TokensOf = ::Currency; type XykOf = ::ValuationApi; @@ -45,6 +46,7 @@ fn rewards_are_aligned_with_sessions() { XykOf::::create_pool( RuntimeOrigin::signed(alice.clone()), + PoolKind::Xyk, first_token_id, 100000_u128, second_token_id, @@ -66,8 +68,8 @@ fn rewards_are_aligned_with_sessions() { assert_eq!(0, pallet_session::Pallet::::current_index()); XykOf::::mint_liquidity( RuntimeOrigin::signed(charlie.clone()), + liqudity_token_id, first_token_id, - second_token_id, 1000, 10000, ) @@ -77,8 +79,8 @@ fn rewards_are_aligned_with_sessions() { assert_eq!(0, pallet_session::Pallet::::current_index()); XykOf::::mint_liquidity( RuntimeOrigin::signed(bob.clone()), + liqudity_token_id, first_token_id, - second_token_id, 1000, 10000, ) diff --git a/rollup/runtime/src/lib.rs b/rollup/runtime/src/lib.rs index 3882a79cbe..1486193b89 100644 --- a/rollup/runtime/src/lib.rs +++ b/rollup/runtime/src/lib.rs @@ -35,9 +35,12 @@ use sp_std::{ use sp_version::NativeVersion; use sp_version::RuntimeVersion; -pub use mangata_support::traits::{ - AssetRegistryApi, AssetRegistryProviderTrait, FeeLockTriggerTrait, GetMaintenanceStatusTrait, - PreValidateSwaps, ProofOfStakeRewardsApi, +pub use mangata_support::{ + pools::ValuateFor, + traits::{ + AssetRegistryApi, AssetRegistryProviderTrait, FeeLockTriggerTrait, + GetMaintenanceStatusTrait, PreValidateSwaps, ProofOfStakeRewardsApi, + }, }; pub use mangata_types::assets::{CustomMetadata, L1Asset, XcmMetadata, XykMetadata}; @@ -362,8 +365,10 @@ impl pallet_proof_of_stake::Config for Runtime { cfg::pallet_proof_of_stake::Min3rdPartyRewardValutationPerSession; type Min3rdPartyRewardVolume = cfg::pallet_proof_of_stake::Min3rdPartyRewardVolume; type SchedulesPerBlock = cfg::pallet_proof_of_stake::SchedulesPerBlock; - type ValuationApi = Xyk; + type ValuationApi = Market; type NontransferableTokens = tokens::NontransferableTokens; + #[cfg(feature = "runtime-benchmarks")] + type Xyk = Xyk; } impl pallet_bootstrap::BootstrapBenchmarkingConfig for Runtime {} @@ -495,9 +500,11 @@ impl pallet_fee_lock::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaxCuratedTokens = cfg::pallet_fee_lock::MaxCuratedTokens; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; - type PoolReservesProvider = Xyk; + type ValuateForNative = Market; type NativeTokenId = tokens::RxTokenId; type WeightInfo = weights::pallet_fee_lock_weights::ModuleWeight; + #[cfg(feature = "runtime-benchmarks")] + type Xyk = Xyk; } impl pallet_session::Config for Runtime { @@ -589,7 +596,7 @@ impl parachain_staking::Config for Runtime { type MinCandidateStk = cfg::parachain_staking::MinCandidateStk; type MinDelegation = cfg::parachain_staking::MinDelegatorStk; type NativeTokenId = tokens::RxTokenId; - type StakingLiquidityTokenValuator = Xyk; + type ValuateForNative = Market; type Issuance = Issuance; type StakingIssuanceVault = cfg::parachain_staking::StakingIssuanceVaultOf; type FallbackProvider = Council; diff --git a/rollup/runtime/src/runtime_config.rs b/rollup/runtime/src/runtime_config.rs index 9412ed467d..8fcca81518 100644 --- a/rollup/runtime/src/runtime_config.rs +++ b/rollup/runtime/src/runtime_config.rs @@ -1345,4 +1345,13 @@ pub mod config { } } } + + pub mod pallet_market { + use super::*; + + // in case of other valuation use a struct + // that impl the ValuateFor trait and delegates to Market for Valuate impl + // use such struct in pallet configs instead of Market + impl ValuateFor for Market {} + } }