From 77bf8a33d90f14e17bd9c7518e93249406f4bbcb Mon Sep 17 00:00:00 2001 From: aie0 <149175774+aie0@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:34:37 +0200 Subject: [PATCH] Dac squash 0.9.30 (#179) Co-authored-by: rakanalh --- .github/workflows/dev.yaml | 3 +- Cargo.lock | 330 +++++++++++++++-------------- pallets/ddc-customers/src/lib.rs | 65 +++--- pallets/ddc-customers/src/mock.rs | 6 +- pallets/ddc-customers/src/tests.rs | 112 +++++++++- pallets/ddc-payouts/src/lib.rs | 237 ++++++++++++--------- pallets/ddc-payouts/src/mock.rs | 39 +++- pallets/ddc-payouts/src/tests.rs | 251 ++++++++++++++++++++-- primitives/src/lib.rs | 1 - traits/Cargo.toml | 2 + traits/src/cluster.rs | 4 + traits/src/customer.rs | 11 +- 12 files changed, 703 insertions(+), 358 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 163c796df..045091f41 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -3,6 +3,7 @@ on: push: branches: - 'dev' + - 'deployment-0.9.30' workflow_dispatch: env: @@ -68,7 +69,7 @@ jobs: tags: | ${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ env.GITHUB_SHA }} - ${{ steps.login-ecr.outputs.registry }}/pos-network-node:dev-latest + ${{ steps.login-ecr.outputs.registry }}/pos-network-node:deployment-0.9.30-latest - name: Copy wasm artifacts from the image run: | diff --git a/Cargo.lock b/Cargo.lock index 8691a9de8..e40e763df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1636,6 +1636,8 @@ dependencies = [ "ddc-primitives", "frame-support", "frame-system", + "parity-scale-codec", + "scale-info", "sp-runtime", "sp-std", ] @@ -2144,7 +2146,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", ] @@ -2167,7 +2169,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -2190,7 +2192,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "Inflector", "array-bytes", @@ -2241,7 +2243,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2252,7 +2254,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2268,7 +2270,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -2297,7 +2299,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bitflags 1.3.2", "frame-metadata", @@ -2329,7 +2331,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "Inflector", "cfg-expr", @@ -2343,7 +2345,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2355,7 +2357,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro2", "quote", @@ -2365,7 +2367,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "log", @@ -2383,7 +2385,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -2398,7 +2400,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sp-api", @@ -2407,7 +2409,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "parity-scale-codec", @@ -4299,7 +4301,7 @@ dependencies = [ [[package]] name = "node-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-system", "parity-scale-codec", @@ -4495,7 +4497,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -4511,7 +4513,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -4526,7 +4528,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4550,7 +4552,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4570,7 +4572,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4585,7 +4587,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4633,7 +4635,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4652,7 +4654,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4669,7 +4671,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bitflags 1.3.2", "frame-benchmarking", @@ -4698,7 +4700,7 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -4710,7 +4712,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro2", "quote", @@ -4861,7 +4863,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4879,7 +4881,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4903,7 +4905,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4916,7 +4918,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4968,7 +4970,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4989,7 +4991,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5012,7 +5014,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5028,7 +5030,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5048,7 +5050,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5065,7 +5067,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5082,7 +5084,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5098,7 +5100,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5115,7 +5117,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5135,7 +5137,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sp-api", @@ -5145,7 +5147,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5162,7 +5164,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5185,7 +5187,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5200,7 +5202,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5214,7 +5216,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5229,7 +5231,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5245,7 +5247,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5266,7 +5268,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5282,7 +5284,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5296,7 +5298,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5319,7 +5321,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5330,7 +5332,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5344,7 +5346,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5362,7 +5364,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5381,7 +5383,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5397,7 +5399,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5412,7 +5414,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5423,7 +5425,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5440,7 +5442,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5456,7 +5458,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -6340,7 +6342,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "env_logger 0.9.3", "log", @@ -6604,7 +6606,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "sp-core", @@ -6615,7 +6617,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -6642,7 +6644,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "futures-timer", @@ -6665,7 +6667,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6681,7 +6683,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-trait-for-tuples", "memmap2", @@ -6698,7 +6700,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6709,7 +6711,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "chrono", @@ -6749,7 +6751,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "fnv", "futures", @@ -6777,7 +6779,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "hash-db", "kvdb", @@ -6802,7 +6804,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -6826,7 +6828,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "fork-tree", @@ -6868,7 +6870,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "jsonrpsee", @@ -6890,7 +6892,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6903,7 +6905,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -6927,7 +6929,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "sc-client-api", "sp-authorship", @@ -6938,7 +6940,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "lazy_static", "lru 0.7.8", @@ -6965,7 +6967,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "environmental", "parity-scale-codec", @@ -6981,7 +6983,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "parity-scale-codec", @@ -6996,7 +6998,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "cfg-if", "libc", @@ -7016,7 +7018,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ahash", "array-bytes", @@ -7057,7 +7059,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "finality-grandpa", "futures", @@ -7078,7 +7080,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ansi_term 0.12.1", "futures", @@ -7095,7 +7097,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "async-trait", @@ -7110,7 +7112,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "async-trait", @@ -7157,7 +7159,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "cid", "futures", @@ -7177,7 +7179,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -7203,7 +7205,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ahash", "futures", @@ -7221,7 +7223,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "futures", @@ -7242,7 +7244,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "fork-tree", @@ -7272,7 +7274,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "futures", @@ -7291,7 +7293,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "bytes", @@ -7321,7 +7323,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "libp2p", @@ -7334,7 +7336,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7343,7 +7345,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "hash-db", @@ -7373,7 +7375,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "jsonrpsee", @@ -7396,7 +7398,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "jsonrpsee", @@ -7409,7 +7411,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "hex", @@ -7428,7 +7430,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "directories", @@ -7499,7 +7501,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "parity-scale-codec", @@ -7513,7 +7515,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7532,7 +7534,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "libc", @@ -7551,7 +7553,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "chrono", "futures", @@ -7569,7 +7571,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ansi_term 0.12.1", "atty", @@ -7600,7 +7602,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7611,7 +7613,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -7638,7 +7640,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -7652,7 +7654,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "futures-timer", @@ -8065,7 +8067,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "hash-db", "log", @@ -8083,7 +8085,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "blake2", "proc-macro-crate", @@ -8095,7 +8097,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8108,7 +8110,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "integer-sqrt", "num-traits", @@ -8123,7 +8125,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8136,7 +8138,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "parity-scale-codec", @@ -8148,7 +8150,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sp-api", @@ -8160,7 +8162,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "log", @@ -8178,7 +8180,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -8197,7 +8199,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "merlin", @@ -8220,7 +8222,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8234,7 +8236,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8247,7 +8249,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "base58", @@ -8293,7 +8295,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "blake2", "byteorder", @@ -8307,7 +8309,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro2", "quote", @@ -8318,7 +8320,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8327,7 +8329,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro2", "quote", @@ -8337,7 +8339,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "environmental", "parity-scale-codec", @@ -8348,7 +8350,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "finality-grandpa", "log", @@ -8366,7 +8368,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8380,7 +8382,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bytes", "futures", @@ -8406,7 +8408,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "lazy_static", "sp-core", @@ -8417,7 +8419,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -8434,7 +8436,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "thiserror", "zstd", @@ -8443,7 +8445,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8457,7 +8459,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "sp-api", "sp-core", @@ -8467,7 +8469,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "backtrace", "lazy_static", @@ -8477,7 +8479,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "rustc-hash", "serde", @@ -8487,7 +8489,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "either", "hash256-std-hasher", @@ -8510,7 +8512,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8528,7 +8530,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "Inflector", "proc-macro-crate", @@ -8540,7 +8542,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "parity-scale-codec", @@ -8554,7 +8556,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8568,7 +8570,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8579,7 +8581,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "hash-db", "log", @@ -8601,12 +8603,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8619,7 +8621,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "sp-core", @@ -8632,7 +8634,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures-timer", @@ -8648,7 +8650,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sp-std", @@ -8660,7 +8662,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "sp-api", "sp-runtime", @@ -8669,7 +8671,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "log", @@ -8685,7 +8687,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ahash", "hash-db", @@ -8708,7 +8710,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8725,7 +8727,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -8736,7 +8738,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-trait-for-tuples", "log", @@ -8749,7 +8751,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8896,7 +8898,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "platforms 2.0.0", ] @@ -8904,7 +8906,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -8925,7 +8927,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures-util", "hyper", @@ -8938,7 +8940,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "jsonrpsee", @@ -8951,7 +8953,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "jsonrpsee", "log", @@ -8972,7 +8974,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "substrate-test-utils-derive", @@ -8982,7 +8984,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8993,7 +8995,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ansi_term 0.12.1", "build-helper", @@ -9439,7 +9441,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "clap", "frame-try-runtime", diff --git a/pallets/ddc-customers/src/lib.rs b/pallets/ddc-customers/src/lib.rs index 5e6b00d9d..a08f27eef 100644 --- a/pallets/ddc-customers/src/lib.rs +++ b/pallets/ddc-customers/src/lib.rs @@ -18,7 +18,7 @@ use codec::{Decode, Encode, HasCompact}; use ddc_primitives::{BucketId, ClusterId}; use ddc_traits::{ cluster::{ClusterCreator, ClusterVisitor}, - customer::{CustomerCharger, CustomerChargerError}, + customer::CustomerCharger, }; use frame_support::{ parameter_types, @@ -139,8 +139,6 @@ impl< .ok_or(Error::::ArithmeticOverflow)?; if temp <= value { unlocking_balance = temp; - self.active = - self.active.checked_sub(&last.value).ok_or(Error::::ArithmeticUnderflow)?; self.unlocking.pop(); } else { let diff = @@ -148,8 +146,6 @@ impl< unlocking_balance = unlocking_balance.checked_add(&diff).ok_or(Error::::ArithmeticOverflow)?; - self.active = - self.active.checked_sub(&diff).ok_or(Error::::ArithmeticUnderflow)?; last.value = last.value.checked_sub(&diff).ok_or(Error::::ArithmeticUnderflow)?; } @@ -442,7 +438,7 @@ pub mod pallet { .map_err(|_| Error::::NoMoreChunks)?; }; - Self::update_ledger(&owner, &ledger); + >::insert(&owner, &ledger); Self::deposit_event(Event::::InitialDepositUnlock(ledger.owner, value)); } @@ -481,7 +477,8 @@ pub mod pallet { log::debug!("Updating ledger"); // This was the consequence of a partial deposit unlock. just update the ledger and // move on. - Self::update_ledger(&owner, &ledger); + >::insert(&owner, &ledger); + // This is only an update, so we use less overall weight. Some(::WeightInfo::withdraw_unlocked_deposit_update()) }; @@ -523,11 +520,9 @@ pub mod pallet { owner: &T::AccountId, ledger: &AccountsLedger, T>, ) -> DispatchResult { - let account_id = Self::account_id(); - ::Currency::transfer( owner, - &account_id, + &Self::account_id(), ledger.total, ExistenceRequirement::KeepAlive, )?; @@ -536,14 +531,6 @@ pub mod pallet { Ok(()) } - /// Update the ledger for a owner. - fn update_ledger( - owner: &T::AccountId, - ledger: &AccountsLedger, T>, - ) { - >::insert(owner, ledger); - } - /// Remove all associated data of a owner account from the accounts system. /// /// Assumes storage is upgraded before calling. @@ -564,47 +551,49 @@ pub mod pallet { content_owner: T::AccountId, billing_vault: T::AccountId, amount: u128, - ) -> Result { + ) -> Result { let actually_charged: BalanceOf; - let mut ledger = Self::ledger(&content_owner).ok_or(CustomerChargerError::NotOwner)?; - let mut amount_to_deduct = amount.saturated_into::>(); + let mut ledger = Self::ledger(&content_owner).ok_or(Error::::NotOwner)?; + let amount_to_deduct = amount.saturated_into::>(); - ensure!(ledger.total >= ledger.active, CustomerChargerError::ArithmeticUnderflow); if ledger.active >= amount_to_deduct { actually_charged = amount_to_deduct; ledger.active = ledger .active .checked_sub(&amount_to_deduct) - .ok_or(CustomerChargerError::ArithmeticUnderflow)?; + .ok_or(Error::::ArithmeticUnderflow)?; ledger.total = ledger .total .checked_sub(&amount_to_deduct) - .ok_or(CustomerChargerError::ArithmeticUnderflow)?; - Self::update_ledger(&content_owner, &ledger); + .ok_or(Error::::ArithmeticUnderflow)?; + + >::insert(&content_owner, &ledger); } else { let diff = amount_to_deduct .checked_sub(&ledger.active) - .ok_or(CustomerChargerError::ArithmeticUnderflow)?; - actually_charged = diff; + .ok_or(Error::::ArithmeticUnderflow)?; + + actually_charged = ledger.active; ledger.total = ledger .total .checked_sub(&ledger.active) - .ok_or(CustomerChargerError::ArithmeticUnderflow)?; - amount_to_deduct = ledger.active; + .ok_or(Error::::ArithmeticUnderflow)?; ledger.active = BalanceOf::::zero(); - let (ledger, _charged) = ledger - .charge_unlocking(diff) - .map_err(|_| CustomerChargerError::UnlockFailed)?; - Self::update_ledger(&content_owner, &ledger); - }; + + let (ledger, charged) = ledger.charge_unlocking(diff)?; + + actually_charged.checked_add(&charged).ok_or(Error::::ArithmeticUnderflow)?; + + >::insert(&content_owner, &ledger); + } ::Currency::transfer( &Self::account_id(), &billing_vault, - amount_to_deduct, - ExistenceRequirement::KeepAlive, - ) - .map_err(|_| CustomerChargerError::TransferFailed)?; + actually_charged, + ExistenceRequirement::AllowDeath, + )?; + Self::deposit_event(Event::::Charged(content_owner, amount_to_deduct)); Ok(actually_charged.saturated_into::()) diff --git a/pallets/ddc-customers/src/mock.rs b/pallets/ddc-customers/src/mock.rs index 035b67550..3b62bc757 100644 --- a/pallets/ddc-customers/src/mock.rs +++ b/pallets/ddc-customers/src/mock.rs @@ -238,8 +238,10 @@ impl ExtBuilder { sp_tracing::try_init_simple(); let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); - let _ = pallet_balances::GenesisConfig:: { balances: vec![(1, 100), (2, 100)] } - .assimilate_storage(&mut storage); + let _ = pallet_balances::GenesisConfig:: { + balances: vec![(1, 100), (2, 100), (3, 1000)], + } + .assimilate_storage(&mut storage); TestExternalities::new(storage) } diff --git a/pallets/ddc-customers/src/tests.rs b/pallets/ddc-customers/src/tests.rs index f09c40ae6..081335ff2 100644 --- a/pallets/ddc-customers/src/tests.rs +++ b/pallets/ddc-customers/src/tests.rs @@ -80,26 +80,27 @@ fn deposit_and_deposit_extra_works() { BalancesError::::KeepAlive ); + let amount1 = 10_u128; // Deposited - assert_ok!(DdcCustomers::deposit(RuntimeOrigin::signed(account_1), 10_u128)); + assert_ok!(DdcCustomers::deposit(RuntimeOrigin::signed(account_1), amount1)); // Check storage assert_eq!( DdcCustomers::ledger(&account_1), Some(AccountsLedger { - owner: 1, - total: 10_u128, - active: 10_u128, + owner: account_1, + total: amount1, + active: amount1, unlocking: Default::default(), }) ); // Checking that event was emitted - System::assert_last_event(Event::Deposited(account_1, 10).into()); + System::assert_last_event(Event::Deposited(account_1, amount1).into()); // Deposit should fail when called the second time assert_noop!( - DdcCustomers::deposit(RuntimeOrigin::signed(account_1), 10_u128), + DdcCustomers::deposit(RuntimeOrigin::signed(account_1), amount1), Error::::AlreadyPaired ); @@ -110,21 +111,110 @@ fn deposit_and_deposit_extra_works() { ); // Deposited extra - assert_ok!(DdcCustomers::deposit_extra(RuntimeOrigin::signed(account_1), 20_u128)); + let amount2 = 20_u128; + assert_ok!(DdcCustomers::deposit_extra(RuntimeOrigin::signed(account_1), amount2)); // Check storage assert_eq!( DdcCustomers::ledger(&account_1), Some(AccountsLedger { - owner: 1, - total: 30_u128, - active: 30_u128, + owner: account_1, + total: amount1 + amount2, + active: amount1 + amount2, unlocking: Default::default(), }) ); // Checking that event was emitted - System::assert_last_event(Event::Deposited(account_1, 20).into()); + System::assert_last_event(Event::Deposited(account_1, amount2).into()); + }) +} + +#[test] +fn charge_content_owner_works() { + ExtBuilder.build_and_execute(|| { + System::set_block_number(1); + + let account_3 = 3; + let vault = 4; + let deposit = 100_u128; + + let balance_before_deposit = Balances::free_balance(account_3); + // Deposited + assert_ok!(DdcCustomers::deposit(RuntimeOrigin::signed(account_3), deposit)); + let balance_after_deposit = Balances::free_balance(account_3); + assert_eq!(balance_before_deposit - deposit, balance_after_deposit); + + let pallet_balance = Balances::free_balance(DdcCustomers::account_id()); + assert_eq!(deposit, pallet_balance); + + // Check storage + assert_eq!( + DdcCustomers::ledger(&account_3), + Some(AccountsLedger { + owner: account_3, + total: deposit, + active: deposit, + unlocking: Default::default(), + }) + ); + + // Checking that event was emitted + System::assert_last_event(Event::Deposited(account_3, deposit).into()); + + // successful transfer + let charge1 = 10; + let charged = DdcCustomers::charge_content_owner(account_3, vault, charge1).unwrap(); + assert_eq!(charge1, charged); + + let vault_balance = Balances::free_balance(vault); + assert_eq!(charged, vault_balance); + + let account_balance = Balances::free_balance(account_3); + assert_eq!(balance_after_deposit, account_balance); + + let pallet_balance_after_charge = Balances::free_balance(DdcCustomers::account_id()); + assert_eq!(pallet_balance - charged, pallet_balance_after_charge); + + // Check storage + assert_eq!( + DdcCustomers::ledger(&account_3), + Some(AccountsLedger { + owner: account_3, + total: deposit - charge1, + active: deposit - charge1, + unlocking: Default::default(), + }) + ); + + // failed transfer + let charge2 = 100u128; + let charge_result = DdcCustomers::charge_content_owner(account_3, vault, charge2).unwrap(); + assert_eq!( + DdcCustomers::ledger(&account_3), + Some(AccountsLedger { + owner: account_3, + total: 0, + active: 0, + unlocking: Default::default(), + }) + ); + + assert_eq!(0, Balances::free_balance(DdcCustomers::account_id())); + assert_eq!(charge_result, deposit - charge1); + + assert_ok!(DdcCustomers::deposit_extra(RuntimeOrigin::signed(account_3), deposit)); + assert_eq!( + DdcCustomers::ledger(&account_3), + Some(AccountsLedger { + owner: account_3, + total: deposit, + active: deposit, + unlocking: Default::default(), + }) + ); + + assert_eq!(deposit, Balances::free_balance(DdcCustomers::account_id())); }) } diff --git a/pallets/ddc-payouts/src/lib.rs b/pallets/ddc-payouts/src/lib.rs index 4447a99ea..ccdf466e3 100644 --- a/pallets/ddc-payouts/src/lib.rs +++ b/pallets/ddc-payouts/src/lib.rs @@ -60,10 +60,10 @@ pub struct NodeUsage { /// Stores reward in tokens(units) of node provider as per NodeUsage #[derive(PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, Default, Clone)] pub struct NodeReward { - pub transfer: u128, // tokens for transferred_bytes - pub storage: u128, // tokens for stored_bytes - pub puts: u128, // tokens for number_of_puts - pub gets: u128, // tokens for number_of_gets + pub transfer: u128, // reward in tokens for NodeUsage::transferred_bytes + pub storage: u128, // reward in tokens for NodeUsage::stored_bytes + pub puts: u128, // reward in tokens for NodeUsage::number_of_puts + pub gets: u128, // reward in tokens for NodeUsage::number_of_gets } #[derive(PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, Default, Clone)] @@ -77,10 +77,10 @@ pub struct BillingReportDebt { /// Stores charge in tokens(units) of customer as per CustomerUsage #[derive(PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, Default, Clone)] pub struct CustomerCharge { - pub transfer: u128, // tokens for transferred_bytes - pub storage: u128, // tokens for stored_bytes - pub puts: u128, // tokens for number_of_puts - pub gets: u128, // tokens for number_of_gets + pub transfer: u128, // charge in tokens for CustomerUsage::transferred_bytes + pub storage: u128, // charge in tokens for CustomerUsage::stored_bytes + pub puts: u128, // charge in tokens for CustomerUsage::number_of_puts + pub gets: u128, // charge in tokens for CustomerUsage::number_of_gets } /// The balance type of this pallet. @@ -130,12 +130,21 @@ pub mod pallet { Charged { cluster_id: ClusterId, era: DdcEra, + batch_index: BatchIndex, customer_id: T::AccountId, amount: u128, }, ChargeFailed { cluster_id: ClusterId, era: DdcEra, + batch_index: BatchIndex, + customer_id: T::AccountId, + amount: u128, + }, + Indebted { + cluster_id: ClusterId, + era: DdcEra, + batch_index: BatchIndex, customer_id: T::AccountId, amount: u128, }, @@ -250,17 +259,17 @@ pub mod pallet { } #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo, PartialEq, Default)] + // don't remove or change numbers, if needed add a new state to the end with new number + // DAC uses the state value for integration! pub enum State { #[default] - NotInitialized, - Initialized, - ChargingCustomers, - CustomersChargedWithFees, - CustomersCharged, - FeesDeducted, - RewardingProviders, - ProvidersRewarded, - Finalized, + NotInitialized = 1, + Initialized = 2, + ChargingCustomers = 3, + CustomersChargedWithFees = 4, + RewardingProviders = 5, + ProvidersRewarded = 6, + Finalized = 7, } #[pallet::call] @@ -359,7 +368,7 @@ pub mod pallet { let mut updated_billing_report = billing_report; for payer in payers { - let customer_charge = get_customer_charge::(cluster_id, &payer.1)?; + let mut customer_charge = get_customer_charge::(cluster_id, &payer.1)?; let total_customer_charge = (|| -> Option { customer_charge .transfer @@ -369,30 +378,6 @@ pub mod pallet { })() .ok_or(Error::::ArithmeticOverflow)?; - let temp_total_customer_storage_charge = updated_billing_report - .total_customer_charge - .storage - .checked_add(customer_charge.storage) - .ok_or(Error::::ArithmeticOverflow)?; - - let temp_total_customer_transfer_charge = updated_billing_report - .total_customer_charge - .transfer - .checked_add(customer_charge.transfer) - .ok_or(Error::::ArithmeticOverflow)?; - - let temp_total_customer_puts_charge = updated_billing_report - .total_customer_charge - .puts - .checked_add(customer_charge.puts) - .ok_or(Error::::ArithmeticOverflow)?; - - let temp_total_customer_gets_charge = updated_billing_report - .total_customer_charge - .gets - .checked_add(customer_charge.gets) - .ok_or(Error::::ArithmeticOverflow)?; - let customer_id = payer.0.clone(); let amount_actually_charged = match T::CustomerCharger::charge_content_owner( customer_id.clone(), @@ -409,38 +394,75 @@ pub mod pallet { DebtorCustomers::::try_get(cluster_id, customer_id.clone()) .unwrap_or_else(|_| Zero::zero()); - customer_debt = (|| -> Option { - customer_debt - .checked_add(total_customer_charge)? - .checked_sub(amount_actually_charged) - })() - .ok_or(Error::::ArithmeticOverflow)?; + let debt = total_customer_charge + .checked_sub(amount_actually_charged) + .ok_or(Error::::ArithmeticOverflow)?; + + customer_debt = + customer_debt.checked_add(debt).ok_or(Error::::ArithmeticOverflow)?; DebtorCustomers::::insert(cluster_id, customer_id.clone(), customer_debt); + Self::deposit_event(Event::::Indebted { + cluster_id, + era, + batch_index, + customer_id: customer_id.clone(), + amount: debt, + }); + Self::deposit_event(Event::::ChargeFailed { cluster_id, era, + batch_index, customer_id, amount: total_customer_charge, }); - } else { - updated_billing_report.total_customer_charge.storage = - temp_total_customer_storage_charge; - updated_billing_report.total_customer_charge.transfer = - temp_total_customer_transfer_charge; - updated_billing_report.total_customer_charge.puts = - temp_total_customer_puts_charge; - updated_billing_report.total_customer_charge.gets = - temp_total_customer_gets_charge; + if amount_actually_charged > 0 { + // something was charged and should be added + // calculate ratio + let ratio = + Perbill::from_rational(amount_actually_charged, total_customer_charge); + + customer_charge.storage = ratio * customer_charge.storage; + customer_charge.transfer = ratio * customer_charge.transfer; + customer_charge.gets = ratio * customer_charge.gets; + customer_charge.puts = ratio * customer_charge.puts; + } + } else { Self::deposit_event(Event::::Charged { cluster_id, era, + batch_index, customer_id, amount: total_customer_charge, }); } + + updated_billing_report.total_customer_charge.storage = updated_billing_report + .total_customer_charge + .storage + .checked_add(customer_charge.storage) + .ok_or(Error::::ArithmeticOverflow)?; + + updated_billing_report.total_customer_charge.transfer = updated_billing_report + .total_customer_charge + .transfer + .checked_add(customer_charge.transfer) + .ok_or(Error::::ArithmeticOverflow)?; + + updated_billing_report.total_customer_charge.puts = updated_billing_report + .total_customer_charge + .puts + .checked_add(customer_charge.puts) + .ok_or(Error::::ArithmeticOverflow)?; + + updated_billing_report.total_customer_charge.gets = updated_billing_report + .total_customer_charge + .gets + .checked_add(customer_charge.gets) + .ok_or(Error::::ArithmeticOverflow)?; } updated_billing_report @@ -491,50 +513,59 @@ pub mod pallet { let validators_fee = fees.validators_share * total_customer_charge; let cluster_reserve_fee = fees.cluster_reserve_share * total_customer_charge; - charge_treasury_fees::( - treasury_fee, - &billing_report.vault, - &T::TreasuryVisitor::get_account_id(), - )?; - Self::deposit_event(Event::::TreasuryFeesCollected { - cluster_id, - era, - amount: treasury_fee, - }); - - charge_cluster_reserve_fees::( - cluster_reserve_fee, - &billing_report.vault, - &T::ClusterVisitor::get_reserve_account_id(&cluster_id) - .map_err(|_| Error::::NotExpectedClusterState)?, - )?; - Self::deposit_event(Event::::ClusterReserveFeesCollected { - cluster_id, - era, - amount: cluster_reserve_fee, - }); - - charge_validator_fees::(validators_fee, &billing_report.vault)?; - Self::deposit_event(Event::::ValidatorFeesCollected { - cluster_id, - era, - amount: validators_fee, - }); + if treasury_fee > 0 { + charge_treasury_fees::( + treasury_fee, + &billing_report.vault, + &T::TreasuryVisitor::get_account_id(), + )?; + + Self::deposit_event(Event::::TreasuryFeesCollected { + cluster_id, + era, + amount: treasury_fee, + }); + } + + if cluster_reserve_fee > 0 { + charge_cluster_reserve_fees::( + cluster_reserve_fee, + &billing_report.vault, + &T::ClusterVisitor::get_reserve_account_id(&cluster_id) + .map_err(|_| Error::::NotExpectedClusterState)?, + )?; + Self::deposit_event(Event::::ClusterReserveFeesCollected { + cluster_id, + era, + amount: cluster_reserve_fee, + }); + } + + if validators_fee > 0 { + charge_validator_fees::(validators_fee, &billing_report.vault)?; + Self::deposit_event(Event::::ValidatorFeesCollected { + cluster_id, + era, + amount: validators_fee, + }); + } // 1 - (X + Y + Z) > 0, 0 < X + Y + Z < 1 let total_left_from_one = (fees.treasury_share + fees.validators_share + fees.cluster_reserve_share) .left_from_one(); - // X * Z < X, 0 < Z < 1 - billing_report.total_customer_charge.transfer = - total_left_from_one * billing_report.total_customer_charge.transfer; - billing_report.total_customer_charge.storage = - total_left_from_one * billing_report.total_customer_charge.storage; - billing_report.total_customer_charge.puts = - total_left_from_one * billing_report.total_customer_charge.puts; - billing_report.total_customer_charge.gets = - total_left_from_one * billing_report.total_customer_charge.gets; + if !total_left_from_one.is_zero() { + // X * Z < X, 0 < Z < 1 + billing_report.total_customer_charge.transfer = + total_left_from_one * billing_report.total_customer_charge.transfer; + billing_report.total_customer_charge.storage = + total_left_from_one * billing_report.total_customer_charge.storage; + billing_report.total_customer_charge.puts = + total_left_from_one * billing_report.total_customer_charge.puts; + billing_report.total_customer_charge.gets = + total_left_from_one * billing_report.total_customer_charge.gets; + } billing_report.state = State::CustomersChargedWithFees; ActiveBillingReports::::insert(cluster_id, era, billing_report); @@ -624,7 +655,7 @@ pub mod pallet { &updated_billing_report.vault, &node_provider_id, reward, - ExistenceRequirement::KeepAlive, + ExistenceRequirement::AllowDeath, )?; updated_billing_report @@ -689,7 +720,7 @@ pub mod pallet { let caller = ensure_signed(origin)?; ensure!(Self::authorised_caller() == Some(caller), Error::::Unauthorised); - let billing_report = ActiveBillingReports::::try_get(cluster_id, era) + let mut billing_report = ActiveBillingReports::::try_get(cluster_id, era) .map_err(|_| Error::::BillingReportDoesNotExist)?; ensure!(billing_report.state == State::ProvidersRewarded, Error::::NotExpectedState); @@ -708,7 +739,11 @@ pub mod pallet { Error::::NotDistributedBalance ); - ActiveBillingReports::::remove(cluster_id, era); + billing_report.charging_processed_batches.clear(); + billing_report.rewarding_processed_batches.clear(); + billing_report.state = State::Finalized; + + ActiveBillingReports::::insert(cluster_id, era, billing_report); Self::deposit_event(Event::::BillingReportFinalized { cluster_id, era }); Ok(()) @@ -725,7 +760,7 @@ pub mod pallet { vault, treasury_vault, amount_to_deduct, - ExistenceRequirement::KeepAlive, + ExistenceRequirement::AllowDeath, ) } @@ -739,7 +774,7 @@ pub mod pallet { vault, reserve_vault, amount_to_deduct, - ExistenceRequirement::KeepAlive, + ExistenceRequirement::AllowDeath, ) } @@ -757,7 +792,7 @@ pub mod pallet { vault, &validator_account_id, amount_to_deduct, - ExistenceRequirement::KeepAlive, + ExistenceRequirement::AllowDeath, )?; } diff --git a/pallets/ddc-payouts/src/mock.rs b/pallets/ddc-payouts/src/mock.rs index 956b2e9d1..dc519a4a3 100644 --- a/pallets/ddc-payouts/src/mock.rs +++ b/pallets/ddc-payouts/src/mock.rs @@ -5,7 +5,7 @@ use ddc_primitives::{ClusterBondingParams, ClusterFeesParams, ClusterPricingParams, NodeType}; use ddc_traits::{ cluster::{ClusterVisitor, ClusterVisitorError}, - customer::{CustomerCharger, CustomerChargerError}, + customer::CustomerCharger, pallet::PalletVisitor, }; use frame_election_provider_support::SortedListProvider; @@ -21,6 +21,7 @@ use sp_io::TestExternalities; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, + DispatchError, }; use sp_std::prelude::*; @@ -112,12 +113,12 @@ impl CustomerCharger for TestCustomerCharger { content_owner: T::AccountId, billing_vault: T::AccountId, amount: u128, - ) -> Result { - ensure!(amount > 1_000_000, CustomerChargerError::TransferFailed); // any error will do + ) -> Result { + ensure!(amount > 1_000_000, DispatchError::BadOrigin); // any error will do let mut amount_to_charge = amount; if amount_to_charge < 50_000_000 { - amount_to_charge = PARTIAL_CHARGE; + amount_to_charge = PARTIAL_CHARGE; // for user 3 } let charge = amount_to_charge.saturated_into::>(); @@ -127,8 +128,7 @@ impl CustomerCharger for TestCustomerCharger { &billing_vault, charge, ExistenceRequirement::KeepAlive, - ) - .map_err(|_| CustomerChargerError::TransferFailed)?; + )?; Ok(amount_to_charge) } } @@ -139,6 +139,9 @@ pub const VALIDATOR1_ACCOUNT_ID: AccountId = 111; pub const VALIDATOR2_ACCOUNT_ID: AccountId = 222; pub const VALIDATOR3_ACCOUNT_ID: AccountId = 333; pub const PARTIAL_CHARGE: u128 = 100; +pub const USER3_BALANCE: u128 = 1000; + +pub const FREE_CLUSTER_ID: ClusterId = ClusterId::zero(); pub const PRICING_PARAMS: ClusterPricingParams = ClusterPricingParams { unit_per_mb_streamed: 2_000_000, @@ -153,6 +156,12 @@ pub const PRICING_FEES: ClusterFeesParams = ClusterFeesParams { cluster_reserve_share: Perbill::from_percent(2), }; +pub const PRICING_FEES_ZERO: ClusterFeesParams = ClusterFeesParams { + treasury_share: Perbill::from_percent(0), + validators_share: Perbill::from_percent(0), + cluster_reserve_share: Perbill::from_percent(0), +}; + pub struct TestTreasuryVisitor; impl PalletVisitor for TestTreasuryVisitor { fn get_account_id() -> T::AccountId { @@ -230,6 +239,14 @@ impl SortedListProvider for TestValidator } } +pub fn get_fees(cluster_id: &ClusterId) -> Result { + if *cluster_id == FREE_CLUSTER_ID { + Ok(PRICING_FEES_ZERO) + } else { + Ok(PRICING_FEES) + } +} + pub struct TestClusterVisitor; impl ClusterVisitor for TestClusterVisitor { fn ensure_cluster(_cluster_id: &ClusterId) -> Result<(), ClusterVisitorError> { @@ -260,8 +277,8 @@ impl ClusterVisitor for TestClusterVisitor { Ok(PRICING_PARAMS) } - fn get_fees_params(_cluster_id: &ClusterId) -> Result { - Ok(PRICING_FEES) + fn get_fees_params(cluster_id: &ClusterId) -> Result { + get_fees(cluster_id) } fn get_reserve_account_id( @@ -274,7 +291,7 @@ impl ClusterVisitor for TestClusterVisitor { fn get_bonding_params( _cluster_id: &ClusterId, ) -> Result, ClusterVisitorError> { - Err(ClusterVisitorError::ClusterDoesNotExist) + unimplemented!() } } @@ -290,8 +307,8 @@ impl ExtBuilder { let _ = pallet_balances::GenesisConfig:: { balances: vec![ (1, 1000000000000000000000000), - (2, 10), // < PARTIAL_CHARGE - (3, 1000), // > PARTIAL_CHARGE + (2, 10), // < PARTIAL_CHARGE + (3, USER3_BALANCE), // > PARTIAL_CHARGE (4, 1000000000000000000000000), ], } diff --git a/pallets/ddc-payouts/src/tests.rs b/pallets/ddc-payouts/src/tests.rs index 3cd324dba..2197f6654 100644 --- a/pallets/ddc-payouts/src/tests.rs +++ b/pallets/ddc-payouts/src/tests.rs @@ -258,11 +258,20 @@ fn send_charging_customers_batch_fails_uninitialised() { }) } +fn calculate_charge_parts(usage: CustomerUsage) -> CustomerCharge { + CustomerCharge { + transfer: PRICING_PARAMS.unit_per_mb_streamed * (usage.transferred_bytes as u128) / + byte_unit::MEBIBYTE, + storage: (PRICING_PARAMS.unit_per_mb_stored * usage.stored_bytes as u128) / + byte_unit::MEBIBYTE, + puts: PRICING_PARAMS.unit_per_put_request * usage.number_of_puts, + gets: PRICING_PARAMS.unit_per_get_request * usage.number_of_gets, + } +} + fn calculate_charge(usage: CustomerUsage) -> u128 { - PRICING_PARAMS.unit_per_mb_streamed * (usage.transferred_bytes as u128) / byte_unit::MEBIBYTE + - (PRICING_PARAMS.unit_per_mb_stored * usage.stored_bytes as u128) / byte_unit::MEBIBYTE + - PRICING_PARAMS.unit_per_put_request * usage.number_of_puts + - PRICING_PARAMS.unit_per_get_request * usage.number_of_gets + let charge = calculate_charge_parts(usage); + charge.transfer + charge.storage + charge.puts + charge.gets } #[test] @@ -278,7 +287,7 @@ fn send_charging_customers_batch_works() { let cluster_id = ClusterId::from([12; 20]); let era = 100; let max_batch_index = 3; - let batch_index = 0; + let mut batch_index = 0; let usage1 = CustomerUsage { // should pass without debt transferred_bytes: 23452345, @@ -294,7 +303,7 @@ fn send_charging_customers_batch_works() { number_of_gets: 4, }; let usage3 = CustomerUsage { - // should pass but with debt + // should pass but with debt (partial charge) transferred_bytes: 1, stored_bytes: 2, number_of_puts: 3, @@ -335,29 +344,64 @@ fn send_charging_customers_batch_works() { payers1, )); - let usage4_charge = calculate_charge(usage4); + let usage4_charge = calculate_charge(usage4.clone()); let mut balance = Balances::free_balance(DdcPayouts::sub_account_id(cluster_id, era)); assert_eq!(balance, usage4_charge); let user2_debt = DdcPayouts::debtor_customers(cluster_id, user2_debtor).unwrap(); - let mut debt = calculate_charge(usage2); + let mut debt = calculate_charge(usage2.clone()); assert_eq!(user2_debt, debt); + let mut report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge2 = calculate_charge_parts(usage2); + let charge4 = calculate_charge_parts(usage4); + assert_eq!(charge2.puts + charge4.puts, report.total_customer_charge.puts); + assert_eq!(charge2.gets + charge4.gets, report.total_customer_charge.gets); + assert_eq!(charge2.storage + charge4.storage, report.total_customer_charge.storage); + assert_eq!(charge2.transfer + charge4.transfer, report.total_customer_charge.transfer); + + System::assert_has_event( + Event::ChargeFailed { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + amount: debt, + } + .into(), + ); + System::assert_has_event( - Event::ChargeFailed { cluster_id, era, customer_id: user2_debtor, amount: debt }.into(), + Event::Indebted { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + amount: debt, + } + .into(), ); System::assert_last_event( - Event::Charged { cluster_id, era, customer_id: user4, amount: usage4_charge }.into(), + Event::Charged { + cluster_id, + era, + customer_id: user4, + batch_index, + amount: usage4_charge, + } + .into(), ); - assert_eq!(System::events().len(), 5 + 3); // 3 for Currency::transfer + assert_eq!(System::events().len(), 5 + 3 + 1); // 3 for Currency::transfer // batch 2 + let mut before_total_customer_charge = report.total_customer_charge.clone(); + batch_index += 1; assert_ok!(DdcPayouts::send_charging_customers_batch( RuntimeOrigin::signed(dac_account), cluster_id, era, - batch_index + 1, + batch_index, payers2, )); @@ -365,40 +409,93 @@ fn send_charging_customers_batch_works() { Event::Charged { cluster_id, era, + batch_index, customer_id: user1, - amount: calculate_charge(usage1), + amount: calculate_charge(usage1.clone()), } .into(), ); - let report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge1 = calculate_charge_parts(usage1); + assert_eq!( + charge1.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + charge1.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + charge1.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + charge1.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + assert_eq!(report.state, State::ChargingCustomers); let user1_debt = DdcPayouts::debtor_customers(cluster_id, user1); assert_eq!(user1_debt, None); let balance_before = Balances::free_balance(DdcPayouts::sub_account_id(cluster_id, era)); + // batch 3 + batch_index += 2; + before_total_customer_charge = report.total_customer_charge.clone(); assert_ok!(DdcPayouts::send_charging_customers_batch( RuntimeOrigin::signed(dac_account), cluster_id, era, - batch_index + 2, + batch_index, payers3, )); - let user3_charge = calculate_charge(usage3); + let user3_charge = calculate_charge(usage3.clone()); + let charge3 = calculate_charge_parts(usage3); + let ratio = Perbill::from_rational(PARTIAL_CHARGE, user3_charge); + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert_eq!( + ratio * charge3.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + ratio * charge3.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + ratio * charge3.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + ratio * charge3.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + balance = Balances::free_balance(DdcPayouts::sub_account_id(cluster_id, era)); assert_eq!(balance, balance_before + PARTIAL_CHARGE); let user3_debt = DdcPayouts::debtor_customers(cluster_id, user3_debtor).unwrap(); - debt = user3_charge - PARTIAL_CHARGE; assert_eq!(user3_debt, debt); + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user3_debtor, + batch_index, + amount: user3_debt, + } + .into(), + ); + System::assert_last_event( Event::ChargeFailed { cluster_id, era, + batch_index, customer_id: user3_debtor, amount: user3_charge, } @@ -523,7 +620,8 @@ fn end_charging_customers_works() { let report_before = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); let charge = calculate_charge(usage1); System::assert_last_event( - Event::Charged { cluster_id, era, customer_id: user1, amount: charge }.into(), + Event::Charged { cluster_id, era, batch_index, customer_id: user1, amount: charge } + .into(), ); let mut balance = Balances::free_balance(DdcPayouts::sub_account_id(cluster_id, era)); @@ -599,6 +697,117 @@ fn end_charging_customers_works() { }) } +#[test] +fn end_charging_customers_works_zero_fees() { + ExtBuilder.build_and_execute(|| { + System::set_block_number(1); + + let dac_account = 123u64; + let user1 = 1u64; + let cluster_id = ClusterId::zero(); + let era = 100; + let max_batch_index = 0; + let batch_index = 0; + let usage1 = CustomerUsage { + transferred_bytes: 23452345, + stored_bytes: 3345234523, + number_of_puts: 4456456345234523, + number_of_gets: 523423, + }; + let payers = vec![(user1, usage1.clone())]; + + assert_ok!(DdcPayouts::set_authorised_caller(RuntimeOrigin::root(), dac_account)); + + assert_ok!(DdcPayouts::begin_billing_report( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + )); + + assert_ok!(DdcPayouts::begin_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + max_batch_index, + )); + + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers, + )); + + let report_before = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge = calculate_charge(usage1); + System::assert_last_event( + Event::Charged { cluster_id, era, customer_id: user1, batch_index, amount: charge } + .into(), + ); + + let mut balance = Balances::free_balance(DdcPayouts::sub_account_id(cluster_id, era)); + assert_eq!(balance, charge); + assert_eq!(System::events().len(), 4 + 3); // 3 for Currency::transfer + + assert_ok!(DdcPayouts::end_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + )); + + System::assert_has_event(Event::ChargingFinished { cluster_id, era }.into()); + assert_eq!(System::events().len(), 7 + 1); + + let report_after = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert_eq!(report_after.state, State::CustomersChargedWithFees); + + let fees = get_fees(&cluster_id).unwrap(); + + let total_left_from_one = + (fees.treasury_share + fees.validators_share + fees.cluster_reserve_share) + .left_from_one(); + + assert_eq!(total_left_from_one, Perbill::one()); + + assert_eq!(fees.treasury_share, Perbill::zero()); + assert_eq!(fees.validators_share, Perbill::zero()); + assert_eq!(fees.cluster_reserve_share, Perbill::zero()); + + balance = Balances::free_balance(TREASURY_ACCOUNT_ID); + assert_eq!(balance, 0); + + balance = Balances::free_balance(RESERVE_ACCOUNT_ID); + assert_eq!(balance, 0); + + balance = Balances::free_balance(VALIDATOR1_ACCOUNT_ID); + assert_eq!(balance, 0); + + balance = Balances::free_balance(VALIDATOR2_ACCOUNT_ID); + assert_eq!(balance, 0); + + balance = Balances::free_balance(VALIDATOR3_ACCOUNT_ID); + assert_eq!(balance, 0); + + assert_eq!( + report_after.total_customer_charge.transfer, + total_left_from_one * report_before.total_customer_charge.transfer + ); + assert_eq!( + report_after.total_customer_charge.storage, + total_left_from_one * report_before.total_customer_charge.storage + ); + assert_eq!( + report_after.total_customer_charge.puts, + total_left_from_one * report_before.total_customer_charge.puts + ); + assert_eq!( + report_after.total_customer_charge.gets, + total_left_from_one * report_before.total_customer_charge.gets + ); + }) +} + #[test] fn begin_rewarding_providers_fails_uninitialised() { ExtBuilder.build_and_execute(|| { @@ -1585,7 +1794,9 @@ fn end_billing_report_works() { System::assert_last_event(Event::BillingReportFinalized { cluster_id, era }.into()); - let report_end = DdcPayouts::active_billing_reports(cluster_id, era); - assert_eq!(report_end, None); + let report_end = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert!(report_end.rewarding_processed_batches.is_empty()); + assert!(report_end.charging_processed_batches.is_empty()); + assert_eq!(report_end.state, State::Finalized); }) } diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index a665c1a29..56df30ee5 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -6,7 +6,6 @@ use scale_info::{prelude::vec::Vec, TypeInfo}; use serde::{Deserialize, Serialize}; use sp_core::hash::H160; use sp_runtime::{AccountId32, Perbill, RuntimeDebug}; - pub type ClusterId = H160; pub type DdcEra = u32; pub type BucketId = u64; diff --git a/traits/Cargo.toml b/traits/Cargo.toml index b2c023f10..e37e4d659 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -4,8 +4,10 @@ version = "0.1.0" edition = "2021" [dependencies] +codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } ddc-primitives = { version = "0.1.0", default-features = false, path = "../primitives" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } diff --git a/traits/src/cluster.rs b/traits/src/cluster.rs index 6752205b0..d980c1ae4 100644 --- a/traits/src/cluster.rs +++ b/traits/src/cluster.rs @@ -1,9 +1,12 @@ +use codec::{Decode, Encode}; use ddc_primitives::{ ClusterBondingParams, ClusterFeesParams, ClusterGovParams, ClusterId, ClusterParams, ClusterPricingParams, NodePubKey, NodeType, }; use frame_support::dispatch::DispatchResult; use frame_system::Config; +use scale_info::TypeInfo; +use sp_runtime::RuntimeDebug; pub trait ClusterVisitor { fn ensure_cluster(cluster_id: &ClusterId) -> Result<(), ClusterVisitorError>; @@ -46,6 +49,7 @@ pub trait ClusterCreator { ) -> DispatchResult; } +#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo, PartialEq)] pub enum ClusterVisitorError { ClusterDoesNotExist, ClusterGovParamsNotSet, diff --git a/traits/src/customer.rs b/traits/src/customer.rs index ad944e39b..80af26050 100644 --- a/traits/src/customer.rs +++ b/traits/src/customer.rs @@ -1,15 +1,8 @@ +use sp_runtime::DispatchError; pub trait CustomerCharger { - // todo: WIP for decoupling payout and customers fn charge_content_owner( content_owner: T::AccountId, billing_vault: T::AccountId, amount: u128, - ) -> Result; -} - -pub enum CustomerChargerError { - NotOwner, - ArithmeticUnderflow, - TransferFailed, - UnlockFailed, + ) -> Result; }