diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ab8d3bd2..e672a0c9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,6 +27,7 @@ jobs: rustup update stable rustup toolchain install nightly-2021-08-31 rustup default nightly-2021-08-31 + rustup override set nightly-2021-08-31 rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31 cargo build --release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f92c876f5..0b13da89c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,12 +22,14 @@ jobs: with: profile: minimal toolchain: nightly + override: true - name: Initialize WASM build environment run: | rustup update stable rustup toolchain install nightly-2021-08-31 rustup default nightly-2021-08-31 + rustup override set nightly-2021-08-31 rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31 - name: Run cargo check @@ -52,12 +54,14 @@ jobs: with: profile: minimal toolchain: nightly + override: true - name: Initialize WASM build environment run: | rustup update stable rustup toolchain install nightly-2021-08-31 rustup default nightly-2021-08-31 + rustup override set nightly-2021-08-31 rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31 # Runs integration tests in the runtime/tests folder @@ -87,6 +91,7 @@ jobs: cargo +nightly-2021-08-31 test -p mining-setting-hardware && cargo +nightly-2021-08-31 test -p mining-rates-token && cargo +nightly-2021-08-31 test -p mining-rates-hardware && + cargo +nightly-2021-08-31 test -p mining-rewards-allowance && cargo +nightly-2021-08-31 test -p mining-sampling-token && cargo +nightly-2021-08-31 test -p mining-sampling-hardware && cargo +nightly-2021-08-31 test -p mining-eligibility-token && diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 72605bf02..364469ec9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -349,7 +349,7 @@ cargo +nightly-2021-08-31-aarch64-apple-darwin fmt --all -- --check * Ans: Because there is a type mismatch, perhaps the first variable requires a `Balance` instead of `u32` in custom_types.json or similar. * Question: How to debug when running tests? - * Ans: Run tests with this `SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug` in front, i.e. `SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug cargo +nightly-2021-08-31 test -p datahighway-runtime`, and use `println!` where you want to log the output (i.e. `println!("claim duration {:#?}", claim_duration);`), as `debug::info!` not work in tests. Try using `info!` (have not tried yet) + * Ans: Run tests with this `SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug` in front and `-- --nocapture` at the end, i.e. `SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug cargo +nightly-2021-08-31 test -p datahighway-runtime -- --nocapture`, and use `println!` in the implementation where you want to log the output (i.e. `println!("claim duration {:#?}", claim_duration);`), as `debug::info!` not work in tests. It is important that you do a find/replace to comment out all those `println!` statements before you build your code with `cargo build`, otherwise it will give an error message `duplicate lang item in crate`. * Question: Why can't I connect my node to telemetry? * Ans: Try use these flags when running your node `--telemetry-url 'wss://telemetry.polkadot.io/submit/ 0' --unsafe-ws-external --unsafe-rpc-external --rpc-cors=all --rpc-methods=Unsafe` diff --git a/Cargo.lock b/Cargo.lock index 2a44d373a..1f1acee77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -786,9 +786,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cf2cc85830eae84823884db23c5306442a6c3d5bfd3beb2f2a2c829faa1816" +checksum = "10612c0ec0e0a1ff0e97980647cb058a6e7aedb913d01d009c406b8b7d0b26ee" dependencies = [ "glob", "libc", @@ -1216,6 +1216,7 @@ dependencies = [ "mining-execution-token", "mining-rates-hardware", "mining-rates-token", + "mining-rewards-allowance", "mining-sampling-hardware", "mining-sampling-token", "mining-setting-hardware", @@ -1588,9 +1589,9 @@ dependencies = [ [[package]] name = "finality-grandpa" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c832d0ed507622c7cb98e9b7f10426850fc9d38527ab8071778dcc3a81d45875" +checksum = "e8ac3ff5224ef91f3c97e03eb1de2db82743427e91aaa5ac635f454f0b164f5a" dependencies = [ "either", "futures 0.3.17", @@ -1642,7 +1643,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", ] @@ -1660,7 +1661,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -1679,7 +1680,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "Inflector", "chrono", @@ -1705,7 +1706,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -1718,7 +1719,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -1733,7 +1734,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "14.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "serde", @@ -1744,7 +1745,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "bitflags", "frame-metadata", @@ -1770,7 +1771,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -1782,7 +1783,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -1794,7 +1795,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "proc-macro2", "quote", @@ -1804,7 +1805,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "log", @@ -1820,7 +1821,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "sp-api", @@ -2345,9 +2346,9 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28538916eb3f3976311f5dfbe67b5362d0add1293d0a9cad17debf86f8e3aa48" +checksum = "c9a83ec4af652890ac713ffd8dc859e650420a5ef47f7b9be29b6664ab50fbc8" dependencies = [ "if-addrs-sys", "libc", @@ -3693,6 +3694,40 @@ dependencies = [ "sp-std", ] +[[package]] +name = "mining-rewards-allowance" +version = "3.0.6" +dependencies = [ + "chrono", + "frame-support", + "frame-system", + "log", + "module-primitives", + "pallet-aura", + "pallet-balances", + "pallet-bounties", + "pallet-collective", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-membership", + "pallet-randomness-collective-flip", + "pallet-scheduler", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-treasury", + "parity-scale-codec", + "rand 0.8.4", + "serde", + "sp-consensus-aura", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "static_assertions", + "substrate-fixed", +] + [[package]] name = "mining-sampling-hardware" version = "0.1.0" @@ -4174,7 +4209,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4189,7 +4224,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4204,7 +4239,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4218,7 +4253,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-benchmarking", "frame-support", @@ -4232,7 +4267,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4245,7 +4280,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4260,7 +4295,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-benchmarking", "frame-support", @@ -4275,7 +4310,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4294,7 +4329,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4310,7 +4345,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-benchmarking", "frame-support", @@ -4332,7 +4367,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4347,7 +4382,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4365,7 +4400,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4380,7 +4415,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-benchmarking", "frame-support", @@ -4395,7 +4430,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4408,7 +4443,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4424,7 +4459,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4437,7 +4472,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-benchmarking", "frame-support", @@ -4452,7 +4487,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4472,7 +4507,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4492,7 +4527,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -4503,7 +4538,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4516,7 +4551,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-benchmarking", "frame-support", @@ -4532,7 +4567,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4546,7 +4581,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4562,7 +4597,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4579,7 +4614,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -4590,7 +4625,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -4605,7 +4640,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-support", "frame-system", @@ -5206,9 +5241,9 @@ dependencies = [ [[package]] name = "pwasm-utils" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c1a2f10b47d446372a4f397c58b329aaea72b2daf9395a623a411cb8ccb54f" +checksum = "880b3384fb00b8f6ecccd5d358b93bd2201900ae3daad213791d1864f6441f5c" dependencies = [ "byteorder", "log", @@ -6052,7 +6087,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "log", "sp-core", @@ -6063,7 +6098,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "derive_more", @@ -6090,7 +6125,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -6113,7 +6148,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6129,7 +6164,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -6145,7 +6180,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -6156,7 +6191,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "chrono", "fdlimit", @@ -6194,7 +6229,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "fnv", "futures 0.3.17", @@ -6222,7 +6257,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "hash-db", "kvdb", @@ -6247,7 +6282,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "futures 0.3.17", @@ -6271,7 +6306,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "derive_more", @@ -6300,7 +6335,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6313,7 +6348,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "futures 0.3.17", @@ -6339,7 +6374,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "sc-client-api", "sp-authorship", @@ -6350,7 +6385,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "lazy_static", "libsecp256k1 0.6.0", @@ -6376,7 +6411,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "derive_more", "parity-scale-codec", @@ -6393,7 +6428,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "log", "parity-scale-codec", @@ -6409,7 +6444,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "cfg-if 1.0.0", "libc", @@ -6428,7 +6463,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "derive_more", @@ -6465,7 +6500,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "ansi_term 0.12.1", "futures 0.3.17", @@ -6482,7 +6517,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "derive_more", @@ -6497,7 +6532,7 @@ dependencies = [ [[package]] name = "sc-light" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "hash-db", "parity-scale-codec", @@ -6515,7 +6550,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-std", "async-trait", @@ -6566,7 +6601,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -6582,7 +6617,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "bytes 1.1.0", "fnv", @@ -6609,7 +6644,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "libp2p", @@ -6622,7 +6657,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -6631,7 +6666,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "hash-db", @@ -6662,7 +6697,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "jsonrpc-core", @@ -6687,7 +6722,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "jsonrpc-core", @@ -6703,7 +6738,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "directories", @@ -6767,7 +6802,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "log", "parity-scale-codec", @@ -6781,7 +6816,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "chrono", "futures 0.3.17", @@ -6799,7 +6834,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "ansi_term 0.12.1", "atty", @@ -6830,7 +6865,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -6841,7 +6876,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "intervalier", @@ -6868,7 +6903,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "derive_more", "futures 0.3.17", @@ -6881,9 +6916,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "0.10.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e62ff266e136db561a007c84569985805f84a1d5a08278e52c36aacb6e061b" +checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" dependencies = [ "bitvec 0.20.4", "cfg-if 1.0.0", @@ -6894,9 +6929,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "0.7.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b648fa291891a4c80187a25532f6a7d96b82c70353e30b868b14632b8fe043d6" +checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -7265,7 +7300,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "hash-db", "log", @@ -7282,7 +7317,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -7294,7 +7329,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "serde", @@ -7306,7 +7341,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "integer-sqrt", "num-traits", @@ -7320,7 +7355,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "sp-api", @@ -7332,7 +7367,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "parity-scale-codec", @@ -7344,7 +7379,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "sp-api", @@ -7356,7 +7391,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "log", @@ -7374,7 +7409,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "futures 0.3.17", @@ -7393,7 +7428,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "parity-scale-codec", @@ -7410,7 +7445,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -7420,7 +7455,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "base58", "blake2-rfc", @@ -7464,7 +7499,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "kvdb", "parking_lot 0.11.2", @@ -7473,7 +7508,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "proc-macro2", "quote", @@ -7483,7 +7518,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "environmental", "parity-scale-codec", @@ -7494,7 +7529,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "finality-grandpa", "log", @@ -7511,7 +7546,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -7525,7 +7560,7 @@ dependencies = [ [[package]] name = "sp-io" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "hash-db", @@ -7550,7 +7585,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "lazy_static", "sp-core", @@ -7561,7 +7596,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "derive_more", @@ -7578,7 +7613,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "ruzstd", "zstd", @@ -7587,7 +7622,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "serde", @@ -7600,7 +7635,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -7611,7 +7646,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "sp-api", "sp-core", @@ -7621,7 +7656,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "backtrace", ] @@ -7629,7 +7664,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "rustc-hash", "serde", @@ -7639,7 +7674,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "either", "hash256-std-hasher", @@ -7660,7 +7695,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7677,7 +7712,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -7689,7 +7724,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "serde", "serde_json", @@ -7698,7 +7733,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "sp-api", @@ -7711,7 +7746,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -7721,7 +7756,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "hash-db", "log", @@ -7744,12 +7779,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" [[package]] name = "sp-storage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "impl-serde", "parity-scale-codec", @@ -7762,7 +7797,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "log", "sp-core", @@ -7775,7 +7810,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -7791,7 +7826,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "erased-serde", "log", @@ -7809,7 +7844,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "sp-api", "sp-runtime", @@ -7818,7 +7853,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-trait", "log", @@ -7833,7 +7868,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "hash-db", "memory-db", @@ -7847,7 +7882,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -7858,7 +7893,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "impl-serde", "parity-scale-codec", @@ -7873,7 +7908,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -7884,7 +7919,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7990,15 +8025,24 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "platforms", ] +[[package]] +name = "substrate-fixed" +version = "0.5.6" +source = "git+https://github.com/encointer/substrate-fixed#b33d186888c60f38adafcfc0ec3a21aab263aef1" +dependencies = [ + "parity-scale-codec", + "typenum", +] + [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.17", @@ -8020,7 +8064,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "async-std", "derive_more", @@ -8034,7 +8078,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?rev=852bab073407b65b5e3e461baaa0541c4e0bc3d6#852bab073407b65b5e3e461baaa0541c4e0bc3d6" +source = "git+https://github.com/DataHighway-DHX/substrate?rev=f5dc02a8a491c149fba05a2a5a51c80ce1b3cead#f5dc02a8a491c149fba05a2a5a51c80ce1b3cead" dependencies = [ "ansi_term 0.12.1", "build-helper", @@ -8054,9 +8098,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.75" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7" +checksum = "c6f107db402c2c2055242dbf4d2af0e69197202e9faacbef9571bbe47f5a1b84" dependencies = [ "proc-macro2", "quote", @@ -8121,18 +8165,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "283d5230e63df9608ac7d9691adc1dfb6e701225436eb64d0b9a7f0a5a04f6ec" +checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa3884228611f5cd3608e2d409bf7dce832e4eb3135e3f11addbd7e41bd68e71" +checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" dependencies = [ "proc-macro2", "quote", @@ -8252,9 +8296,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" +checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" dependencies = [ "bytes 1.1.0", "futures-core", @@ -8448,9 +8492,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" +checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "ucd-trie" diff --git a/Cargo.toml b/Cargo.toml index 660051e66..16f07e043 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ members = [ 'pallets/mining/setting/hardware', 'pallets/mining/rates/token', 'pallets/mining/rates/hardware', + 'pallets/mining/rewards-allowance', 'pallets/mining/sampling/token', 'pallets/mining/sampling/hardware', 'pallets/mining/eligibility/token', diff --git a/node/Cargo.toml b/node/Cargo.toml index 55b19f21f..70bdc224e 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -12,7 +12,7 @@ name = 'datahighway' targets = ['x86_64-unknown-linux-gnu'] [build-dependencies] -substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } +substrate-build-script-utils = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } vergen = '3.0.4' [dependencies] @@ -24,48 +24,48 @@ hex-literal = '0.3.1' datahighway-runtime = { version = '3.0.6', path = '../runtime' } # Substrate dependencies -frame-benchmarking = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } +frame-benchmarking = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +frame-benchmarking-cli = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } module-primitives = { version = '3.0.6', default-features = false, path = '../pallets/primitives' } -pallet-authority-discovery = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -pallet-democracy = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -pallet-im-online = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -pallet-transaction-payment-rpc = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-authority-discovery = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-basic-authorship = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-cli = { features = ['wasmtime'], git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-client-api = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-consensus-epochs = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-chain-spec = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-finality-grandpa = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-keystore = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-consensus = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-consensus-aura = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-consensus-slots = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-executor = { features = ['wasmtime'], git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-rpc = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-rpc-api = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-service = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false, features = ['wasmtime'] } -sc-transaction-pool = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-transaction-pool-api = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-api = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-authority-discovery = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-block-builder = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-blockchain = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-consensus = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-finality-grandpa = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-keystore = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-network = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-timestamp = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-authorship = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-transaction-pool = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sp-transaction-storage-proof = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-consensus-uncles = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -sc-telemetry = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } -substrate-frame-rpc-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6' } +pallet-authority-discovery = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +pallet-democracy = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +pallet-im-online = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +pallet-transaction-payment-rpc = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-authority-discovery = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-basic-authorship = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-cli = { features = ['wasmtime'], git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-client-api = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-consensus-epochs = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-chain-spec = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-finality-grandpa = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-keystore = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-consensus = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-consensus-aura = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-consensus-slots = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-executor = { features = ['wasmtime'], git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-rpc = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-rpc-api = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-service = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false, features = ['wasmtime'] } +sc-transaction-pool = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-transaction-pool-api = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-api = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-authority-discovery = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-block-builder = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-blockchain = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-consensus = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-consensus-aura = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-finality-grandpa = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-keystore = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-network = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-timestamp = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-authorship = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-transaction-pool = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sp-transaction-storage-proof = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-consensus-uncles = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +sc-telemetry = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } +substrate-frame-rpc-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead' } serde_json = '1.0.41' serde = { version = '1.0.126', features = ['derive'] } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 175922634..bf2f066c0 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -16,6 +16,7 @@ use datahighway_runtime::{ GrandpaConfig, ImOnlineConfig, IndicesConfig, + MiningRewardsAllowanceConfig, SessionConfig, SessionKeys, StakerStatus, @@ -816,6 +817,10 @@ fn session_keys( // Testnet +const TEN: u128 = 10_000_000_000_000_000_000_u128; // 10 + +const FIVE_THOUSAND: u128 = 5_000_000_000_000_000_000_000_u128; // 5000 + // in testnet total supply should be 100m, with 30m (30%) going to DHX DAO unlocked reserves, and the remaining // 70m split between the initial accounts other than the reserves const TESTNET_INITIAL_ENDOWMENT: u128 = 10_000_000_000_000_000_000_u128; // 10 DHX @@ -913,6 +918,43 @@ fn testnet_genesis( grandpa: GrandpaConfig { authorities: vec![], }, + mining_rewards_allowance: MiningRewardsAllowanceConfig { + rewards_allowance_dhx_daily: FIVE_THOUSAND, // 5000 DHX + rewards_allowance_dhx_for_date_remaining: Default::default(), + rewards_allowance_dhx_for_date_remaining_distributed: Default::default(), + rewards_multiplier_paused: false, + rewards_multiplier_reset: false, + rewards_multiplier_default_change: 10u32, + rewards_multiplier_next_change: 10u32, + rewards_multiplier_default_period_days: 90u32, + rewards_multiplier_next_period_days: 90u32, + rewards_multiplier_current_change: 10u32, + rewards_multiplier_current_period_days_total: 90u32, + rewards_multiplier_current_period_days_remaining: Default::default(), + rewards_multiplier_operation: 1u8, + registered_dhx_miners: vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + ], + rewards_aggregated_dhx_for_all_miners_for_date: Default::default(), + rewards_accumulated_dhx_for_miner_for_date: Default::default(), + min_bonded_dhx_daily: TEN, // 10 DHX + min_bonded_dhx_daily_default: TEN, // 10 DHX + min_mpower_daily: 5u128, + min_mpower_daily_default: 5u128, + cooling_off_period_days: 7u32, + cooling_off_period_days_remaining: vec![ + ( + get_account_id_from_seed::("Alice"), + ( + 0, + 7u32, + 0u32, + ), + ), + ], + }, // pallet_membership_Instance1 technical_membership: TechnicalMembershipConfig { members: vec![root_key.clone()], @@ -1005,6 +1047,43 @@ fn mainnet_genesis( grandpa: GrandpaConfig { authorities: vec![], }, + mining_rewards_allowance: MiningRewardsAllowanceConfig { + rewards_allowance_dhx_daily: FIVE_THOUSAND, // 5000 DHX + rewards_allowance_dhx_for_date_remaining: Default::default(), + rewards_allowance_dhx_for_date_remaining_distributed: Default::default(), + rewards_multiplier_paused: false, + rewards_multiplier_reset: false, + rewards_multiplier_default_change: 10u32, + rewards_multiplier_next_change: 10u32, + rewards_multiplier_default_period_days: 90u32, + rewards_multiplier_next_period_days: 90u32, + rewards_multiplier_current_change: 10u32, + rewards_multiplier_current_period_days_total: 90u32, + rewards_multiplier_current_period_days_remaining: Default::default(), + rewards_multiplier_operation: 1u8, + registered_dhx_miners: vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + ], + rewards_aggregated_dhx_for_all_miners_for_date: Default::default(), + rewards_accumulated_dhx_for_miner_for_date: Default::default(), + min_bonded_dhx_daily: TEN, // 10 DHX + min_bonded_dhx_daily_default: TEN, // 10 DHX + min_mpower_daily: 5u128, + min_mpower_daily_default: 5u128, + cooling_off_period_days: 7u32, + cooling_off_period_days_remaining: vec![ + ( + get_account_id_from_seed::("Alice"), + ( + 0, + 7u32, + 0u32, + ), + ), + ], + }, // pallet_membership_Instance1 technical_membership: TechnicalMembershipConfig { members: vec![root_key.clone()], diff --git a/pallets/exchange-rate/Cargo.toml b/pallets/exchange-rate/Cargo.toml index 70d2a713c..45013ec65 100755 --- a/pallets/exchange-rate/Cargo.toml +++ b/pallets/exchange-rate/Cargo.toml @@ -28,15 +28,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../roaming/roaming-operators' } diff --git a/pallets/lockdrop/rpc/Cargo.toml b/pallets/lockdrop/rpc/Cargo.toml index b2d6846d9..cb8feaaf0 100644 --- a/pallets/lockdrop/rpc/Cargo.toml +++ b/pallets/lockdrop/rpc/Cargo.toml @@ -8,15 +8,15 @@ edition = "2018" web3 = "0.13.0" codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } log = { version = '0.4.8' } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/lockdrop/runtime-api/Cargo.toml b/pallets/lockdrop/runtime-api/Cargo.toml index 1dc159471..d57a6ab14 100644 --- a/pallets/lockdrop/runtime-api/Cargo.toml +++ b/pallets/lockdrop/runtime-api/Cargo.toml @@ -5,7 +5,7 @@ authors = ['Ilya Beregovskiy'] edition = "2018" [dependencies] -sp-api = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false} +sp-api = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false} [features] default = ["std"] diff --git a/pallets/lockdrop/runtime/Cargo.toml b/pallets/lockdrop/runtime/Cargo.toml index 20c07a750..ddb15639a 100644 --- a/pallets/lockdrop/runtime/Cargo.toml +++ b/pallets/lockdrop/runtime/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Ilya Beregovskiy"] edition = "2018" [dependencies] -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } [features] default = ['std'] diff --git a/pallets/membership/supernodes/Cargo.toml b/pallets/membership/supernodes/Cargo.toml index 453cf8eb2..41c220c54 100644 --- a/pallets/membership/supernodes/Cargo.toml +++ b/pallets/membership/supernodes/Cargo.toml @@ -19,18 +19,18 @@ compatibility_version = "2.0.0" codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } # Substrate packages -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } # local packages account-set = { path = '../../../traits/account-set', default-features = false } [dev-dependencies] -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } [features] default = ['std'] diff --git a/pallets/mining/claims/hardware/Cargo.toml b/pallets/mining/claims/hardware/Cargo.toml index eb3765a73..9278bcfe6 100644 --- a/pallets/mining/claims/hardware/Cargo.toml +++ b/pallets/mining/claims/hardware/Cargo.toml @@ -32,15 +32,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } mining-setting-hardware = { default-features = false, package = 'mining-setting-hardware', path = '../../../mining/setting/hardware' } diff --git a/pallets/mining/claims/token/Cargo.toml b/pallets/mining/claims/token/Cargo.toml index 8cf8fbe76..647509d8d 100644 --- a/pallets/mining/claims/token/Cargo.toml +++ b/pallets/mining/claims/token/Cargo.toml @@ -32,15 +32,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } mining-setting-token = { default-features = false, package = 'mining-setting-token', path = '../../../mining/setting/token' } diff --git a/pallets/mining/eligibility/hardware/Cargo.toml b/pallets/mining/eligibility/hardware/Cargo.toml index f8dda4847..8310fd50c 100644 --- a/pallets/mining/eligibility/hardware/Cargo.toml +++ b/pallets/mining/eligibility/hardware/Cargo.toml @@ -31,15 +31,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } mining-setting-hardware = { default-features = false, package = 'mining-setting-hardware', path = '../../../mining/setting/hardware' } diff --git a/pallets/mining/eligibility/proxy/Cargo.toml b/pallets/mining/eligibility/proxy/Cargo.toml index 10fb2ad7d..81727a811 100644 --- a/pallets/mining/eligibility/proxy/Cargo.toml +++ b/pallets/mining/eligibility/proxy/Cargo.toml @@ -32,18 +32,18 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } module-primitives = { version = '3.0.6', default-features = false, path = '../../../primitives' } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-timestamp = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default_features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-treasury = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-timestamp = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default_features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-treasury = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } chrono = { version = '0.4.19', default_features = false } account-set = { path = '../../../../traits/account-set', default-features = false } diff --git a/pallets/mining/eligibility/token/Cargo.toml b/pallets/mining/eligibility/token/Cargo.toml index 977295786..62092bff3 100644 --- a/pallets/mining/eligibility/token/Cargo.toml +++ b/pallets/mining/eligibility/token/Cargo.toml @@ -31,15 +31,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } mining-setting-token = { default-features = false, package = 'mining-setting-token', path = '../../../mining/setting/token' } diff --git a/pallets/mining/execution/token/Cargo.toml b/pallets/mining/execution/token/Cargo.toml index 503cf53d1..a1735d1af 100644 --- a/pallets/mining/execution/token/Cargo.toml +++ b/pallets/mining/execution/token/Cargo.toml @@ -32,15 +32,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } mining-setting-token = { default-features = false, package = 'mining-setting-token', path = '../../../mining/setting/token' } diff --git a/pallets/mining/rates/hardware/Cargo.toml b/pallets/mining/rates/hardware/Cargo.toml index e3e37cd18..7e2b2c49f 100644 --- a/pallets/mining/rates/hardware/Cargo.toml +++ b/pallets/mining/rates/hardware/Cargo.toml @@ -28,15 +28,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } diff --git a/pallets/mining/rates/token/Cargo.toml b/pallets/mining/rates/token/Cargo.toml index f72b314c9..b98e833bf 100644 --- a/pallets/mining/rates/token/Cargo.toml +++ b/pallets/mining/rates/token/Cargo.toml @@ -28,15 +28,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } diff --git a/pallets/mining/rewards-allowance/Cargo.toml b/pallets/mining/rewards-allowance/Cargo.toml new file mode 100644 index 000000000..025ba24b7 --- /dev/null +++ b/pallets/mining/rewards-allowance/Cargo.toml @@ -0,0 +1,73 @@ +[package] +name = "mining-rewards-allowance" +version = "3.0.6" +authors = ["Luke Schoen"] +edition = "2018" + +[package.metadata.docs.rs] +targets = ['x86_64-unknown-linux-gnu'] + +[features] +default = ['std'] +std = [ + 'chrono/std', + 'log/std', + 'serde/std', + 'rand/std', + 'substrate-fixed/std', + 'codec/std', + 'frame-support/std', + 'frame-system/std', + 'pallet-aura/std', + 'pallet-balances/std', + 'pallet-bounties/std', + 'pallet-democracy/std', + 'pallet-elections-phragmen/std', + 'pallet-collective/std', + 'pallet-membership/std', + 'pallet-randomness-collective-flip/std', + 'pallet-scheduler/std', + 'pallet-timestamp/std', + 'pallet-tips/std', + 'pallet-transaction-payment/std', + 'pallet-treasury/std', + 'sp-consensus-aura/std', + 'sp-core/std', + 'sp-io/std', + 'sp-runtime/std', + 'sp-std/std', + 'module-primitives/std', +] + +[dependencies] +static_assertions = '1.1.0' +chrono = { version = '0.4.19', default_features = false } +log = { version = '0.4.14', default-features = false } +serde = { version = '1.0.126', features = ['derive'] } +rand = { version = '0.8.4', default-features = false } +substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", version = '0.5.6' } +codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-aura = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-bounties = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-collective = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-democracy = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-elections-phragmen = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-timestamp = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default_features = false } +pallet-tips = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-membership = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-scheduler = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-treasury = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-consensus-aura = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +module-primitives = { version = '3.0.6', default-features = false, path = '../../primitives' } + +[dev-dependencies] + diff --git a/pallets/mining/rewards-allowance/src/lib.rs b/pallets/mining/rewards-allowance/src/lib.rs new file mode 100644 index 000000000..931a3ee27 --- /dev/null +++ b/pallets/mining/rewards-allowance/src/lib.rs @@ -0,0 +1,2282 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +/// Edit this file to define custom logic or remove it if it is not needed. +/// Learn more about FRAME and the core library of Substrate FRAME pallets: +/// +pub use pallet::*; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod tests; + +// #[cfg(feature = "runtime-benchmarks")] +// mod benchmarking; + +#[frame_support::pallet] +pub mod pallet { + use log::{warn, info}; + use chrono::{ + NaiveDateTime, + }; + use rand::{seq::SliceRandom, Rng}; + use substrate_fixed::{ + types::{ + extra::U3, + U16F16, + U32F32, + U64F64, + }, + FixedU128, + }; + use codec::{ + Decode, + Encode, + // MaxEncodedLen, + }; + use frame_support::{dispatch::DispatchResult, pallet_prelude::*, + traits::{ + Currency, + ExistenceRequirement, + }, + }; + use frame_system::pallet_prelude::*; + use sp_std::{ + convert::{ + TryFrom, + TryInto, + }, + prelude::*, // Imports Vec + }; + use sp_core::{ + sr25519, + }; + use sp_runtime::traits::{ + IdentifyAccount, + One, + Verify, + }; + use pallet_balances::{BalanceLock}; + use module_primitives::{ + types::{ + AccountId, + Balance, + Signature, + }, + }; + + // this is only a default for test purposes and fallback. + // set this to 0u128 in production + pub const default_bonded_amount_u128: u128 = 25_133_000_000_000_000_000_000u128; + const TEN: u128 = 10_000_000_000_000_000_000_u128; // 10 + pub const FIVE_THOUSAND_DHX: u128 = 5_000_000_000_000_000_000_000_u128; // 5000 + + // type BalanceOf = ::Balance; + type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; + type BalanceFromBalancePallet = ::Balance; + type Date = i64; + + /// Configure the pallet by specifying the parameters and types on which it depends. + #[pallet::config] + pub trait Config: frame_system::Config + + pallet_democracy::Config + + pallet_balances::Config + + pallet_timestamp::Config + + pallet_treasury::Config { + /// Because this pallet emits events, it depends on the runtime's definition of an event. + type Event: From> + IsType<::Event>; + type Currency: Currency; + } + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + // #[pallet::generate_storage_info] + // pub struct Pallet(PhantomData); + + // The pallet's runtime storage items. + // https://substrate.dev/docs/en/knowledgebase/runtime/storage + // Learn more about declaring storage items: + // https://substrate.dev/docs/en/knowledgebase/runtime/storage#declaring-storage-items + #[pallet::storage] + #[pallet::getter(fn bonded_dhx_of_account_for_date)] + pub(super) type BondedDHXForAccountForDate = StorageMap<_, Blake2_128Concat, + ( + Date, + T::AccountId, + ), + BalanceOf, + >; + + #[pallet::storage] + #[pallet::getter(fn mpower_of_account_for_date)] + pub(super) type MPowerForAccountForDate = StorageMap<_, Blake2_128Concat, + ( + Date, + T::AccountId, + ), + u128, + >; + + #[pallet::storage] + #[pallet::getter(fn rewards_allowance_dhx_for_date_remaining)] + pub(super) type RewardsAllowanceDHXForDateRemaining = StorageMap<_, Blake2_128Concat, + Date, + BalanceOf + >; + + #[pallet::storage] + #[pallet::getter(fn rewards_allowance_dhx_for_date_remaining_distributed)] + pub(super) type RewardsAllowanceDHXForDateRemainingDistributed = StorageMap<_, Blake2_128Concat, + Date, + bool + >; + + #[pallet::storage] + #[pallet::getter(fn rewards_allowance_dhx_daily)] + pub(super) type RewardsAllowanceDHXDaily = StorageValue<_, BalanceOf>; + + // store for ease of changing by governance + // global pause + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_paused)] + pub(super) type RewardsMultiplierPaused = StorageValue<_, bool>; + + // global reset + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_reset)] + pub(super) type RewardsMultiplierReset = StorageValue<_, bool>; + + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_default_change)] + pub(super) type RewardsMultiplierDefaultChange = StorageValue<_, u32>; + + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_current_change)] + pub(super) type RewardsMultiplierCurrentChange = StorageValue<_, u32>; + + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_next_change)] + pub(super) type RewardsMultiplierNextChange = StorageValue<_, u32>; + + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_default_period_days)] + pub(super) type RewardsMultiplierDefaultPeriodDays = StorageValue<_, u32>; + + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_next_period_days)] + pub(super) type RewardsMultiplierNextPeriodDays = StorageValue<_, u32>; + + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_current_period_days_total)] + pub(super) type RewardsMultiplierCurrentPeriodDaysTotal = StorageValue<_, u32>; + + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_current_period_days_remaining)] + pub(super) type RewardsMultiplierCurrentPeriodDaysRemaining = StorageValue<_, + ( + Date, // date when current period started + Date, // previous date that was entered during countdown + u32, // total days for this period + u32, // days remaining + ), + >; + + // set to 1 for addition, to change the + // min. bonded dhx value after every rewards_multiplier_next_period_days. + #[pallet::storage] + #[pallet::getter(fn rewards_multiplier_operation)] + pub(super) type RewardsMultiplierOperation = StorageValue<_, u8>; + + #[pallet::storage] + #[pallet::getter(fn rewards_aggregated_dhx_for_all_miners_for_date)] + pub(super) type RewardsAggregatedDHXForAllMinersForDate = StorageMap<_, Blake2_128Concat, + Date, + BalanceOf, + >; + + #[pallet::storage] + #[pallet::getter(fn rewards_accumulated_dhx_for_miner_for_date)] + pub(super) type RewardsAccumulatedDHXForMinerForDate = StorageMap<_, Blake2_128Concat, + ( + Date, + T::AccountId, + ), + BalanceOf, + >; + + /// Those who registered that they want to participate in DHX Mining + /// + /// TWOX-NOTE: Safe, as increasing integer keys are safe. + #[pallet::storage] + #[pallet::getter(fn registered_dhx_miners)] + pub(super) type RegisteredDHXMiners = StorageValue<_, Vec>; + + #[pallet::storage] + #[pallet::getter(fn min_bonded_dhx_daily)] + pub(super) type MinBondedDHXDaily = StorageValue<_, BalanceOf>; + + #[pallet::storage] + #[pallet::getter(fn min_bonded_dhx_daily_default)] + pub(super) type MinBondedDHXDailyDefault = StorageValue<_, BalanceOf>; + + #[pallet::storage] + #[pallet::getter(fn min_mpower_daily)] + pub(super) type MinMPowerDaily = StorageValue<_, u128>; + + #[pallet::storage] + #[pallet::getter(fn min_mpower_daily_default)] + pub(super) type MinMPowerDailyDefault = StorageValue<_, u128>; + + #[pallet::storage] + #[pallet::getter(fn cooling_off_period_days)] + pub(super) type CoolingOffPeriodDays = StorageValue<_, u32>; + + #[pallet::storage] + #[pallet::getter(fn cooling_off_period_days_remaining)] + pub(super) type CoolingOffPeriodDaysRemaining = StorageMap<_, Blake2_128Concat, + T::AccountId, + ( + // date when cooling off period started for a given miner, or the date when we last reduced their cooling off period. + // we do not reduce their cooling off period days remaining if we've already set this to a date that is the + // current date for a miner (i.e. only reduce the days remaining once per day per miner) + Date, + u32, // days remaining + // 0: + // unbonded (i.e. never bonded, insufficient bonded, or finished cool-down period and no longer bonding) and + // insufficient mPower (i.e. less than min. mPower) + // 1: bonded/bonding/mPower (i.e. waiting in the cool-down period before start getting rewards or eligible for rewards) + // 2: unbonding (i.e. if they are bonding less than the threshold whilst getting rewards, + // or no longer have the min. mPower, then + // this unbonding starts and they must wait until it finishes, which is when this value + // would be set to 0u32, before bonding and then waiting for the cool-down period all over again) + u32, + ), + >; + + // The genesis config type. + #[pallet::genesis_config] + pub struct GenesisConfig { + pub rewards_allowance_dhx_for_date_remaining: Vec<(Date, BalanceOf)>, + pub rewards_allowance_dhx_for_date_remaining_distributed: Vec<(Date, bool)>, + pub rewards_allowance_dhx_daily: BalanceOf, + pub rewards_multiplier_paused: bool, + pub rewards_multiplier_reset: bool, + pub rewards_multiplier_default_change: u32, + pub rewards_multiplier_current_change: u32, + pub rewards_multiplier_next_change: u32, + pub rewards_multiplier_default_period_days: u32, + pub rewards_multiplier_next_period_days: u32, + pub rewards_multiplier_current_period_days_total: u32, + pub rewards_multiplier_current_period_days_remaining: (Date, Date, u32, u32), + pub rewards_multiplier_operation: u8, + pub rewards_aggregated_dhx_for_all_miners_for_date: Vec<(Date, BalanceOf)>, + pub rewards_accumulated_dhx_for_miner_for_date: Vec<((Date, T::AccountId), BalanceOf)>, + pub registered_dhx_miners: Vec, + pub min_bonded_dhx_daily: BalanceOf, + pub min_bonded_dhx_daily_default: BalanceOf, + pub min_mpower_daily: u128, + pub min_mpower_daily_default: u128, + pub cooling_off_period_days: u32, + pub cooling_off_period_days_remaining: Vec<(T::AccountId, (Date, u32, u32))>, + } + + // The default value for the genesis config type. + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self { + rewards_allowance_dhx_for_date_remaining: Default::default(), + rewards_allowance_dhx_for_date_remaining_distributed: Default::default(), + // 5000 UNIT, where UNIT token has 18 decimal places + rewards_allowance_dhx_daily: Default::default(), + rewards_multiplier_paused: false, + rewards_multiplier_reset: false, + rewards_multiplier_default_change: 10u32, + rewards_multiplier_current_change: 10u32, + rewards_multiplier_next_change: 10u32, + // FIXME - setup for different amount of days each month and leap years + rewards_multiplier_default_period_days: 90u32, + // FIXME - setup for different amount of days each month and leap years + rewards_multiplier_next_period_days: 90u32, + // FIXME - setup for different amount of days each month and leap years + rewards_multiplier_current_period_days_total: 90u32, + rewards_multiplier_current_period_days_remaining: Default::default(), + rewards_multiplier_operation: 1u8, + rewards_aggregated_dhx_for_all_miners_for_date: Default::default(), + rewards_accumulated_dhx_for_miner_for_date: Default::default(), + registered_dhx_miners: vec![ + Default::default(), + Default::default(), + ], + min_bonded_dhx_daily: Default::default(), + min_bonded_dhx_daily_default: Default::default(), + min_mpower_daily: 5u128, + min_mpower_daily_default: 5u128, + cooling_off_period_days: Default::default(), + // Note: this doesn't seem to work, even if it's just `vec![Default::default()]` it doesn't use + // the defaults in chain_spec.rs, so we set defaults later with `let mut cooling_off_period_days_remaining` + cooling_off_period_days_remaining: vec![ + ( + Default::default(), + ( + Default::default(), + Default::default(), + Default::default(), + ), + ), + ] + } + } + } + + // The build of genesis for the pallet. + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + for (a, b) in &self.rewards_allowance_dhx_for_date_remaining { + >::insert(a, b); + } + for (a, b) in &self.rewards_allowance_dhx_for_date_remaining_distributed { + >::insert(a, b); + } + >::put(&self.rewards_allowance_dhx_daily); + >::put(&self.rewards_multiplier_paused); + >::put(&self.rewards_multiplier_reset); + >::put(&self.rewards_multiplier_default_change); + >::put(&self.rewards_multiplier_current_change); + >::put(&self.rewards_multiplier_next_change); + >::put(&self.rewards_multiplier_default_period_days); + >::put(&self.rewards_multiplier_next_period_days); + >::put(&self.rewards_multiplier_current_period_days_total); + >::put(&self.rewards_multiplier_current_period_days_remaining); + for (a) in &self.registered_dhx_miners { + >::append(a); + } + >::put(&self.rewards_multiplier_operation); + for (a, b) in &self.rewards_aggregated_dhx_for_all_miners_for_date { + >::insert(a, b); + } + for ((a, b), c) in &self.rewards_accumulated_dhx_for_miner_for_date { + >::insert((a, b), c); + } + >::put(&self.min_bonded_dhx_daily); + >::put(&self.min_bonded_dhx_daily_default); + >::put(&self.min_mpower_daily); + >::put(&self.min_mpower_daily_default); + >::put(&self.cooling_off_period_days); + for (a, (b, c, d)) in &self.cooling_off_period_days_remaining { + >::insert(a, (b, c, d)); + } + } + } + + // Pallets use events to inform users when important changes are made. + // https://substrate.dev/docs/en/knowledgebase/runtime/events + #[pallet::event] + #[pallet::metadata( + T::AccountId = "AccountId", + BondedData = "BondedData", + BalanceOf = "BalanceOf", + T::AccountId = "Date" + )] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// Storage of a sending account as a registered DHX miner + /// \[sender] + SetRegisteredDHXMiner(T::AccountId), + + /// Storage of the minimum DHX that must be bonded by each registered DHX miner each day + /// to be eligible for rewards + /// \[amount_dhx, sender\] + SetMinBondedDHXDailyStored(BalanceOf, T::AccountId), + + /// Storage of the minimum mPower that must be held by each registered DHX miner each day + /// to be eligible for rewards + /// \[amount_mpower, sender\] + SetMinMPowerDailyStored(u128, T::AccountId), + + /// Storage of the default cooling off period in days + /// \[cooling_off_period_days\] + SetCoolingOffPeriodDaysStored(u32), + + /// Storage of the bonded DHX of an account on a specific date. + /// \[date, amount_dhx_bonded, account_dhx_bonded\] + SetBondedDHXOfAccountForDateStored(Date, BalanceOf, T::AccountId), + + /// Storage of the mPower of an account on a specific date. + /// \[date, amount_mpower, account\] + SetMPowerOfAccountForDateStored(Date, u128, T::AccountId), + + /// Storage of the default daily reward allowance in DHX by an origin account. + /// \[amount_dhx, sender\] + SetRewardsAllowanceDHXDailyStored(BalanceOf, T::AccountId), + + /// Change the stored reward allowance in DHX for a specific date by an origin account, and + /// where change is 0 for an decrease or any other value like 1 for an increase to the remaining + /// rewards allowance. + /// \[date, change_amount_dhx, sender, change\] + ChangedRewardsAllowanceDHXForDateRemainingStored(Date, BalanceOf, T::AccountId, u8), + + /// Transferred a proportion of the daily DHX rewards allowance to a DHX Miner on a given date + /// \[date, miner_reward, remaining_rewards_allowance_today, miner_account_id\] + TransferredRewardsAllowanceDHXToMinerForDate(Date, BalanceOf, BalanceOf, T::AccountId), + + /// Exhausted distributing all the daily DHX rewards allowance to DHX Miners on a given date. + /// Note: There may be some leftover for the day so we record it here + /// \[date, remaining_rewards_allowance_today\] + DistributedRewardsAllowanceDHXForDateRemaining(Date, BalanceOf), + + /// Changed the min. bonded DHX daily using a value, using addition operation + /// \[start_date_period, new_min_dhx_bonded, modified_old_min_dhx_bonded_using_ratio, operation_used, next_period_days\] + ChangedMinBondedDHXDailyUsingNewRewardsMultiplier(Date, BalanceOf, u32, u8, u32), + + /// Storage of a new reward operation (1u8: addition) by an origin account. + /// \[operation, sender\] + SetRewardsMultiplierOperationStored(u8, T::AccountId), + + /// Storage of a new reward multiplier default period in days (i.e. 90 for 3 months) by an origin account. + /// \[days, sender\] + SetRewardsMultiplierDefaultPeriodDaysStored(u32, T::AccountId), + + /// Storage of a new reward multiplier next period in days (i.e. 90 for 3 months) by an origin account. + /// \[days, sender\] + SetRewardsMultiplierNextPeriodDaysStored(u32, T::AccountId), + + /// Storage of new rewards multiplier paused status + /// \[new_status] + ChangeRewardsMultiplierPausedStatusStored(bool), + + /// Storage of new rewards multiplier reset status + /// \[new_status] + ChangeRewardsMultiplierResetStatusStored(bool), + } + + // Errors inform users that something went wrong should be descriptive and have helpful documentation + #[pallet::error] + pub enum Error { + NoneValue, + /// Preimage already noted + DuplicatePreimage, + /// Proposal does not exist + ProposalMissing, + StorageOverflow, + StorageUnderflow, + } + + // Pallet implements [`Hooks`] trait to define some logic to execute in some context. + #[pallet::hooks] + impl Hooks> for Pallet { + // `on_initialize` is executed at the beginning of the block before any extrinsic are + // dispatched. + // + // This function must return the weight consumed by `on_initialize` and `on_finalize`. + // TODO - update with the weight consumed + fn on_initialize(_n: T::BlockNumber) -> Weight { + let block_one = 1u32; + let block_one_as_block; + if let Some(_block_one) = TryInto::::try_into(block_one).ok() { + block_one_as_block = _block_one; + } else { + log::error!("Unable to convert u32 to BlockNumber"); + return 0; + } + + // skip block #1 since timestamp is 0 in blocks before block #2 + if _n == block_one_as_block.clone() { + return 0; + } + + // Anything that needs to be done at the start of the block. + let timestamp: ::Moment = >::get(); + log::info!("_n: {:?}", _n.clone()); + log::info!("timestamp: {:?}", timestamp.clone()); + let requested_date_as_u64; + let _requested_date_as_u64 = Self::convert_moment_to_u64_in_milliseconds(timestamp.clone()); + match _requested_date_as_u64 { + Err(_e) => { + log::error!("Unable to convert Moment to u64 in millis for timestamp"); + return 0; + }, + Ok(ref x) => { + requested_date_as_u64 = x; + } + } + log::info!("requested_date_as_u64: {:?}", requested_date_as_u64.clone()); + // println!("requested_date_as_u64: {:?}", requested_date_as_u64.clone()); + + // do not run when block number is 1, which is when timestamp is 0 because this + // timestamp corresponds to 1970-01-01 + if requested_date_as_u64.clone() == 0u64 { + return 0; + } + let start_of_requested_date_millis; + let _start_of_requested_date_millis = Self::convert_u64_in_milliseconds_to_start_of_date(requested_date_as_u64.clone()); + match _start_of_requested_date_millis { + Err(_e) => { + log::error!("Unable to convert u64 in milliseconds to start_of_requested_date_millis"); + return 0; + }, + Ok(ref x) => { + start_of_requested_date_millis = x; + } + } + log::info!("start_of_requested_date_millis: {:?}", start_of_requested_date_millis.clone()); + // println!("start_of_requested_date_millis: {:?}", start_of_requested_date_millis.clone()); + + // https://substrate.dev/rustdocs/latest/frame_support/storage/trait.StorageMap.html + let contains_key = >::contains_key(&start_of_requested_date_millis); + log::info!("contains_key for date: {:?}, {:?}", start_of_requested_date_millis.clone(), contains_key.clone()); + + let mut rewards_allowance_dhx_daily: BalanceOf = 5000u32.into(); // initialize; + + // add the start_of_requested_date to storage if it doesn't already exist + if contains_key == false { + if let Some(_rewards_allowance_dhx_daily) = >::get() { + rewards_allowance_dhx_daily = _rewards_allowance_dhx_daily; + } else { + log::error!("Unable to get rewards_allowance_dhx_daily"); + return 0; + } + + // Update storage. Use RewardsAllowanceDHXDaily as fallback incase not previously set prior to block + >::insert(start_of_requested_date_millis.clone(), &rewards_allowance_dhx_daily); + >::insert(start_of_requested_date_millis.clone(), false); + log::info!("on_initialize"); + log::info!("rewards_allowance: {:?}", &rewards_allowance_dhx_daily); + } + + let mut rm_paused = false; // have to initialise + if let Some(_rm_paused) = >::get() { + rm_paused = _rm_paused; + } else { + log::info!("Unable to get rm_paused"); + } + + let mut rm_reset = false; + if let Some(_rm_reset) = >::get() { + rm_reset = _rm_reset; + } else { + log::info!("Unable to get rm_reset"); + } + + let mut rm_default_change = 10u32; + if let Some(_rm_default_change) = >::get() { + rm_default_change = _rm_default_change; + } else { + log::info!("Unable to get rm_default_change"); + } + + let mut rm_current_change = 10u32; + if let Some(_rm_current_change) = >::get() { + rm_current_change = _rm_current_change; + } else { + log::info!("Unable to get rm_current_change"); + } + + let mut rm_next_change = 10u32; + if let Some(_rm_next_change) = >::get() { + rm_next_change = _rm_next_change; + } else { + log::info!("Unable to get rm_next_change"); + } + + let mut rm_default_period_days = 90u32; + if let Some(_rm_default_period_days) = >::get() { + rm_default_period_days = _rm_default_period_days; + } else { + log::info!("Unable to get rm_default_period_days"); + } + + let mut rm_next_period_days = 90u32; + if let Some(_rm_next_period_days) = >::get() { + rm_next_period_days = _rm_next_period_days; + } else { + log::info!("Unable to get rm_next_period_days"); + } + + let mut min_bonded_dhx_daily_default: BalanceOf = 10u32.into(); + let mut min_bonded_dhx_daily_default_u128; + let _min_bonded_dhx_daily_default = Self::get_min_bonded_dhx_daily_default(); + match _min_bonded_dhx_daily_default { + Err(_e) => { + log::error!("Unable to retrieve any min. bonded DHX daily default as BalanceOf and u128"); + return 0; + }, + Ok(ref x) => { + min_bonded_dhx_daily_default = x.0; + min_bonded_dhx_daily_default_u128 = x.1; + } + } + // println!("min_bonded_dhx_daily_default_u128: {:?}", min_bonded_dhx_daily_default_u128.clone()); + + let mut min_mpower_daily_default: u128 = 5u128; + if let Some(_min_mpower_daily_default) = >::get() { + min_mpower_daily_default = _min_mpower_daily_default; + } else { + log::info!("Unable to get min_mpower_daily_default"); + } + // println!("min_mpower_daily_default {:?}", min_mpower_daily_default); + + let mut rm_current_period_days_remaining = ( + 0.into(), + 0.into(), + 90u32, + 90u32, + ); + if let Some(_rm_current_period_days_remaining) = >::get() { + rm_current_period_days_remaining = _rm_current_period_days_remaining; + } else { + log::info!("Unable to get rm_current_period_days_remaining"); + } + + log::info!("rm_paused: {:?}", &rm_paused); + log::info!("rm_reset: {:?}", &rm_reset); + log::info!("rm_default_change: {:?}", &rm_default_change); + log::info!("rm_current_change: {:?}", &rm_current_change); + log::info!("rm_next_change: {:?}", &rm_next_change); + log::info!("rm_default_period_days: {:?}", &rm_default_period_days); + log::info!("rm_next_period_days: {:?}", &rm_next_period_days); + log::info!("rm_current_period_days_remaining: {:?}", &rm_current_period_days_remaining); + + // println!("rm_paused: {:?}", &rm_paused); + // println!("rm_reset: {:?}", &rm_reset); + // println!("rm_default_change: {:?}", &rm_default_change); + // println!("rm_current_change: {:?}", &rm_current_change); + // println!("rm_next_change: {:?}", &rm_next_change); + // println!("rm_default_period_days: {:?}", &rm_default_period_days); + // println!("rm_next_period_days: {:?}", &rm_next_period_days); + // println!("rm_current_period_days_remaining: {:?}", &rm_current_period_days_remaining); + + // pause the process of automatically changing to the next period change and next period day + // until unpaused again by governance + if rm_paused != true { + if rm_reset == true { + >::put(rm_default_change.clone()); + >::put(rm_default_change.clone()); + >::put(rm_default_period_days.clone()); + >::put(false); + >::put(min_bonded_dhx_daily_default.clone()); + >::put(min_mpower_daily_default.clone()); + } + + let block_two = 2u32; + let block_two_as_block; + if let Some(_block_two) = TryInto::::try_into(block_two).ok() { + block_two_as_block = _block_two; + } else { + log::error!("Unable to convert u32 to BlockNumber"); + return 0; + } + + // start on block #2 since timestamp is 0 in blocks before that + if _n == block_two_as_block.clone() { + // initialise values in storage that cannot be set in genesis and apply to local variables + // incase its just after genesis when values are not yet set in storage + >::put( + ( + start_of_requested_date_millis.clone(), // start date of period + start_of_requested_date_millis.clone(), // previous date (is today) of period + rm_default_period_days.clone(), + rm_default_period_days.clone(), + ) + ); + if let Some(_rm_current_period_days_remaining) = >::get() { + rm_current_period_days_remaining = _rm_current_period_days_remaining; + } else { + log::info!("Unable to get rm_current_period_days_remaining"); + } + } else { + // any block after block #2 + + // if the value we stored in RewardsMultiplierCurrentPeriodDaysRemaining to represent the previous day's + // date is not the current date (since we don't want it to happen again until the next day) + + if rm_current_period_days_remaining.1 != start_of_requested_date_millis.clone() { + // if there are still days remaining in the countdown + if rm_current_period_days_remaining.3 > 0u32 { + // println!("[reducing_multiplier_days] block: {:#?}, date_start: {:#?} remain_days: {:#?}", _n, rm_current_period_days_remaining.0, rm_current_period_days_remaining.3); + let old_rm_current_period_days_remaining = rm_current_period_days_remaining.3.clone(); + + // Subtract, handling overflow + let new_rm_current_period_days_remaining; + let _new_rm_current_period_days_remaining = + old_rm_current_period_days_remaining.checked_sub(One::one()); + match _new_rm_current_period_days_remaining { + None => { + log::error!("Unable to subtract one from rm_current_period_days_remaining due to StorageOverflow"); + return 0; + }, + Some(x) => { + new_rm_current_period_days_remaining = x; + } + } + + // Write the new value to storage + >::put( + ( + rm_current_period_days_remaining.0, // retain original value + start_of_requested_date_millis.clone(), // insert today's date for the previous date + rm_current_period_days_remaining.2, // retain original value + new_rm_current_period_days_remaining.clone(), + ), + ); + log::info!("Reduced RewardsMultiplierCurrentPeriodDaysRemaining {:?} {:?}", start_of_requested_date_millis.clone(), new_rm_current_period_days_remaining.clone()); + } else { + // if no more days remaining + // println!("[reducing_multiplier_days] no more remaining days"); + + // run an operation with the the next change and the current min bonded dhx daily to determine the + // new min. bonded dhx daily for the next period + + let mut min_bonded_dhx_daily: BalanceOf = 10u32.into(); + let mut min_bonded_dhx_daily_u128; + let _min_bonded_dhx_daily = Self::get_min_bonded_dhx_daily(); + match _min_bonded_dhx_daily { + Err(_e) => { + log::error!("Unable to retrieve any min. bonded DHX daily as BalanceOf and u128"); + return 0; + }, + Ok(ref x) => { + min_bonded_dhx_daily = x.0; + min_bonded_dhx_daily_u128 = x.1; + } + } + // println!("min_bonded_dhx_daily_u128: {:?}", min_bonded_dhx_daily_u128.clone()); + + let rewards_multipler_operation; + if let Some(_rewards_multipler_operation) = >::get() { + rewards_multipler_operation = _rewards_multipler_operation; + } else { + log::error!("Unable to retrieve rewards_multipler_operation"); + return 0; + } + + let mut new_min_bonded_dhx_daily_u128 = 0u128; // initialize + + // println!("rewards_multipler_operation: {:?}", rewards_multipler_operation.clone()); + + // prepare for 'add' operation + + let mut rm_next_change_u128_short = 0u128; // initialize + if let Some(_rm_next_change_u128_short) = TryInto::::try_into(rm_next_change.clone()).ok() { + rm_next_change_u128_short = _rm_next_change_u128_short; + } else { + log::error!("Unable to convert u32 to u128"); + return 0; + } + + let ONE = 1000000000000000000u128; + let mut rm_next_change_as_fixedu128 = FixedU128::from_num(0); + let _rm_next_change_as_fixedu128 = + U64F64::from_num(rm_next_change_u128_short.clone()).checked_mul(U64F64::from_num(ONE)); + match _rm_next_change_as_fixedu128 { + None => { + log::error!("Unable to mult rm_next_change by ONE due to StorageOverflow"); + return 0; + }, + Some(x) => { + rm_next_change_as_fixedu128 = x; + } + } + // println!("rm_next_change_as_fixedu128: {:?}", rm_next_change_as_fixedu128.clone()); + // round down the fixed point number to the nearest integer of type u128 + let rm_next_change_u128: u128 = rm_next_change_as_fixedu128.floor().to_num::(); + // println!("rm_next_change_u128: {:?}", rm_next_change_as_fixedu128.clone()); + + // case of addition + if rewards_multipler_operation == 1u8 { + // To 'add' rm_next_change u32 to min_bonded_dhx_daily_u128 we first need to convert + // the say 10 u32 value to u128, then multiply it by 1000000000000000000 so + // has same 18 decimal places representation, and only then 'add' it to + // min_bonded_dhx_daily_u128 + + let _new_min_bonded_dhx_daily_u128 = + (rm_next_change_u128).checked_add(min_bonded_dhx_daily_u128.clone()); + match _new_min_bonded_dhx_daily_u128 { + None => { + log::error!("Unable to add min_bonded_dhx_daily_u128 with rm_next_change_u128 due to StorageOverflow"); + return 0; + }, + Some(x) => { + new_min_bonded_dhx_daily_u128 = x; + } + } + } else { + log::error!("Unsupported rewards_multipler_operation value"); + return 0; + } + + // println!("new_min_bonded_dhx_daily_u128 {:?}", new_min_bonded_dhx_daily_u128); + + let new_min_bonded_dhx_daily; + let _new_min_bonded_dhx_daily = Self::convert_u128_to_balance(new_min_bonded_dhx_daily_u128.clone()); + match _new_min_bonded_dhx_daily { + Err(_e) => { + log::error!("Unable to convert u128 to balance for new_min_bonded_dhx_daily"); + return 0; + }, + Ok(ref x) => { + new_min_bonded_dhx_daily = x; + } + } + log::info!("new_min_bonded_dhx_daily: {:?}", new_min_bonded_dhx_daily.clone()); + // println!("new_min_bonded_dhx_daily: {:?}", new_min_bonded_dhx_daily.clone()); + + >::put(new_min_bonded_dhx_daily.clone()); + log::info!("New MinBondedDHXDaily {:?} {:?}", start_of_requested_date_millis.clone(), new_min_bonded_dhx_daily_u128.clone()); + // println!("New MinBondedDHXDaily {:?} {:?}", start_of_requested_date_millis.clone(), new_min_bonded_dhx_daily_u128.clone()); + + // FIXME - can we automatically change the next period days value to (~90 days depending on days in included months 28, 29, 30, or 31) + // depending on the date? and do this from genesis too? + + Self::deposit_event(Event::ChangedMinBondedDHXDailyUsingNewRewardsMultiplier( + start_of_requested_date_millis.clone(), + new_min_bonded_dhx_daily.clone(), + rm_next_change.clone(), + rewards_multipler_operation.clone(), + rm_next_period_days.clone(), + )); + + // Set the current change (for this next period) to the value that was set as the + // next change (perhaps by governance) + >::put(rm_next_change.clone()); + + >::put(rm_next_change.clone()); + + // Set the current period in days (for this next period) to the value that was set as the + // next period days (perhaps by governance) + >::put(rm_next_period_days.clone()); + + >::put(rm_next_period_days.clone()); + + // Restart the days remaining for the next period + >::put( + ( + start_of_requested_date_millis.clone(), // insert today's date for the start date of the new period + start_of_requested_date_millis.clone(), // insert today's date for the previous date + rm_next_period_days.clone(), // total days + rm_next_period_days.clone(), // remaining days + ), + ); + log::info!("Restarting RewardsMultiplierCurrentPeriodDaysRemaining {:?} {:?}", start_of_requested_date_millis.clone(), rm_next_period_days.clone()); + + let new_min_bonded_dhx_daily; + let _new_min_bonded_dhx_daily = Self::convert_u128_to_balance(new_min_bonded_dhx_daily_u128.clone()); + match _new_min_bonded_dhx_daily { + Err(_e) => { + log::error!("Unable to convert u128 to balance for new_min_bonded_dhx_daily"); + return 0; + }, + Ok(ref x) => { + new_min_bonded_dhx_daily = x; + } + } + log::info!("new_min_bonded_dhx_daily: {:?}", new_min_bonded_dhx_daily.clone()); + // println!("new_min_bonded_dhx_daily: {:?}", new_min_bonded_dhx_daily.clone()); + } + } + } + } + + // we only check accounts that have registered that they want to participate in DHX Mining + let reg_dhx_miners; + if let Some(_reg_dhx_miners) = >::get() { + reg_dhx_miners = _reg_dhx_miners; + } else { + log::error!("Unable to retrieve any registered DHX Miners"); + return 0; + } + if reg_dhx_miners.len() == 0 { + log::error!("Registered DHX Miners has no elements"); + return 0; + }; + let mut miner_count = 0; + + for (index, miner) in reg_dhx_miners.iter().enumerate() { + miner_count += 1; + log::info!("miner_count {:#?}", miner_count); + log::info!("miner {:#?}", miner); + // let locks_until_block_for_account = >::locks(miner.clone()); + // // NOTE - I fixed the following error by using `.into_inner()` after asking the community here and getting a + // // response in Substrate Builders weekly meeting https://matrix.to/#/!HzySYSaIhtyWrwiwEV:matrix.org/$163243681163543vyfkW:matrix.org?via=matrix.parity.io&via=matrix.org&via=corepaper.org + // // + // // `WeakBoundedVec::Balance>, + // // ::MaxLocks>` cannot be formatted using + // // `{:?}` because it doesn't implement `core::fmt::Debug` + // // + // // https://substrate.dev/rustdocs/latest/frame_support/storage/weak_bounded_vec/struct.WeakBoundedVec.html + // log::info!("miner locks {:#?}", locks_until_block_for_account.into_inner().clone()); + // let locked: BalanceLock<::Balance> = + // locks_until_block_for_account.into_inner().clone()[0]; + + // assume DHX Miner only has one lock for simplicity. retrieve the amount locked + // TODO - miner may have multiple locks, so we actually want to go through the vector + // and find the lock(s) we're interested in, and aggregate the total, and later check + // that it's greater than min_bonded_dhx_daily_u128. + // default for demonstration incase miner does not have any locks when checking below. + // + // Test with 2x registered miners each with values like `25133000000000000000000u128`, which is over + // half of 5000 DHX daily allowance (of 2500 DHX), but in that case we split the rewards + // (i.e. 25,133 DHX locked at 10:1 gives 2513 DHX reward) + + // initialise so they have no locks and are ineligible for rewards + let mut locks_first_amount_as_u128 = 0u128.clone(); + let locked_vec = >::locks(miner.clone()).into_inner(); + if locked_vec.len() != 0 { + // println!("locked_vec: {:?}", locked_vec); + let locks_first_amount: ::Balance = + >::locks(miner.clone()).into_inner().clone()[0].amount; + + let _locks_first_amount_as_u128 = Self::convert_balance_to_u128_from_pallet_balance(locks_first_amount.clone()); + match _locks_first_amount_as_u128.clone() { + Err(_e) => { + log::error!("Unable to convert balance to u128"); + return 0; + }, + Ok(x) => { + locks_first_amount_as_u128 = x; + } + } + } + log::info!("locks_first_amount_as_u128: {:?}", locks_first_amount_as_u128.clone()); + // println!("locks_first_amount_as_u128 {:#?}", locks_first_amount_as_u128); + + // Example output below of vote with 9.9999 tokens on a referendum associated with a proposal + // that was seconded + // + // BalanceLock { + // id: [ + // 100, + // 101, + // 109, + // 111, + // 99, + // 114, + // 97, + // 99, + // ], + // amount: 9999900000000000000, + // reasons: Reasons::Misc, + // }, + + let bonded_dhx_current_u128; + let _bonded_dhx_current_u128 = Self::set_bonded_dhx_of_account_for_date( + miner.clone(), + locks_first_amount_as_u128.clone() + ); + match _bonded_dhx_current_u128 { + Err(_e) => { + log::error!("Unable to set_bonded_dhx_of_account_for_date"); + return 0; + }, + Ok(ref x) => { + bonded_dhx_current_u128 = x; + } + } + + let mut min_bonded_dhx_daily: BalanceOf = 10u32.into(); + let mut min_bonded_dhx_daily_u128; + let _min_bonded_dhx_daily = Self::get_min_bonded_dhx_daily(); + match _min_bonded_dhx_daily { + Err(_e) => { + log::error!("Unable to retrieve any min. bonded DHX daily as BalanceOf and u128"); + return 0; + }, + Ok(ref x) => { + min_bonded_dhx_daily = x.0; + min_bonded_dhx_daily_u128 = x.1; + } + } + + let mut is_bonding_min_dhx = false; + if locks_first_amount_as_u128 >= min_bonded_dhx_daily_u128 { + is_bonding_min_dhx = true; + } + log::info!("is_bonding_min_dhx: {:?} {:?}", is_bonding_min_dhx.clone(), miner.clone()); + // println!("is_bonding_min_dhx {:#?}", is_bonding_min_dhx); + // println!("min_bonded_dhx_daily_u128 {:#?}", min_bonded_dhx_daily_u128); + + // TODO - move this into off-chain workers function + let mut min_mpower_daily_u128: u128 = 5u128; + if let Some(_min_mpower_daily_u128) = >::get() { + min_mpower_daily_u128 = _min_mpower_daily_u128; + } else { + log::error!("Unable to retrieve min. mPower daily as u128"); + } + // println!("min_mpower_daily_u128 {:#?}", min_mpower_daily_u128); + + // TODO - integrate this with functionality of off-chain workers function where we + // fetch the mpower from off-chain and store it with `set_mpower_of_account_for_date` + // TODO - fetch the mPower of the miner currently being iterated to check if it's greater than the min. + // mPower that is required + let mut mpower_current_u128: u128 = 0u128; + let _mpower_current_u128 = >::get((start_of_requested_date_millis.clone(), miner.clone())); + match _mpower_current_u128 { + None => { + log::error!("Unable to get_mpower_of_account_for_date {:?}", start_of_requested_date_millis.clone()); + println!("Unable to get_mpower_of_account_for_date {:?}", start_of_requested_date_millis.clone()); + }, + Some(x) => { + mpower_current_u128 = x; + } + } + log::info!("mpower_current_u128 {:#?}, {:?}", mpower_current_u128, start_of_requested_date_millis.clone()); + // println!("mpower_current_u128 {:#?}, {:?}", mpower_current_u128, start_of_requested_date_millis.clone()); + + let mut has_min_mpower_daily = false; + if mpower_current_u128 >= min_mpower_daily_u128 { + has_min_mpower_daily = true; + } + log::info!("has_min_mpower_daily: {:?} {:?}", has_min_mpower_daily.clone(), miner.clone()); + // println!("has_min_mpower_daily {:#?}", has_min_mpower_daily); + + // TODO - after fetching their mPower from the off-chain workers function where we iterate through + // the registered DHX miners too, we need to incorporate it + // into the recording the aggregated and accumulated rewards and the distribution of those rewards that + // are done in on_initialize. + // See Dhx-pop-mining-automatic.md in https://mxc.atlassian.net/browse/MMD-717 that explains off-chain worker + // aspects + + let cooling_off_period_days; + if let Some(_cooling_off_period_days) = >::get() { + cooling_off_period_days = _cooling_off_period_days; + } else { + log::error!("Unable to retrieve cooling off period days"); + return 0; + } + + let mut cooling_off_period_days_remaining = ( + start_of_requested_date_millis.clone(), + 7u32, + 0u32, + ); + if let Some(_cooling_off_period_days_remaining) = >::get(miner.clone()) { + // we do not change cooling_off_period_days_remaining.0 to the default value in the chain_spec.rs of 0, + // instead we want to use today's date `start_of_requested_date_millis.clone()` by default, as we did above. + if _cooling_off_period_days_remaining.0 != 0 { + cooling_off_period_days_remaining.0 = _cooling_off_period_days_remaining.0; + } + cooling_off_period_days_remaining.1 = _cooling_off_period_days_remaining.1; + cooling_off_period_days_remaining.2 = _cooling_off_period_days_remaining.2; + } else { + log::info!("Unable to retrieve cooling off period days remaining for given miner, using default {:?}", miner.clone()); + } + log::info!("cooling_off_period_days_remaining {:?} {:?} {:?}", start_of_requested_date_millis.clone(), cooling_off_period_days_remaining, miner.clone()); + // if cooling_off_period_days_remaining.2 is 0u32, it means we haven't recognised they that have the min. bonded yet (or unbonded), + // they aren't currently bonding, they haven't started cooling off to start bonding, + // or have already finished cooling down after bonding. + // so if we detect they are now bonding above the min. or have above the min. mPower then we should start at max. remaining days + // before starting to decrement on subsequent blocks + if + cooling_off_period_days_remaining.2 == 0u32 && + is_bonding_min_dhx == true && + has_min_mpower_daily == true + { + >::insert( + miner.clone(), + ( + start_of_requested_date_millis.clone(), + cooling_off_period_days.clone(), + 1u32, // they are bonded again, waiting to start getting rewards + ), + ); + log::info!("Added CoolingOffPeriodDaysRemaining for miner {:?} {:?} {:?}", start_of_requested_date_millis.clone(), miner.clone(), cooling_off_period_days.clone()); + // if cooling_off_period_days_remaining.0 is not the start of the current date + // (since if they just started with min. bonded dhx and min. mPower and we just set days remaining to 7, or we already decremented + // a miner's days remaining for the current date, then we want to wait until the next day until we + // decrement another day). + // if cooling_off_period_days_remaining.1 is Some(above 0), then decrement, but not eligible yet for rewards. + } else if + cooling_off_period_days_remaining.0 != start_of_requested_date_millis.clone() && + cooling_off_period_days_remaining.1 > 0u32 && + is_bonding_min_dhx == true && + has_min_mpower_daily == true + { + // println!("[reducing_days] block: {:#?}, miner: {:#?}, date_start: {:#?} remain_days: {:#?}", _n, miner_count, start_of_requested_date_millis, cooling_off_period_days_remaining); + let old_cooling_off_period_days_remaining = cooling_off_period_days_remaining.1.clone(); + + // we cannot do this because of error: cannot use the `?` operator in a method that returns `()` + // let new_cooling_off_period_days_remaining = + // old_cooling_off_period_days_remaining.checked_sub(One::one()).ok_or(Error::::StorageOverflow)?; + + // Subtract, handling overflow + let new_cooling_off_period_days_remaining; + let _new_cooling_off_period_days_remaining = + old_cooling_off_period_days_remaining.checked_sub(One::one()); + match _new_cooling_off_period_days_remaining { + None => { + log::error!("Unable to subtract one from cooling_off_period_days_remaining due to StorageOverflow"); + return 0; + }, + Some(x) => { + new_cooling_off_period_days_remaining = x; + } + } + + // Write the new value to storage + >::insert( + miner.clone(), + ( + start_of_requested_date_millis.clone(), + new_cooling_off_period_days_remaining.clone(), + 1u32, // they are bonded again, waiting to start getting rewards + ), + ); + log::info!("Reduced CoolingOffPeriodDaysRemaining for miner {:?} {:?} {:?}", start_of_requested_date_millis.clone(), miner.clone(), new_cooling_off_period_days_remaining.clone()); + // if cooling_off_period_days_remaining.0 is not the start of the current date + // (since if we decremented days remaining from 1 to 0 days left for a miner + // then we want to wait until the next day before we distribute the rewards to them) + // if cooling_off_period_days_remaining.1 is Some(0), + // and if cooling_off_period_days_remaining.2 is 1 + // and then no more cooling off days, but don't decrement, + // and say they are eligible for reward payments + } else if + cooling_off_period_days_remaining.0 != start_of_requested_date_millis.clone() && + cooling_off_period_days_remaining.1 == 0u32 && + cooling_off_period_days_remaining.2 == 1u32 && + is_bonding_min_dhx == true && + has_min_mpower_daily == true + { + // println!("[eligible] block: {:#?}, miner: {:#?}, date_start: {:#?} remain_days: {:#?}", _n, miner_count, start_of_requested_date_millis, cooling_off_period_days_remaining); + + // we need to add that they are eligible for rewards on the current date too + >::insert( + miner.clone(), + ( + start_of_requested_date_millis.clone(), + 0u32, + 1u32, + ), + ); + + // only accumulate the DHX reward for each registered miner once per day + // https://substrate.dev/rustdocs/latest/frame_support/storage/trait.StorageMap.html + if >::contains_key( + ( + start_of_requested_date_millis.clone(), + miner.clone(), + ) + ) == true { + continue; + } + + // TODO - calculate the daily reward for the miner in DHX based on their mPower + // and add that to the new_rewards_aggregated_dhx_daily_as_u128 (which currently only + // includes the proportion of their reward based on their bonded DHX tokens) of all + // miner's for that day, and also add that to the accumulated rewards for that specific + // miner on that day. + + // calculate the daily reward for the miner in DHX based on their bonded DHX. + // it should be a proportion taking other eligible miner's who are eligible for + // daily rewards into account since we want to split them fairly. + // + // assuming min_bonded_dhx_daily is 10u128, and they have that minimum of 10 DHX bonded (10u128) for + // the locks_first_amount_as_u128 value, then they are eligible for 1 DHX reward + // + // Divide, handling overflow + let mut daily_reward_for_miner_as_u128 = 0u128; + // note: this rounds down to the nearest integer + let _daily_reward_for_miner_as_u128 = locks_first_amount_as_u128.clone().checked_div(min_bonded_dhx_daily_u128.clone()); + match _daily_reward_for_miner_as_u128 { + None => { + log::error!("Unable to divide min_bonded_dhx_daily from locks_first_amount_as_u128 due to StorageOverflow"); + return 0; + }, + Some(x) => { + daily_reward_for_miner_as_u128 = x; + } + } + log::info!("daily_reward_for_miner_as_u128: {:?}", daily_reward_for_miner_as_u128.clone()); + // println!("[eligible] block: {:#?}, miner: {:#?}, date_start: {:#?} daily_reward_for_miner_as_u128: {:#?}", _n, miner_count, start_of_requested_date_millis, daily_reward_for_miner_as_u128); + + // if we have a rewards_aggregated_dhx_daily of 25.133 k DHX, then after the above manipulation + // since we're dealing with a mixture of u128 and BalanceOf so the values are more readable in the UI. + // the reward will be represented as 2.5130 f DHX (where f is femto 10^-18, i.e. 0.000_000_000_000_002_513) + // so we need to multiply it by 1_000_000_000_000_000_000 to be represented in DHX instead of femto DHX + // before storing the value. we need to do the same for the rewards accumulated value before it is stored. + // daily_reward_for_miner_as_u128 = daily_reward_for_miner_as_u128; + if let Some(_daily_reward_for_miner_as_u128) = daily_reward_for_miner_as_u128.clone().checked_mul(1_000_000_000_000_000_000u128) { + daily_reward_for_miner_as_u128 = _daily_reward_for_miner_as_u128; + } else { + log::error!("Unable to multiply daily_reward_for_miner_as_u128"); + } + + let mut daily_reward_for_miner; + let _daily_reward_for_miner = Self::convert_u128_to_balance(daily_reward_for_miner_as_u128.clone()); + match _daily_reward_for_miner { + Err(_e) => { + log::error!("Unable to convert u128 to balance for daily_reward_for_miner"); + return 0; + }, + Ok(ref x) => { + daily_reward_for_miner = x; + } + } + log::info!("daily_reward_for_miner: {:?}", daily_reward_for_miner.clone()); + + let mut rewards_aggregated_dhx_daily: BalanceOf = 0u32.into(); // initialize + if let Some(_rewards_aggregated_dhx_daily) = >::get(&start_of_requested_date_millis) { + rewards_aggregated_dhx_daily = _rewards_aggregated_dhx_daily; + } else { + log::error!("Unable to retrieve balance for rewards_aggregated_dhx_daily"); + } + + let rewards_aggregated_dhx_daily_as_u128; + let _rewards_aggregated_dhx_daily_as_u128 = Self::convert_balance_to_u128(rewards_aggregated_dhx_daily.clone()); + match _rewards_aggregated_dhx_daily_as_u128.clone() { + Err(_e) => { + log::error!("Unable to convert balance to u128 for rewards_aggregated_dhx_daily_as_u128"); + return 0; + }, + Ok(x) => { + rewards_aggregated_dhx_daily_as_u128 = x; + } + } + + // Add, handling overflow + let mut new_rewards_aggregated_dhx_daily_as_u128; + let _new_rewards_aggregated_dhx_daily_as_u128 = + rewards_aggregated_dhx_daily_as_u128.clone().checked_add(daily_reward_for_miner_as_u128.clone()); + match _new_rewards_aggregated_dhx_daily_as_u128 { + None => { + log::error!("Unable to add daily_reward_for_miner to rewards_aggregated_dhx_daily due to StorageOverflow"); + return 0; + }, + Some(x) => { + new_rewards_aggregated_dhx_daily_as_u128 = x; + } + } + + log::info!("new_rewards_aggregated_dhx_daily_as_u128: {:?}", new_rewards_aggregated_dhx_daily_as_u128.clone()); + // println!("[eligible] block: {:#?}, miner: {:#?}, date_start: {:#?} new_rewards_aggregated_dhx_daily_as_u128: {:#?}", _n, miner_count, start_of_requested_date_millis, new_rewards_aggregated_dhx_daily_as_u128); + + let new_rewards_aggregated_dhx_daily; + let _new_rewards_aggregated_dhx_daily = Self::convert_u128_to_balance(new_rewards_aggregated_dhx_daily_as_u128.clone()); + match _new_rewards_aggregated_dhx_daily { + Err(_e) => { + log::error!("Unable to convert u128 to balance for new_rewards_aggregated_dhx_daily"); + return 0; + }, + Ok(ref x) => { + new_rewards_aggregated_dhx_daily = x; + } + } + + // add to storage item that accumulates total rewards for all registered miners for the day + >::insert( + start_of_requested_date_millis.clone(), + new_rewards_aggregated_dhx_daily.clone(), + ); + log::info!("Added RewardsAggregatedDHXForAllMinersForDate for miner {:?} {:?} {:?}", start_of_requested_date_millis.clone(), miner.clone(), new_rewards_aggregated_dhx_daily.clone()); + + // add to storage item that maps the date to the registered miner and the calculated reward + // (prior to possibly reducing it so they get a proportion of the daily rewards that are available) + >::insert( + ( + start_of_requested_date_millis.clone(), + miner.clone(), + ), + daily_reward_for_miner.clone(), + ); + log::info!("Added RewardsAccumulatedDHXForMinerForDate for miner {:?} {:?} {:?}", start_of_requested_date_millis.clone(), miner.clone(), daily_reward_for_miner.clone()); + + // println!("date: {:?}, miner_count: {:?}, reg_dhx_miners.len: {:?}", start_of_requested_date_millis.clone(), miner_count.clone(), reg_dhx_miners.len()); + // if last miner being iterated then reset for next day + if reg_dhx_miners.len() == miner_count { + // println!("date: {:?}, rewards_allowance_dhx_daily: {:?}", start_of_requested_date_millis.clone(), rewards_allowance_dhx_daily.clone()); + + // reset to latest set by governance + >::insert(start_of_requested_date_millis.clone(), rewards_allowance_dhx_daily.clone()); + }; + + // if they stop bonding the min dhx or stop having min. mPower, and + // if cooling_off_period_days_remaining.1 is Some(0), + // and if cooling_off_period_days_remaining.2 is 1 (where they had just been bonding and getting rewards) + // so since we detected they are no longer bonding above the min. or have less than min. mPower + // then we should start at max. remaining days before starting to decrement on subsequent blocks + } else if + cooling_off_period_days_remaining.1 == 0u32 && + cooling_off_period_days_remaining.2 == 1u32 && + (is_bonding_min_dhx == false || has_min_mpower_daily == false) + { + // Write the new value to storage + >::insert( + miner.clone(), + ( + start_of_requested_date_millis.clone(), + cooling_off_period_days.clone(), + 2u32, // they have unbonded again, waiting to finish cooling down period + ), + ); + + log::info!("Unbonding detected for miner. Starting cooling down period {:?} {:?}", miner.clone(), cooling_off_period_days.clone()); + + // if cooling_off_period_days_remaining.0 is not the start of the current date + // (since if they just started un-bonding or just had less than min. mPower + // and we just set days remaining to 7, or we already decremented + // a miner's days remaining for the current date, then we want to wait until the next day until we + // decrement another day). + // if cooling_off_period_days_remaining.1 is Some(above 0), then decrement, + // but not yet completely unbonded so cannot withdraw yet + // note: we don't care if they stop bonding below the min. dhx or have less than min. mPower + // during the cooling off period, + // as the user needs to learn that they should always been bonding the min. and have min. mPower to + // maintain rewards, otherwise they have to wait for entire cooling down period and + // then the cooling off period again. + // + } else if + cooling_off_period_days_remaining.0 != start_of_requested_date_millis.clone() && + cooling_off_period_days_remaining.1 > 0u32 && + cooling_off_period_days_remaining.2 == 2u32 + // && is_bonding_min_dhx == false + { + let old_cooling_off_period_days_remaining = cooling_off_period_days_remaining.1.clone(); + + // Subtract, handling overflow + let new_cooling_off_period_days_remaining; + let _new_cooling_off_period_days_remaining = + old_cooling_off_period_days_remaining.checked_sub(One::one()); + match _new_cooling_off_period_days_remaining { + None => { + log::error!("Unable to subtract one from cooling_off_period_days_remaining due to StorageOverflow"); + return 0; + }, + Some(x) => { + new_cooling_off_period_days_remaining = x; + } + } + + // Write the new value to storage + >::insert( + miner.clone(), + ( + start_of_requested_date_millis.clone(), + new_cooling_off_period_days_remaining.clone(), + 2u32, // they have unbonded or have less than min. mPower again, waiting to finish cooling down period + ), + ); + + // println!("[reduce] block: {:#?}, miner: {:#?}, date_start: {:#?} new_cooling_off_period_days_remaining: {:#?}", _n, miner_count, start_of_requested_date_millis, new_cooling_off_period_days_remaining); + log::info!("Unbonded miner. Reducing cooling down period dates remaining {:?} {:?}", miner.clone(), new_cooling_off_period_days_remaining.clone()); + + // if cooling_off_period_days_remaining.0 is not the start of the current date + // (since if we decremented days remaining to from 1 to 0 days left for a miner + // then we want to wait until the next day before we set cooling_off_period_days_remaining.2 to 0u32 + // to allow them to be completely unbonded and withdraw). + // if cooling_off_period_days_remaining.1 is Some(0), do not subtract anymore, they are + // completely unbonded so can withdraw + } else if + cooling_off_period_days_remaining.0 != start_of_requested_date_millis.clone() && + cooling_off_period_days_remaining.1 == 0u32 && + cooling_off_period_days_remaining.2 == 2u32 + // && is_bonding_min_dhx == false + { + // Write the new value to storage + >::insert( + miner.clone(), + ( + start_of_requested_date_millis.clone(), + 0u32, + 0u32, // they are completely unbonded again + ), + ); + + log::info!("Unbonded miner. Cooling down period finished so allow them to withdraw {:?}", miner.clone()); + } + } + + log::info!("Finished initial loop of registered miners"); + // println!("Finished initial loop of registered miners"); + + // TODO - consider the miner's mPower that we have fetched. it should have been added earlier above + // to the aggregated (all miners for that day) and accumulated (specific miner for a day) rewards + + // fetch accumulated total rewards for all registered miners for the day + // TODO - we've done this twice, create a function to fetch it + let mut rewards_aggregated_dhx_daily: BalanceOf = 0u32.into(); // initialize + if let Some(_rewards_aggregated_dhx_daily) = >::get(&start_of_requested_date_millis) { + rewards_aggregated_dhx_daily = _rewards_aggregated_dhx_daily; + } else { + log::error!("Unable to retrieve balance for rewards_aggregated_dhx_daily. Cooling off period may not be finished yet"); + // Note: it would be an issue if we got past the first loop of looping through the registered miners + // and still hadn't added to the aggregated rewards for the day + return 0; + } + // println!("[multiplier] block: {:#?}, miner: {:#?}, date_start: {:#?} rewards_aggregated_dhx_daily: {:#?}", _n, miner_count, start_of_requested_date_millis, rewards_aggregated_dhx_daily); + + if rewards_aggregated_dhx_daily == 0u32.into() { + log::error!("rewards_aggregated_dhx_daily must be greater than 0 to distribute rewards"); + return 0; + } + + let rewards_aggregated_dhx_daily_as_u128; + let _rewards_aggregated_dhx_daily_as_u128 = Self::convert_balance_to_u128(rewards_aggregated_dhx_daily.clone()); + match _rewards_aggregated_dhx_daily_as_u128.clone() { + Err(_e) => { + log::error!("Unable to convert balance to u128 for rewards_aggregated_dhx_daily_as_u128"); + return 0; + }, + Ok(x) => { + rewards_aggregated_dhx_daily_as_u128 = x; + } + } + log::info!("rewards_aggregated_dhx_daily_as_u128: {:?}", rewards_aggregated_dhx_daily_as_u128.clone()); + + // TODO - we've done this twice, create a function to fetch it + let rewards_allowance_dhx_daily; + if let Some(_rewards_allowance_dhx_daily) = >::get() { + rewards_allowance_dhx_daily = _rewards_allowance_dhx_daily; + } else { + log::error!("Unable to get rewards_allowance_dhx_daily"); + return 0; + } + + let rewards_allowance_dhx_daily_u128; + let _rewards_allowance_dhx_daily_u128 = Self::convert_balance_to_u128(rewards_allowance_dhx_daily.clone()); + match _rewards_allowance_dhx_daily_u128.clone() { + Err(_e) => { + log::error!("Unable to convert balance to u128 for rewards_allowance_dhx_daily_u128"); + return 0; + }, + Ok(x) => { + rewards_allowance_dhx_daily_u128 = x; + } + } + + if rewards_allowance_dhx_daily_u128 == 0u128 { + log::error!("rewards_allowance_dhx_daily must be greater than 0 to distribute rewards"); + return 0; + } + + // previously when we looped through all the registered dhx miners we calculated the + // reward for each registered miner based on the 10:1 ratio, and stored that along with + // the corresponding day in storage. since that loop we've fetched the total + // aggregated rewards that all reg miners are eligible for on that day as `rewards_aggregated_dhx_daily`, + // lets say it adds up to 8000 DHX, but say we only have 5000 DHX availabe to distribute + // from `rewards_allowance_dhx_daily`, so we'll constrain the rewards they'll receive further by + // applying a `distribution_multiplier_for_day_u128` of (5000/8000)*reg_miner_reward on each of + // the rewards that are distributed to them. + + // if the aggregated rewards isn't more than the daily rewards allowance available + // then just set the multiplier to 1, so they actually get the previously calculated reward rather + // than a scaled down proportion. + // + // e.g. 1: if miner rewards are 2000 & 4000 DHX respectively, this is greater than 5000 DHX daily allowance + // so we'd have a multiplier of 5000/6000 = 5/6, so they'd receive ~1666 & 3333 DHX respectively. + // e.g. 2: if miner rewards are 2000 & 2000 DHX respectively, this is less than 5000 DHX daily allowance + // so we'd just use a multiplier of 1, so they'd receive 2000 & 2000 DHX respectively. + // https://docs.rs/fixed/0.5.4/fixed/struct.FixedU128.html + let mut distribution_multiplier_for_day_fixed128 = FixedU128::from_num(1); // initialize + + if rewards_aggregated_dhx_daily_as_u128.clone() > rewards_allowance_dhx_daily_u128.clone() { + // Divide, handling overflow + + // Note: If the rewards_allowance_dhx_daily_u128 is 5000 DHX, its 5000000000000000000000, + // but we can't convert to u64 since largest value is 18446744073709551615. + // Since we expect the rewards_aggregated_dhx_daily_as_u128 to be at least 1 DHX (i.e. 1000000000000000000), + // we could just divide both numbers by 1000000000000000000, so we'd have say 5000 and 1 instead, + // since we're just using these values to get a multiplier output. + + let mut manageable_rewards_allowance_dhx_daily_u128 = 0u128; + if let Some(_manageable_rewards_allowance_dhx_daily_u128) = + rewards_allowance_dhx_daily_u128.clone().checked_div(1000000000000000000u128) { + manageable_rewards_allowance_dhx_daily_u128 = _manageable_rewards_allowance_dhx_daily_u128; + } else { + log::error!("Unable to divide rewards_allowance_dhx_daily_u128 to make it smaller"); + return 0; + } + + let mut rewards_allowance_dhx_daily_u64 = 0u64; + if let Some(_rewards_allowance_dhx_daily_u64) = + TryInto::::try_into(manageable_rewards_allowance_dhx_daily_u128.clone()).ok() { + rewards_allowance_dhx_daily_u64 = _rewards_allowance_dhx_daily_u64; + } else { + log::error!("Unable to convert u128 to u64 for rewards_allowance_dhx_daily_u128"); + return 0; + } + + let mut manageable_rewards_aggregated_dhx_daily_as_u128 = 0u128; + if let Some(_manageable_rewards_aggregated_dhx_daily_as_u128) = rewards_aggregated_dhx_daily_as_u128.clone().checked_div(1000000000000000000u128) { + manageable_rewards_aggregated_dhx_daily_as_u128 = _manageable_rewards_aggregated_dhx_daily_as_u128; + } else { + log::error!("Unable to divide manageable_rewards_aggregated_dhx_daily_as_u128 to make it smaller"); + return 0; + } + + let mut rewards_aggregated_dhx_daily_as_u64 = 0u64; + if let Some(_rewards_aggregated_dhx_daily_as_u64) = + TryInto::::try_into(manageable_rewards_aggregated_dhx_daily_as_u128.clone()).ok() { + rewards_aggregated_dhx_daily_as_u64 = _rewards_aggregated_dhx_daily_as_u64; + } else { + log::error!("Unable to convert u128 to u64 for rewards_aggregated_dhx_daily_as_u128"); + return 0; + } + + // See https://github.com/ltfschoen/substrate-node-template/pull/6/commits/175ef4805d07093042431c5814dda52da1ebde18 + let _fraction_distribution_multiplier_for_day_fixed128 = + U64F64::from_num(manageable_rewards_allowance_dhx_daily_u128.clone()) + .checked_div(U64F64::from_num(manageable_rewards_aggregated_dhx_daily_as_u128.clone())); + let _distribution_multiplier_for_day_fixed128 = _fraction_distribution_multiplier_for_day_fixed128.clone(); + match _distribution_multiplier_for_day_fixed128 { + None => { + log::error!("Unable to divide rewards_allowance_dhx_daily_u128 due to StorageOverflow by rewards_aggregated_dhx_daily_as_u128"); + return 0; + }, + Some(x) => { + distribution_multiplier_for_day_fixed128 = x; + } + } + } + log::info!("distribution_multiplier_for_day_fixed128 {:#?}", distribution_multiplier_for_day_fixed128); + // println!("[multiplier] block: {:#?}, miner: {:#?}, date_start: {:#?} distribution_multiplier_for_day_fixed128: {:#?}", _n, miner_count, start_of_requested_date_millis, distribution_multiplier_for_day_fixed128); + + // Initialise outside the loop as we need this value after the loop after we finish iterating through all the miners + let mut rewards_allowance_dhx_remaining_today_as_u128 = 0u128; + + miner_count = 0; + for (index, miner) in reg_dhx_miners.iter().enumerate() { + miner_count += 1; + log::info!("rewards loop - miner_count {:#?}", miner_count); + log::info!("rewards loop - miner {:#?}", miner); + + // only run the following once per day per miner until rewards_allowance_dhx_for_date_remaining is exhausted + // but since we're giving each registered miner a proportion of the daily reward allowance + // (if their aggregated rewards is above daily allowance) each proportion is rounded down, + // it shouldn't become exhausted anyway + let is_already_distributed = >::get(start_of_requested_date_millis.clone()); + if is_already_distributed == Some(true) { + log::error!("Unable to distribute further rewards allowance today"); + return 0; + } + + let daily_reward_for_miner_as_u128; + let daily_reward_for_miner_to_try = >::get( + ( + start_of_requested_date_millis.clone(), + miner.clone(), + ), + ); + if let Some(_daily_reward_for_miner_to_try) = daily_reward_for_miner_to_try.clone() { + let _daily_reward_for_miner_as_u128 = Self::convert_balance_to_u128(_daily_reward_for_miner_to_try.clone()); + match _daily_reward_for_miner_as_u128.clone() { + Err(_e) => { + log::error!("Unable to convert balance to u128 for daily_reward_for_miner_as_u128"); + return 0; + }, + Ok(x) => { + daily_reward_for_miner_as_u128 = x; + } + } + } else { + // If any of the miner's don't have a reward, we won't waste storing that, + // so we want to move to the next miner in the loop + log::error!("Unable to retrieve reward balance for daily_reward_for_miner {:?}", miner.clone()); + continue; + } + log::info!("daily_reward_for_miner_as_u128: {:?}", daily_reward_for_miner_as_u128.clone()); + + let mut manageable_daily_reward_for_miner_as_u128 = 0u128; + if let Some(_manageable_daily_reward_for_miner_as_u128) = + daily_reward_for_miner_as_u128.clone().checked_div(1000000000000000000u128) { + manageable_daily_reward_for_miner_as_u128 = _manageable_daily_reward_for_miner_as_u128; + } else { + log::error!("Unable to divide daily_reward_for_miner_as_u128 to make it smaller"); + return 0; + } + + // Multiply, handling overflow + // TODO - probably have to initialise below proportion_of_daily_reward_for_miner_fixed128 to 0u128, + // and convert distribution_multiplier_for_day_fixed128 to u64, + // and convert daily_reward_for_miner_as_u128 to u64 too, like i did earlier. + // but it works so this doesn't seem necessary. + let proportion_of_daily_reward_for_miner_fixed128; + let _proportion_of_daily_reward_for_miner_fixed128 = + U64F64::from_num(distribution_multiplier_for_day_fixed128.clone()).checked_mul(U64F64::from_num(manageable_daily_reward_for_miner_as_u128.clone())); + match _proportion_of_daily_reward_for_miner_fixed128 { + None => { + log::error!("Unable to multiply proportion_of_daily_reward_for_miner_fixed128 with daily_reward_for_miner_as_u128 due to StorageOverflow"); + return 0; + }, + Some(x) => { + proportion_of_daily_reward_for_miner_fixed128 = x; + } + } + log::info!("proportion_of_daily_reward_for_miner_fixed128: {:?}", proportion_of_daily_reward_for_miner_fixed128.clone()); + + // round down to nearest integer. we need to round down, because if we round up then if there are + // 3x registered miners with 5000 DHX rewards allowance per day then they would each get 1667 rewards, + // but there would only be 1666 remaining after the first two, so the last one would miss out. + // so if we round down they each get 1666 DHX and there is 2 DHX from the daily allocation that doesn't get distributed at all. + let proportion_of_daily_reward_for_miner_u128: u128 = proportion_of_daily_reward_for_miner_fixed128.floor().to_num::(); + + // we lose some accuracy doing this conversion, but at least we split the bulk of the rewards proportionally and fairly + let mut restored_proportion_of_daily_reward_for_miner_u128 = 0u128; + if let Some(_restored_proportion_of_daily_reward_for_miner_u128) = + proportion_of_daily_reward_for_miner_u128.clone().checked_mul(1000000000000000000u128) { + restored_proportion_of_daily_reward_for_miner_u128 = _restored_proportion_of_daily_reward_for_miner_u128; + } else { + log::error!("Unable to multiply proportion_of_daily_reward_for_miner_fixed128 to restore it larger again"); + return 0; + } + + // println!("[rewards] block: {:#?}, miner: {:#?}, date_start: {:#?} restored_proportion_of_daily_reward_for_miner_u128: {:#?}", _n, miner_count, start_of_requested_date_millis, restored_proportion_of_daily_reward_for_miner_u128); + + let treasury_account_id: T::AccountId = >::account_id(); + let max_payout = pallet_balances::Pallet::::usable_balance(treasury_account_id.clone()); + log::info!("Treasury account id: {:?}", treasury_account_id.clone()); + log::info!("Miner to receive reward: {:?}", miner.clone()); + log::info!("Treasury balance max payout: {:?}", max_payout.clone()); + + let proportion_of_daily_reward_for_miner; + let _proportion_of_daily_reward_for_miner = Self::convert_u128_to_balance(restored_proportion_of_daily_reward_for_miner_u128.clone()); + match _proportion_of_daily_reward_for_miner { + Err(_e) => { + log::error!("Unable to convert u128 to balance for proportion_of_daily_reward_for_miner"); + return 0; + }, + Ok(ref x) => { + proportion_of_daily_reward_for_miner = x; + } + } + + let max_payout_as_u128; + if let Some(_max_payout_as_u128) = TryInto::::try_into(max_payout).ok() { + max_payout_as_u128 = _max_payout_as_u128; + } else { + log::error!("Unable to convert Balance to u128 for max_payout"); + return 0; + } + log::info!("max_payout_as_u128: {:?}", max_payout_as_u128.clone()); + + // Store output `rewards_allowance_dhx_remaining_today_as_u128` outside the loop + // Validate inputs so the daily_rewards is less or equal to the existing_allowance + if let Some(_rewards_allowance_dhx_remaining_today) = >::get(&start_of_requested_date_millis) { + let _rewards_allowance_dhx_remaining_today_as_u128 = Self::convert_balance_to_u128(_rewards_allowance_dhx_remaining_today.clone()); + match _rewards_allowance_dhx_remaining_today_as_u128.clone() { + Err(_e) => { + log::error!("Unable to convert balance to u128"); + return 0; + }, + Ok(x) => { + rewards_allowance_dhx_remaining_today_as_u128 = x; + } + } + log::info!("rewards_allowance_dhx_remaining_today_as_u128: {:?}", rewards_allowance_dhx_remaining_today_as_u128.clone()); + } else { + log::error!("Unable to retrieve balance from value provided."); + return 0; + } + + // println!("[prepared-for-payment] block: {:#?}, miner: {:#?}, date_start: {:#?} max payout: {:#?}, rewards remaining today {:?}, restored_proportion_of_daily_reward_for_miner_u128 {:?}", _n, miner_count, start_of_requested_date_millis, max_payout_as_u128, rewards_allowance_dhx_remaining_today_as_u128, restored_proportion_of_daily_reward_for_miner_u128); + + // check if miner's reward is less than or equal to: rewards_allowance_dhx_daily_remaining + if restored_proportion_of_daily_reward_for_miner_u128.clone() > 0u128 && + rewards_allowance_dhx_remaining_today_as_u128.clone() >= restored_proportion_of_daily_reward_for_miner_u128.clone() && + max_payout_as_u128.clone() >= restored_proportion_of_daily_reward_for_miner_u128.clone() + { + // pay the miner their daily reward + info!("Paying the miner a proportion of the remaining daily reward allowance"); + + let tx_result; + let _tx_result = ::Currency::transfer( + &treasury_account_id, + &miner.clone(), + proportion_of_daily_reward_for_miner.clone(), + ExistenceRequirement::KeepAlive + ); + match _tx_result { + Err(_e) => { + log::error!("Unable to transfer from treasury to miner {:?}", miner.clone()); + return 0; + }, + Ok(ref x) => { + tx_result = x; + } + } + info!("Transfer to the miner tx_result: {:?}", tx_result.clone()); + + info!("Success paying the reward to the miner: {:?}", restored_proportion_of_daily_reward_for_miner_u128.clone()); + + // TODO - move into function `reduce_rewards_allowance_dhx_for_date_remaining`? + + // Subtract, handling overflow + let new_rewards_allowance_dhx_remaining_today_as_u128; + let _new_rewards_allowance_dhx_remaining_today_as_u128 = + rewards_allowance_dhx_remaining_today_as_u128.clone().checked_sub(restored_proportion_of_daily_reward_for_miner_u128.clone()); + match _new_rewards_allowance_dhx_remaining_today_as_u128 { + None => { + log::error!("Unable to subtract restored_proportion_of_daily_reward_for_miner_u128 from rewards_allowance_dhx_remaining_today due to StorageOverflow"); + return 0; + }, + Some(x) => { + new_rewards_allowance_dhx_remaining_today_as_u128 = x; + } + } + + let new_rewards_allowance_dhx_remaining_today; + let _new_rewards_allowance_dhx_remaining_today = Self::convert_u128_to_balance(new_rewards_allowance_dhx_remaining_today_as_u128.clone()); + match _new_rewards_allowance_dhx_remaining_today { + Err(_e) => { + log::error!("Unable to convert u128 to balance for new_rewards_allowance_dhx_remaining_today"); + return 0; + }, + Ok(ref x) => { + new_rewards_allowance_dhx_remaining_today = x; + } + } + + // Write the new value to storage + >::insert( + start_of_requested_date_millis.clone(), + new_rewards_allowance_dhx_remaining_today.clone(), + ); + + // println!("[paid] block: {:#?}, miner: {:#?}, date_start: {:#?} new_rewards_allowance_dhx_remaining_today: {:#?}", _n, miner_count, start_of_requested_date_millis, new_rewards_allowance_dhx_remaining_today); + + // emit event with reward payment history rather than bloating storage + Self::deposit_event(Event::TransferredRewardsAllowanceDHXToMinerForDate( + start_of_requested_date_millis.clone(), + proportion_of_daily_reward_for_miner.clone(), + new_rewards_allowance_dhx_remaining_today.clone(), + miner.clone(), + )); + + log::info!("TransferredRewardsAllowanceDHXToMinerForDate {:?} {:?} {:?} {:?}", + start_of_requested_date_millis.clone(), + proportion_of_daily_reward_for_miner.clone(), + new_rewards_allowance_dhx_remaining_today.clone(), + miner.clone(), + ); + + continue; + } else { + log::error!("Insufficient remaining rewards allowance to pay daily reward to miner"); + + break; + } + } + + let rewards_allowance_dhx_remaining_today; + let _rewards_allowance_dhx_remaining_today = Self::convert_u128_to_balance(rewards_allowance_dhx_remaining_today_as_u128.clone()); + match _rewards_allowance_dhx_remaining_today { + Err(_e) => { + log::error!("Unable to convert u128 to balance for rewards_allowance_dhx_remaining_today"); + return 0; + }, + Ok(ref x) => { + rewards_allowance_dhx_remaining_today = x; + } + } + + >::insert( + start_of_requested_date_millis.clone(), + true + ); + + // println!("[distributed] block: {:#?}, miner: {:#?}, date_start: {:#?} ", _n, miner_count, start_of_requested_date_millis); + + Self::deposit_event(Event::DistributedRewardsAllowanceDHXForDateRemaining( + start_of_requested_date_millis.clone(), + rewards_allowance_dhx_remaining_today.clone(), + )); + + return 0; + } + + // `on_finalize` is executed at the end of block after all extrinsic are dispatched. + fn on_finalize(_n: T::BlockNumber) { + // Perform necessary data/state clean up here. + } + } + + // Dispatchable functions allows users to interact with the pallet and invoke state changes. + // These functions materialize as "extrinsics", which are often compared to transactions. + // Dispatchable functions must be annotated with a weight and must return a DispatchResult. + #[pallet::call] + impl Pallet { + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_registered_dhx_miner(origin: OriginFor) -> DispatchResult { + let _sender: T::AccountId = ensure_signed(origin)?; + + >::append(_sender.clone()); + log::info!("register_dhx_miner - account_id: {:?}", &_sender); + + Self::deposit_event(Event::SetRegisteredDHXMiner( + _sender.clone(), + )); + + Ok(()) + } + + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_min_bonded_dhx_daily(origin: OriginFor, min_bonded_dhx_daily: BalanceOf) -> DispatchResult { + let _sender: T::AccountId = ensure_signed(origin)?; + + >::put(&min_bonded_dhx_daily.clone()); + log::info!("set_min_bonded_dhx_daily: {:?}", &min_bonded_dhx_daily); + + Self::deposit_event(Event::SetMinBondedDHXDailyStored( + min_bonded_dhx_daily.clone(), + _sender.clone(), + )); + + Ok(()) + } + + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_min_mpower_daily(origin: OriginFor, min_mpower_daily: u128) -> DispatchResult { + let _sender: T::AccountId = ensure_signed(origin)?; + + >::put(&min_mpower_daily.clone()); + log::info!("set_min_mpower_daily: {:?}", &min_mpower_daily); + + Self::deposit_event(Event::SetMinMPowerDailyStored( + min_mpower_daily.clone(), + _sender.clone(), + )); + + Ok(()) + } + + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_cooling_off_period_days(origin: OriginFor, cooling_off_period_days: u32) -> DispatchResult { + let _sender: T::AccountId = ensure_signed(origin)?; + + >::put(&cooling_off_period_days.clone()); + log::info!("cooling_off_period_days: {:?}", &cooling_off_period_days); + + Self::deposit_event(Event::SetCoolingOffPeriodDaysStored( + cooling_off_period_days.clone(), + )); + + Ok(()) + } + + // TODO: we need to change this in future so it is only modifiable by governance, + // rather than just any user + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_rewards_allowance_dhx_daily(origin: OriginFor, rewards_allowance: BalanceOf) -> DispatchResult { + let _who = ensure_signed(origin)?; + // Update storage + >::put(&rewards_allowance.clone()); + log::info!("set_rewards_allowance_dhx_daily - rewards_allowance: {:?}", &rewards_allowance); + + // Emit an event. + Self::deposit_event(Event::SetRewardsAllowanceDHXDailyStored( + rewards_allowance.clone(), + _who.clone() + )); + + // Return a successful DispatchResultWithPostInfo + Ok(()) + } + + // customised by governance at any time. this function allows us to change it each year + // https://docs.google.com/spreadsheets/d/1W2AzOH9Cs9oCR8UYfYCbpmd9X7hp-USbYXL7AuwMY_Q/edit#gid=970997021 + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_rewards_allowance_dhx_for_date_remaining(origin: OriginFor, rewards_allowance: BalanceOf, timestamp: u64) -> DispatchResult { + let _who = ensure_signed(origin)?; + + // Note: we do not need the following as we're not using the current timestamp, rather the function parameter. + // let current_date = >::get(); + // let requested_date_as_u64 = Self::convert_moment_to_u64_in_milliseconds(timestamp.clone())?; + // log::info!("requested_date_as_u64: {:?}", requested_date_as_u64.clone()); + + // Note: to get current timestamp `>::get()` + // convert the requested date/time to the start of that day date/time to signify that date for lookup + // i.e. 21 Apr @ 1420 -> 21 Apr @ 0000 + let start_of_requested_date_millis = Self::convert_u64_in_milliseconds_to_start_of_date(timestamp.clone())?; + + // Update storage. Override the default that may have been set in on_initialize + >::insert(start_of_requested_date_millis.clone(), &rewards_allowance); + log::info!("set_rewards_allowance_dhx_for_date_remaining - rewards_allowance: {:?}", &rewards_allowance); + + // Emit an event. + Self::deposit_event(Event::ChangedRewardsAllowanceDHXForDateRemainingStored( + start_of_requested_date_millis.clone(), + rewards_allowance.clone(), + _who.clone(), + 1u8, // increment + )); + + // Return a successful DispatchResultWithPostInfo + Ok(()) + } + + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + // parameter `change: u8` value may be 0 or 1 (or any other value) to represent that we want to make a + // corresponding decrease or increase to the remaining dhx rewards allowance for a given date. + pub fn change_rewards_allowance_dhx_for_date_remaining(origin: OriginFor, daily_rewards: BalanceOf, timestamp: u64, change: u8) -> DispatchResult { + let _who = ensure_signed(origin)?; + + let start_of_requested_date_millis = Self::convert_u64_in_milliseconds_to_start_of_date(timestamp.clone())?; + + // https://substrate.dev/rustdocs/latest/frame_support/storage/trait.StorageMap.html + ensure!(>::contains_key(&start_of_requested_date_millis), DispatchError::Other("Date key must exist to reduce allowance.")); + + // Validate inputs so the daily_rewards is less or equal to the existing_allowance + let existing_allowance_as_u128; + if let Some(_existing_allowance) = >::get(&start_of_requested_date_millis) { + existing_allowance_as_u128 = Self::convert_balance_to_u128(_existing_allowance.clone())?; + log::info!("change_rewards_allowance_dhx_for_date_remaining - existing_allowance_as_u128: {:?}", existing_allowance_as_u128.clone()); + } else { + return Err(DispatchError::Other("Unable to retrieve balance from value provided")); + } + + let daily_rewards_as_u128; + daily_rewards_as_u128 = Self::convert_balance_to_u128(daily_rewards.clone())?; + log::info!("change_rewards_allowance_dhx_for_date_remaining - daily_rewards_as_u128: {:?}", daily_rewards_as_u128.clone()); + + ensure!(daily_rewards_as_u128 > 0u128, DispatchError::Other("Daily rewards must be greater than zero")); + ensure!(existing_allowance_as_u128 >= daily_rewards_as_u128, DispatchError::Other("Daily rewards cannot exceed current remaining allowance")); + + let new_remaining_allowance_as_balance; + if change == 0 { + // Decrementing the value will error in the event of underflow. + let new_remaining_allowance_as_u128 = existing_allowance_as_u128.checked_sub(daily_rewards_as_u128).ok_or(Error::::StorageUnderflow)?; + new_remaining_allowance_as_balance = Self::convert_u128_to_balance(new_remaining_allowance_as_u128.clone())?; + log::info!("change_rewards_allowance_dhx_for_date_remaining - Decreasing rewards_allowance_dhx_for_date_remaining at Date: {:?}", &start_of_requested_date_millis); + } else { + // Incrementing the value will error in the event of overflow. + let new_remaining_allowance_as_u128 = existing_allowance_as_u128.checked_add(daily_rewards_as_u128).ok_or(Error::::StorageOverflow)?; + new_remaining_allowance_as_balance = Self::convert_u128_to_balance(new_remaining_allowance_as_u128.clone())?; + log::info!("change_rewards_allowance_dhx_for_date_remaining - Increasing rewards_allowance_dhx_for_date_remaining at Date: {:?}", &start_of_requested_date_millis); + } + + // Update storage + >::mutate( + &start_of_requested_date_millis, + |allowance| { + if let Some(_allowance) = allowance { + *_allowance = new_remaining_allowance_as_balance.clone(); + } + }, + ); + + // Emit an event. + Self::deposit_event(Event::ChangedRewardsAllowanceDHXForDateRemainingStored( + start_of_requested_date_millis.clone(), + new_remaining_allowance_as_balance.clone(), + _who.clone(), + change.clone(), + )); + + // Return a successful DispatchResultWithPostInfo + Ok(()) + } + + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_rewards_multiplier_operation(origin: OriginFor, operation: u8) -> DispatchResult { + let _who = ensure_signed(origin)?; + >::put(&operation.clone()); + log::info!("set_rewards_multiplier_operation - operation: {:?}", &operation); + + // Emit an event. + Self::deposit_event(Event::SetRewardsMultiplierOperationStored( + operation.clone(), + _who.clone() + )); + + // Return a successful DispatchResultWithPostInfo + Ok(()) + } + + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_rewards_multiplier_default_period_days(origin: OriginFor, days: u32) -> DispatchResult { + let _who = ensure_signed(origin)?; + >::put(&days.clone()); + log::info!("set_rewards_multiplier_default_period_days - days: {:?}", &days); + + // Emit an event. + Self::deposit_event(Event::SetRewardsMultiplierDefaultPeriodDaysStored( + days.clone(), + _who.clone() + )); + + // Return a successful DispatchResultWithPostInfo + Ok(()) + } + + #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + pub fn set_rewards_multiplier_next_period_days(origin: OriginFor, days: u32) -> DispatchResult { + let _who = ensure_signed(origin)?; + >::put(&days.clone()); + log::info!("set_rewards_multiplier_next_period_days - days: {:?}", &days); + + // Emit an event. + Self::deposit_event(Event::SetRewardsMultiplierNextPeriodDaysStored( + days.clone(), + _who.clone() + )); + + // Return a successful DispatchResultWithPostInfo + Ok(()) + } + } + + // Private functions + + impl Pallet { + fn convert_moment_to_u64_in_milliseconds(date: T::Moment) -> Result { + let date_as_u64_millis; + if let Some(_date_as_u64) = TryInto::::try_into(date).ok() { + date_as_u64_millis = _date_as_u64; + } else { + return Err(DispatchError::Other("Unable to convert Moment to i64 for date")); + } + return Ok(date_as_u64_millis); + } + + fn convert_u64_in_milliseconds_to_start_of_date(date_as_u64_millis: u64) -> Result { + let date_as_u64_secs = date_as_u64_millis.clone() / 1000u64; + log::info!("convert_u64_in_milliseconds_to_start_of_date - date_as_u64_secs: {:?}", date_as_u64_secs.clone()); + // https://docs.rs/chrono/0.4.6/chrono/naive/struct.NaiveDateTime.html#method.from_timestamp + let date = NaiveDateTime::from_timestamp(i64::try_from(date_as_u64_secs).unwrap(), 0).date(); + + let date_start_millis = date.and_hms(0, 0, 0).timestamp() * 1000; + log::info!("convert_u64_in_milliseconds_to_start_of_date - date_start_millis: {:?}", date_start_millis.clone()); + log::info!("convert_u64_in_milliseconds_to_start_of_date - Timestamp requested Date: {:?}", date); + return Ok(date_start_millis); + } + + fn convert_i64_in_milliseconds_to_start_of_date(date_as_i64_millis: i64) -> Result { + let date_as_i64_secs = date_as_i64_millis.clone() / 1000i64; + log::info!("convert_i64_in_milliseconds_to_start_of_date - date_as_i64_secs: {:?}", date_as_i64_secs.clone()); + // https://docs.rs/chrono/0.4.6/chrono/naive/struct.NaiveDateTime.html#method.from_timestamp + let date = NaiveDateTime::from_timestamp(i64::try_from(date_as_i64_secs).unwrap(), 0).date(); + + let date_start_millis = date.and_hms(0, 0, 0).timestamp() * 1000; + log::info!("convert_i64_in_milliseconds_to_start_of_date - date_start_millis: {:?}", date_start_millis.clone()); + log::info!("convert_i64_in_milliseconds_to_start_of_date - Timestamp requested Date: {:?}", date); + return Ok(date_start_millis); + } + + fn convert_balance_to_u128(balance: BalanceOf) -> Result { + let balance_as_u128; + + if let Some(_balance_as_u128) = TryInto::::try_into(balance).ok() { + balance_as_u128 = _balance_as_u128; + } else { + return Err(DispatchError::Other("Unable to convert Balance to u128 for balance")); + } + log::info!("convert_balance_to_u128 balance_as_u128 - {:?}", balance_as_u128.clone()); + + return Ok(balance_as_u128); + } + + fn convert_balance_to_u128_from_pallet_balance(balance: BalanceFromBalancePallet) -> Result { + let balance_as_u128; + + if let Some(_balance_as_u128) = TryInto::::try_into(balance).ok() { + balance_as_u128 = _balance_as_u128; + } else { + return Err(DispatchError::Other("Unable to convert Balance to u128 for balance")); + } + log::info!("convert_balance_to_u128_from_pallet_balance - balance_as_u128: {:?}", balance_as_u128.clone()); + + return Ok(balance_as_u128); + } + + fn convert_u128_to_balance(balance_as_u128: u128) -> Result, DispatchError> { + let balance; + if let Some(_balance) = TryInto::>::try_into(balance_as_u128).ok() { + balance = _balance; + } else { + return Err(DispatchError::Other("Unable to convert u128 to Balance for balance")); + } + log::info!("convert_u128_to_balance balance - {:?}", balance.clone()); + + return Ok(balance); + } + + fn convert_blocknumber_to_u64(blocknumber: T::BlockNumber) -> Result { + let mut blocknumber_u64 = 0u64; + if let Some(_blocknumber_u64) = TryInto::::try_into(blocknumber).ok() { + blocknumber_u64 = _blocknumber_u64; + } else { + log::error!("Unable to convert BlockNumber to u64"); + } + log::info!("blocknumber_u64: {:?}", blocknumber_u64.clone()); + + return Ok(blocknumber_u64); + } + + fn set_bonded_dhx_of_account_for_date(account_id: T::AccountId, bonded_dhx: u128) -> Result { + // Note: we DO need the following as we're using the current timestamp, rather than a function parameter. + let timestamp: ::Moment = >::get(); + let requested_date_as_u64 = Self::convert_moment_to_u64_in_milliseconds(timestamp.clone())?; + log::info!("set_bonded_dhx_of_account_for_date - requested_date_as_u64: {:?}", requested_date_as_u64.clone()); + + // convert the requested date/time to the start of that day date/time to signify that date for lookup + // i.e. 21 Apr @ 1420 -> 21 Apr @ 0000 + let start_of_requested_date_millis = Self::convert_u64_in_milliseconds_to_start_of_date(requested_date_as_u64.clone())?; + + let bonded_dhx_current_u128 = bonded_dhx.clone(); + + let bonded_dhx_current; + let _bonded_dhx_current = Self::convert_u128_to_balance(bonded_dhx_current_u128.clone()); + match _bonded_dhx_current { + Err(_e) => { + log::error!("Unable to convert u128 to balance for bonded_dhx_current"); + return Err(DispatchError::Other("Unable to convert u128 to balance for bonded_dhx_current")); + }, + Ok(ref x) => { + bonded_dhx_current = x; + } + } + + // Update storage. Override the default that may have been set in on_initialize + >::insert( + ( + start_of_requested_date_millis.clone(), + account_id.clone(), + ), + bonded_dhx_current.clone(), + ); + log::info!("set_bonded_dhx_of_account_for_date - account_id: {:?}", &account_id); + log::info!("set_bonded_dhx_of_account_for_date - bonded_dhx_current: {:?}", &bonded_dhx_current); + + // Emit an event. + Self::deposit_event(Event::SetBondedDHXOfAccountForDateStored( + start_of_requested_date_millis.clone(), + bonded_dhx_current.clone(), + account_id.clone(), + )); + + // Return a successful DispatchResultWithPostInfo + Ok(bonded_dhx_current_u128.clone()) + } + + // we need to set the mPower for the next start date so it's available from off-chain in time + pub fn set_mpower_of_account_for_date(account_id: T::AccountId, mpower: u128, next_start_date: Date) -> Result { + // // Note: we DO need the following as we're using the current timestamp, rather than a function parameter. + // let timestamp: ::Moment = >::get(); + // let requested_date_as_u64 = Self::convert_moment_to_u64_in_milliseconds(timestamp.clone())?; + // log::info!("set_mpower_of_account_for_date - requested_date_as_u64: {:?}", requested_date_as_u64.clone()); + + // convert the requested date/time to the start of that day date/time to signify that date for lookup + // i.e. 21 Apr @ 1420 -> 21 Apr @ 0000 + let start_of_next_start_date_millis = Self::convert_i64_in_milliseconds_to_start_of_date(next_start_date.clone())?; + + let mpower_current_u128 = mpower.clone(); + + // Update storage. Override the default that may have been set in on_initialize + >::insert( + ( + start_of_next_start_date_millis.clone(), + account_id.clone(), + ), + mpower_current_u128.clone(), + ); + log::info!("set_mpower_of_account_for_date - start_of_next_start_date_millis: {:?}", &start_of_next_start_date_millis); + log::info!("set_mpower_of_account_for_date - account_id: {:?}", &account_id); + log::info!("set_mpower_of_account_for_date - mpower_current: {:?}", &mpower_current_u128); + + // Emit an event. + Self::deposit_event(Event::SetMPowerOfAccountForDateStored( + start_of_next_start_date_millis.clone(), + mpower_current_u128.clone(), + account_id.clone(), + )); + + // Return a successful DispatchResultWithPostInfo + Ok(mpower_current_u128.clone()) + } + + fn get_min_bonded_dhx_daily() -> Result<(BalanceOf, u128), DispatchError> { + let mut min_bonded_dhx_daily: BalanceOf = 10u32.into(); // initialize + let mut min_bonded_dhx_daily_u128: u128 = TEN; + if let Some(_min_bonded_dhx_daily) = >::get() { + min_bonded_dhx_daily = _min_bonded_dhx_daily; + + let _min_bonded_dhx_daily_u128 = Self::convert_balance_to_u128(min_bonded_dhx_daily.clone()); + match _min_bonded_dhx_daily_u128.clone() { + Err(_e) => { + log::error!("Unable to convert balance to u128 for min_bonded_dhx_daily_u128"); + return Err(DispatchError::Other("Unable to convert balance to u128 for min_bonded_dhx_daily_u128")); + }, + Ok(x) => { + min_bonded_dhx_daily_u128 = x; + } + } + } else { + // fetch the min_bonded_dhx_daily_default instead as a fallback + log::error!("Unable to retrieve any min. bonded DHX daily"); + + let mut min_bonded_dhx_daily_default: BalanceOf = 10u32.into(); + + let _min_bonded_dhx_daily_default = Self::get_min_bonded_dhx_daily_default(); + match _min_bonded_dhx_daily_default { + Err(_e) => { + log::error!("Unable to retrieve any min. bonded DHX daily default as BalanceOf and u128"); + }, + Ok(ref x) => { + // Set the min. bonded DHX daily to the default value as fallback + min_bonded_dhx_daily = x.0; + min_bonded_dhx_daily_u128 = x.1; + } + } + // println!("Reset to the min. bonded DHX daily default"); + } + // Return a successful DispatchResultWithPostInfo + Ok( + (min_bonded_dhx_daily.clone(), min_bonded_dhx_daily_u128.clone()) + ) + } + + fn get_min_bonded_dhx_daily_default() -> Result<(BalanceOf, u128), DispatchError> { + let mut min_bonded_dhx_daily_default: BalanceOf = 10u32.into(); // initialize + if let Some(_min_bonded_dhx_daily_default) = >::get() { + min_bonded_dhx_daily_default = _min_bonded_dhx_daily_default; + } else { + // TODO - if this fails we could try and fetch the min_bonded_dhx_daily_default instead as a fallback + log::error!("Unable to retrieve any min. bonded DHX daily default"); + // return Err(DispatchError::Other("Unable to retrieve any min. bonded DHX daily default")); + } + + let min_bonded_dhx_daily_default_u128; + let _min_bonded_dhx_daily_default_u128 = Self::convert_balance_to_u128(min_bonded_dhx_daily_default.clone()); + match _min_bonded_dhx_daily_default_u128.clone() { + Err(_e) => { + log::error!("Unable to convert balance to u128 for min_bonded_dhx_daily_default_u128"); + return Err(DispatchError::Other("Unable to convert balance to u128 for min_bonded_dhx_daily_default_u128")); + }, + Ok(x) => { + min_bonded_dhx_daily_default_u128 = x; + } + } + // Return a successful DispatchResultWithPostInfo + Ok( + (min_bonded_dhx_daily_default.clone(), min_bonded_dhx_daily_default_u128.clone()) + ) + } + + pub fn change_rewards_multiplier_paused_status(new_status: bool) -> Result { + + >::put(new_status.clone()); + + // Emit an event. + Self::deposit_event(Event::ChangeRewardsMultiplierPausedStatusStored( + new_status.clone(), + )); + + // Return a successful DispatchResultWithPostInfo + Ok(new_status.clone()) + } + + pub fn change_rewards_multiplier_reset_status(new_status: bool) -> Result { + + >::put(new_status.clone()); + + // Emit an event. + Self::deposit_event(Event::ChangeRewardsMultiplierResetStatusStored( + new_status.clone(), + )); + + // Return a successful DispatchResultWithPostInfo + Ok(new_status.clone()) + } + } +} diff --git a/pallets/mining/rewards-allowance/src/mock.rs b/pallets/mining/rewards-allowance/src/mock.rs new file mode 100644 index 000000000..b9a2ec4b4 --- /dev/null +++ b/pallets/mining/rewards-allowance/src/mock.rs @@ -0,0 +1,523 @@ +// Creating mock runtime here +use crate as mining_rewards_allowance; +use crate::{ + Config as MiningRewardsAllowanceConfig, +}; +use frame_support::{ + parameter_types, + traits::{ + ContainsLengthBound, + GenesisBuild, + LockIdentifier, + SortedMembers, + }, + weights::{ + IdentityFee, + Weight, + }, + PalletId, +}; +use frame_system::{ + EnsureOneOf, + EnsureRoot, +}; +use pallet_democracy::{self, Conviction, Vote}; +use sp_core::{ + H256, + u32_trait::{ + _1, + _2, + _3, + _4, + }, +}; +use codec::{ + Decode, + Encode, +}; +use sp_consensus_aura::sr25519::AuthorityId as AuraId; +use sp_runtime::{ + testing::Header, + traits::{ + BlakeTwo256, + IdentityLookup, + }, + Perbill, + Percent, + Permill, +}; +use std::cell::RefCell; +use static_assertions::const_assert; +pub use module_primitives::{ + constants::currency::{ + // CENTS, // Use override below + deposit, + // DOLLARS, // Use override below + // MILLICENTS, // Use override below + }, + constants::time::{ + // DAYS, // Use override below + SLOT_DURATION, + // MINUTES, // Use override below + }, + types::{ + // AccountId, // Use override below + Balance, + BlockNumber, + Index, + Moment, + }, +}; +// use super::*; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Aura: pallet_aura::{Pallet, Config}, + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, + Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event}, + Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config}, + TechnicalCommittee: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config}, + Elections: pallet_elections_phragmen::{Pallet, Call, Storage, Event, Config}, + TechnicalMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config}, + Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, + Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event}, + Bounties: pallet_bounties::{Pallet, Call, Storage, Event}, + Tips: pallet_tips::{Pallet, Call, Storage, Event}, + MiningRewardsAllowanceTestModule: mining_rewards_allowance::{Pallet, Call, Storage, Config, Event}, + } +); + +// Override primitives +pub type AccountId = u128; +// pub type SysEvent = frame_system::Event; + +pub const MILLISECS_PER_BLOCK: Moment = 4320; +pub const MILLICENTS: Balance = 1_000_000_000; +pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent. +pub const DOLLARS: Balance = 100 * CENTS; +pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); +pub const HOURS: BlockNumber = MINUTES * 60; +pub const DAYS: BlockNumber = HOURS * 24; + +// from Substrate pallet_democracy tests +pub const AYE: Vote = Vote { aye: true, conviction: Conviction::None }; +pub const NAY: Vote = Vote { aye: false, conviction: Conviction::None }; + +parameter_types! { + pub const BlockHashCount: BlockNumber = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(2_000_000_000_000); +} +impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Call = Call; + type Index = Index; + type BlockNumber = BlockNumber; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; // u64 is not enough to hold bytes used to generate bounty account + type Lookup = IdentityLookup; + type Header = sp_runtime::generic::Header; + type Event = (); + type BlockHashCount = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); +} +impl pallet_randomness_collective_flip::Config for Test {} + +parameter_types! { + pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * BlockWeights::get().max_block; + pub const MaxScheduledPerBlock: u32 = 50; +} + +impl pallet_scheduler::Config for Test { + type Event = (); + type Origin = Origin; + type PalletsOrigin = OriginCaller; + type Call = Call; + type MaximumWeight = MaximumSchedulerWeight; + type ScheduleOrigin = EnsureRoot; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type WeightInfo = (); +} + +impl pallet_aura::Config for Test { + type AuthorityId = AuraId; + type DisabledValidators = (); +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 1; +} +parameter_types! { + pub const MinimumPeriod: u64 = SLOT_DURATION / 2; +} +impl pallet_timestamp::Config for Test { + type MinimumPeriod = MinimumPeriod; + /// A timestamp: milliseconds since the unix epoch. + type Moment = Moment; + type OnTimestampSet = Aura; + type WeightInfo = (); +} +impl pallet_balances::Config for Test { + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type Balance = Balance; + type DustRemoval = (); + type Event = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = frame_system::Pallet; + type WeightInfo = (); +} +parameter_types! { + pub const TransactionByteFee: Balance = 1; +} +impl pallet_transaction_payment::Config for Test { + type FeeMultiplierUpdate = (); + type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; + type TransactionByteFee = TransactionByteFee; + type WeightToFee = IdentityFee; +} + +parameter_types! { + pub const CouncilMotionDuration: BlockNumber = 5 * DAYS; + pub const CouncilMaxProposals: u32 = 100; + pub const CouncilMaxMembers: u32 = 100; +} + +type CouncilCollective = pallet_collective::Instance1; +impl pallet_collective::Config for Test { + type Origin = Origin; + type Proposal = Call; + type Event = (); + type MotionDuration = CouncilMotionDuration; + type MaxProposals = CouncilMaxProposals; + type MaxMembers = CouncilMaxMembers; + type DefaultVote = pallet_collective::PrimeDefaultVote; + type WeightInfo = pallet_collective::weights::SubstrateWeight; +} + +parameter_types! { + pub const CandidacyBond: Balance = 10 * DOLLARS; + // 1 storage item created, key size is 32 bytes, value size is 16+16. + pub const VotingBondBase: Balance = 1; + // additional data per vote is 32 bytes (account id). + pub const VotingBondFactor: Balance = 1; + pub const TermDuration: BlockNumber = 7 * DAYS; + // Check chain_spec. This value should be greater than or equal to the amount of + // endowed accounts that are added to election_phragmen + pub const DesiredMembers: u32 = 62; // validators 1-10 + sudo + treasury + pub const DesiredRunnersUp: u32 = 7; + pub const ElectionsPhragmenPalletId: LockIdentifier = *b"phrelect"; +} + +// Make sure that there are no more than `MaxMembers` members elected via elections-phragmen. +const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get()); + +impl pallet_elections_phragmen::Config for Test { + type Event = (); + type PalletId = ElectionsPhragmenPalletId; + type Currency = Balances; + type ChangeMembers = Council; + // NOTE: this implies that council's genesis members cannot be set directly and must come from + // this module. + type InitializeMembers = Council; + type CurrencyToVote = frame_support::traits::SaturatingCurrencyToVote; + type CandidacyBond = CandidacyBond; + type VotingBondBase = VotingBondBase; + type VotingBondFactor = VotingBondFactor; + type LoserCandidate = (); + type KickedMember = (); + type DesiredMembers = DesiredMembers; + type DesiredRunnersUp = DesiredRunnersUp; + type TermDuration = TermDuration; + type WeightInfo = pallet_elections_phragmen::weights::SubstrateWeight; +} + +parameter_types! { + pub const TechnicalMotionDuration: BlockNumber = 5 * DAYS; + pub const TechnicalMaxProposals: u32 = 100; + pub const TechnicalMaxMembers: u32 = 100; +} + +type TechnicalCollective = pallet_collective::Instance2; +impl pallet_collective::Config for Test { + type Origin = Origin; + type Proposal = Call; + type Event = (); + type MotionDuration = TechnicalMotionDuration; + type MaxProposals = TechnicalMaxProposals; + type MaxMembers = TechnicalMaxMembers; + type DefaultVote = pallet_collective::PrimeDefaultVote; + type WeightInfo = pallet_collective::weights::SubstrateWeight; +} + +type EnsureRootOrHalfCouncil = EnsureOneOf< + AccountId, + EnsureRoot, + pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>, +>; +impl pallet_membership::Config for Test { + type Event = (); + type AddOrigin = EnsureRootOrHalfCouncil; + type RemoveOrigin = EnsureRootOrHalfCouncil; + type SwapOrigin = EnsureRootOrHalfCouncil; + type ResetOrigin = EnsureRootOrHalfCouncil; + type PrimeOrigin = EnsureRootOrHalfCouncil; + type MembershipInitialized = TechnicalCommittee; + type MembershipChanged = TechnicalCommittee; + type MaxMembers = TechnicalMaxMembers; + type WeightInfo = pallet_membership::weights::SubstrateWeight; +} + +thread_local! { + static TEN_TO_FOURTEEN: RefCell> = RefCell::new(vec![10,11,12,13,14]); +} +pub struct TenToFourteen; +impl SortedMembers for TenToFourteen { + fn sorted_members() -> Vec { + TEN_TO_FOURTEEN.with(|v| v.borrow().clone()) + } + + #[cfg(feature = "runtime-benchmarks")] + fn add(new: &u128) { + TEN_TO_FOURTEEN.with(|v| { + let mut members = v.borrow_mut(); + members.push(*new); + members.sort(); + }) + } +} +impl ContainsLengthBound for TenToFourteen { + fn max_len() -> usize { + TEN_TO_FOURTEEN.with(|v| v.borrow().len()) + } + + fn min_len() -> usize { + 0 + } +} + +parameter_types! { + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const ProposalBondMinimum: Balance = 1_000_000_000_000_000_000; + pub const SpendPeriod: BlockNumber = 1 * DAYS; + pub const Burn: Permill = Permill::from_percent(0); + pub const TipCountdown: BlockNumber = 1; + pub const TipFindersFee: Percent = Percent::from_percent(20); + pub const TipReportDepositBase: Balance = 1_000_000_000_000_000_000; + pub const DataDepositPerByte: Balance = 1; + pub const BountyDepositBase: Balance = 80; + pub const BountyDepositPayoutDelay: u32 = 3; + pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + pub const BountyUpdatePeriod: u32 = 20; + pub const MaximumReasonLength: u32 = 16384; + pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); + pub const BountyValueMinimum: Balance = 1; + pub const MaxApprovals: u32 = 100; +} + +impl pallet_treasury::Config for Test { + type PalletId = TreasuryPalletId; + type Currency = Balances; + type ApproveOrigin = EnsureRoot; + type RejectOrigin = EnsureRoot; + type Event = (); + type OnSlash = (); + type ProposalBond = ProposalBond; + type ProposalBondMinimum = ProposalBondMinimum; + type SpendPeriod = SpendPeriod; + type Burn = Burn; + type BurnDestination = (); + type SpendFunds = Bounties; + type WeightInfo = pallet_treasury::weights::SubstrateWeight; + type MaxApprovals = MaxApprovals; +} + +impl pallet_bounties::Config for Test { + type Event = (); + type BountyDepositBase = BountyDepositBase; + type BountyDepositPayoutDelay = BountyDepositPayoutDelay; + type BountyUpdatePeriod = BountyUpdatePeriod; + type BountyCuratorDeposit = BountyCuratorDeposit; + type BountyValueMinimum = BountyValueMinimum; + type DataDepositPerByte = DataDepositPerByte; + type MaximumReasonLength = MaximumReasonLength; + type WeightInfo = pallet_bounties::weights::SubstrateWeight; +} + +impl pallet_tips::Config for Test { + type Event = (); + type DataDepositPerByte = DataDepositPerByte; + type MaximumReasonLength = MaximumReasonLength; + type Tippers = TenToFourteen; + type TipCountdown = TipCountdown; + type TipFindersFee = TipFindersFee; + type TipReportDepositBase = TipReportDepositBase; + type WeightInfo = pallet_tips::weights::SubstrateWeight; +} + +parameter_types! { + pub const LaunchPeriod: BlockNumber = 1 * MINUTES; + pub const VotingPeriod: BlockNumber = 1 * MINUTES; + pub const FastTrackVotingPeriod: BlockNumber = 1 * MINUTES; + pub const InstantAllowed: bool = true; + pub const MinimumDeposit: Balance = 1 * DOLLARS; + pub const EnactmentPeriod: BlockNumber = 1 * MINUTES; + pub const CooloffPeriod: BlockNumber = 1 * MINUTES; + // One cent: $10,000 / MB + pub const PreimageByteDeposit: Balance = 1 * CENTS; + pub const MaxVotes: u32 = 100; + pub const MaxProposals: u32 = 100; +} + +impl pallet_democracy::Config for Test { + type Proposal = Call; + type Event = (); + type Currency = Balances; + type EnactmentPeriod = EnactmentPeriod; + type LaunchPeriod = LaunchPeriod; + type VotingPeriod = VotingPeriod; + type MinimumDeposit = MinimumDeposit; + /// A straight majority of the council can decide what their next motion is. + type ExternalOrigin = pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; + /// A super-majority can have the next scheduled referendum be a straight majority-carries vote. + type ExternalMajorityOrigin = pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>; + /// A unanimous council can have the next scheduled referendum be a straight default-carries + /// (NTB) vote. + type ExternalDefaultOrigin = pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>; + /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote + /// be tabled immediately and with a shorter voting/enactment period. + type FastTrackOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>; + type InstantOrigin = pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>; + type InstantAllowed = InstantAllowed; + type FastTrackVotingPeriod = FastTrackVotingPeriod; + // To cancel a proposal which has been passed, 2/3 of the council must agree to it. + type CancellationOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>; + // To cancel a proposal before it has been passed, the technical committee must be unanimous or + // Root must agree. + type CancelProposalOrigin = EnsureOneOf< + AccountId, + EnsureRoot, + pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, + >; + type BlacklistOrigin = EnsureRoot; + // Any single technical committee member may veto a coming council proposal, however they can + // only do it once and it lasts only for the cooloff period. + type VetoOrigin = pallet_collective::EnsureMember; + type CooloffPeriod = CooloffPeriod; + type PreimageByteDeposit = PreimageByteDeposit; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; + type Slash = Treasury; + type Scheduler = Scheduler; + type PalletsOrigin = OriginCaller; + type MaxVotes = MaxVotes; + type WeightInfo = (); + type MaxProposals = MaxProposals; +} + +impl MiningRewardsAllowanceConfig for Test { + type Event = (); + type Currency = Balances; +} + +pub type SysEvent = frame_system::Event; +pub type DemocracyEvent = pallet_democracy::Event; + +pub const INIT_DAO_BALANCE_DHX: u128 = 30_000_000_000_000_000_000_000_000u128; +pub const TOTAL_SUPPLY_DHX: u128 = 100_000_000_000_000_000_000_000_000u128; +pub const TEN_DHX: u128 = 10_000_000_000_000_000_000u128; +pub const FIVE_THOUSAND_DHX: u128 = 5_000_000_000_000_000_000_000_u128; // 5000 + +// This function basically just builds a genesis storage key/value store according to +// our desired mockup. +pub fn new_test_ext() -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + + // note: this approach is necessary to be able to mock the values in the chain specification. + // for each of the pallets used. + // see https://github.com/kaichaosun/substrate-node-template/commit/f83493c8a24b5b470d039ceeaf2cde949859855a + GenesisBuild::::assimilate_storage( + &pallet_balances::GenesisConfig { + balances: vec![ + (0, TEN_DHX), + (1, TEN_DHX), + (2, TEN_DHX), + (3, TEN_DHX), + (100, TOTAL_SUPPLY_DHX), + ], + }, + &mut t + ) + .unwrap(); + + GenesisBuild::::assimilate_storage( + &mining_rewards_allowance::GenesisConfig { + rewards_allowance_dhx_daily: FIVE_THOUSAND_DHX, // 5000 DHX + rewards_allowance_dhx_for_date_remaining: Default::default(), + rewards_allowance_dhx_for_date_remaining_distributed: Default::default(), + rewards_multiplier_paused: false, + rewards_multiplier_reset: false, + rewards_multiplier_default_change: 10u32, + rewards_multiplier_next_change: 10u32, + rewards_multiplier_default_period_days: 90u32, + rewards_multiplier_next_period_days: 90u32, + rewards_multiplier_current_change: 10u32, + rewards_multiplier_current_period_days_total: 90u32, + rewards_multiplier_current_period_days_remaining: Default::default(), + rewards_multiplier_operation: 1u8, + // Note: i'm not sure how to mock Alice, Bob, Charlie, just set in implementation at genesis + // registered_dhx_miners: vec![ + // get_account_id_from_seed::("Alice"), + // get_account_id_from_seed::("Bob"), + // get_account_id_from_seed::("Charlie"), + // ], + registered_dhx_miners: Default::default(), + rewards_aggregated_dhx_for_all_miners_for_date: Default::default(), + rewards_accumulated_dhx_for_miner_for_date: Default::default(), + min_bonded_dhx_daily: TEN_DHX, // 10 DHX + min_bonded_dhx_daily_default: TEN_DHX, // 10 DHX + min_mpower_daily: 5u128, + min_mpower_daily_default: 5u128, + cooling_off_period_days: 7u32, + // Note: i'm not sure how to mock Alice, just set in implementation at genesis + // cooling_off_period_days_remaining: vec![ + // ( + // get_account_id_from_seed::("Alice"), + // ( + // 0, + // 7u32, + // 0u32, + // ), + // ), + // ], + cooling_off_period_days_remaining: Default::default(), + }, + &mut t + ) + .unwrap(); + + t.into() +} diff --git a/pallets/mining/rewards-allowance/src/tests.rs b/pallets/mining/rewards-allowance/src/tests.rs new file mode 100644 index 000000000..70f0f0e4a --- /dev/null +++ b/pallets/mining/rewards-allowance/src/tests.rs @@ -0,0 +1,799 @@ +use super::{Call, Event, *}; +use crate::{mock::*, Error}; +pub use mock::{INIT_DAO_BALANCE_DHX, TOTAL_SUPPLY_DHX, TEN_DHX, FIVE_THOUSAND_DHX}; +use codec::Encode; +use frame_support::{assert_noop, assert_ok, + weights::{DispatchClass, DispatchInfo, GetDispatchInfo}, + traits::{OnFinalize, OnInitialize}, +}; +use frame_system::{self, AccountInfo, EventRecord, Phase, RawOrigin}; +use pallet_balances::{self, BalanceLock, Reasons}; +use pallet_democracy::{self, AccountVote, ReferendumStatus, Tally, VoteThreshold}; +use sp_core::{ + H256, + Hasher, // so we may use BlakeTwo256::hash +}; +use sp_runtime::{ + traits::{BlakeTwo256}, +}; + +const NORMAL_AMOUNT: u128 = 25_133_000_000_000_000_000_000u128; // 25,133 DHX +const LARGE_AMOUNT_DHX: u128 = 33_333_333_333_000_000_000_000_000u128; // 33,333,333.333 DHX +const TWO_THOUSAND_DHX: u128 = 2_000_000_000_000_000_000_000_u128; // 2,000 +const FIVE_HUNDRED_DHX: u128 = 500_000_000_000_000_000_000_u128; // 500 +const THIRTY_DHX: u128 = 30_000_000_000_000_000_000_u128; // 30 +const TWENTY_DHX: u128 = 20_000_000_000_000_000_000_u128; // 20 +const TWO_DHX: u128 = 2_000_000_000_000_000_000_u128; // 2 + +#[test] +// ignore this test until the FIXME is resolved +#[ignore] +fn it_sets_rewards_allowance_with_genesis_defaults_automatically_in_on_finalize_if_not_already_set_for_today() { + new_test_ext().execute_with(|| { + assert_ok!(MiningRewardsAllowanceTestModule::set_registered_dhx_miner(Origin::signed(1))); + assert_ok!(MiningRewardsAllowanceTestModule::set_registered_dhx_miner(Origin::signed(2))); + assert_ok!(MiningRewardsAllowanceTestModule::set_registered_dhx_miner(Origin::signed(3))); + + // 27th August 2021 @ ~7am is 1630049371000 + // where milliseconds/day 86400000 + // 27th August 2021 @ 12am is 1630022400000 (start of day) + Timestamp::set_timestamp(1630049371000u64); + + MiningRewardsAllowanceTestModule::on_initialize(1); + + // FIXME - why doesn't this work and use the defaults that we have set in the genesis config? + // i've had to add a function `set_rewards_allowance_dhx_daily` to set this instead + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_daily(), Some(FIVE_THOUSAND_DHX)); + }) +} + +#[test] +// Note: if we remove `cooling_off_period_days_remaining.0 != start_of_requested_date_millis.clone() &&` +// four times from the implementation, then all this happens on the same day so we'd need to use the +// same timestamp for all the blocks and tests below. +fn it_distributes_rewards_automatically_in_on_finalize_for_default_amount() { + new_test_ext().execute_with(|| { + let amount_mpower_each_miner = 5u128; + let min_mpower_daily = 5u128; + + setup_min_mpower_daily(min_mpower_daily); + + let r = setup_bonding(NORMAL_AMOUNT, TEN_DHX); + + setup_treasury_balance(); + + setup_multiplier(); + + distribute_rewards(NORMAL_AMOUNT, amount_mpower_each_miner, r); + }) +} + +#[test] +fn it_distributes_rewards_automatically_in_on_finalize_for_large_amount() { + new_test_ext().execute_with(|| { + let amount_mpower_each_miner = 5u128; + let min_mpower_daily = 5u128; + + setup_min_mpower_daily(min_mpower_daily); + + let r = setup_bonding(LARGE_AMOUNT_DHX, TEN_DHX); + + setup_treasury_balance(); + + setup_multiplier(); + + distribute_rewards(LARGE_AMOUNT_DHX, amount_mpower_each_miner, r); + }) +} + +#[test] +fn it_sets_rewards_allowance_with_timestamp() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + + // 27th August 2021 @ ~7am is 1630049371000 + // where milliseconds/day 86400000 + // 27th August 2021 @ 12am is 1630022400000 (start of day) + Timestamp::set_timestamp(1630049371000u64); + + assert_ok!(MiningRewardsAllowanceTestModule::set_rewards_allowance_dhx_daily( + Origin::signed(0), + FIVE_THOUSAND_DHX + )); + + assert_ok!(MiningRewardsAllowanceTestModule::set_rewards_allowance_dhx_for_date_remaining( + Origin::signed(0), + FIVE_THOUSAND_DHX, + 1630049371000 + )); + + // Verify Storage + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_daily(), Some(FIVE_THOUSAND_DHX)); + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1630022400000), Some(FIVE_THOUSAND_DHX)); + + assert_ok!(MiningRewardsAllowanceTestModule::change_rewards_allowance_dhx_for_date_remaining( + Origin::signed(0), + FIVE_HUNDRED_DHX, + 1630049371000, + 0 + )); + + // reducing the remaining rewards for a specific date does not change the default rewards allowance + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_daily(), Some(FIVE_THOUSAND_DHX)); + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1630022400000), Some(4_500_000_000_000_000_000_000u128)); + + assert_ok!(MiningRewardsAllowanceTestModule::change_rewards_allowance_dhx_for_date_remaining( + Origin::signed(0), + TWO_THOUSAND_DHX, + 1630049371000, + 1 + )); + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1630022400000), Some(6_500_000_000_000_000_000_000u128)); + }) +} + +#[test] +fn setup_preimage() { + new_test_ext().execute_with(|| { + System::set_block_number(0); + // pre-image byte deposit with reasonable fee value of 1 + // PREIMAGE_BYTE_DEPOSIT.with(|v| *v.borrow_mut() = 1); + + // increase the balance of the account that is creating the pre-image hash + // so it may afford the minimum deposit and pre-image byte deposit + Balances::set_balance(Origin::root(), 1, 1_000_000_000_000_000, 0); + assert_eq!(Balances::free_balance(1), 1_000_000_000_000_000); + // register pre-image for upcoming proposal + let encoded_proposal_preimage = vec![0; 500]; + match Democracy::note_preimage(Origin::signed(1), encoded_proposal_preimage.clone()) { + Ok(_) => (), + Err(x) if x == Error::::DuplicatePreimage.into() => (), + Err(x) => panic!("Democracy::note_preimage error {:?}", x), + } + System::set_block_number(1); + + let event: SysEvent = SysEvent::NewAccount(32).into(); + let event_record: EventRecord<(), H256> = EventRecord { + phase: Phase::Initialization, + // we cannot do `event.clone() or it gives error: + // `expected `()`, found enum `frame_system::Event`` + event: (), + topics: vec![], + }; + let hash = sp_core::H256::default(); + // PreimageNoted: proposal_hash, who, deposit + let event2: DemocracyEvent = DemocracyEvent::PreimageNoted(hash.clone(), 1, 0); + System::deposit_event(event.clone()); + System::deposit_event(event2.clone()); + System::finalize(); + assert_eq!( + System::events(), + vec![ + event_record.clone(), + event_record.clone(), + ] + ); + // Note: We are just going to assume that the event `DemocracyEvent::PreimageNoted` + // emits a pre-image hash that we may then use to create a proposal with. + let pre_image_hash = BlakeTwo256::hash(b"test"); + // let pre_image = >::take(&proposal_hash); + + // add a public proposal with a proposal pre-image hash (with a required deposit) + // to the proposal queue prior to it becoming a referendum + // + // since we've configured MinimumDeposit to be 100 * DOLLARS, which is 100_000_000_000_000, + // we need to deposit at least that much otherwise we get error `ValueLow` + match Democracy::propose(Origin::signed(1), pre_image_hash.clone(), 100_000_000_000_000) { + Ok(_) => (), + Err(x) => panic!(" Democracy::propose error {:?}", x), + } + + System::set_block_number(2); + Democracy::note_imminent_preimage(Origin::signed(1), encoded_proposal_preimage.clone()); + let public_prop_count = Democracy::public_prop_count(); + assert_eq!(public_prop_count, 1); + // check if a lock exists on an account until a block in the future. there shouldn't be any yet + let locks_until_block_for_account = Democracy::locks(1); + assert_eq!(locks_until_block_for_account, None); + // second the proposals + assert_ok!(Democracy::second(Origin::signed(1), 0, u32::MAX)); + System::set_block_number(3); + // check the deposits made on a proposal index + let deposits = Democracy::deposit_of(0).ok_or("Proposal not created").unwrap(); + assert_eq!(deposits.0.len(), 2 as usize, "Seconds not recorded"); + + // check for info about referendums. there shouldn't be any yet. + let referendum_count = Democracy::referendum_count(); + assert_eq!(referendum_count, 0); + // info about a referendum index + let referendum_info_1 = Democracy::referendum_info(0); + assert_eq!(referendum_info_1, None); + + // we have 4.32 seconds per block, with a launch period of 672 hours, + // so there are 10450944 blocks in the launch period before the the + // public and external proposals take turns becoming a referendum + System::set_block_number(11_000_000); + + // Note: Unfortunately we cannot use `Democracy::referendum_status` since it's a + // private function if don't fork Substrate and modify the Democracy module + + // in fork DataHighway-DHX/substrate, branch luke/democracy, + // commit 527101517d0ad67780131def8d227de51e503a89 + // we made this `inject_referendum` a public function + let r = Democracy::inject_referendum( + 11_000_020, + pre_image_hash.clone(), + VoteThreshold::SuperMajorityApprove, + 2, + ); + + assert!(Democracy::referendum_status(r).is_ok()); + + // wait for referendums to be launched from the proposals after the launch period + // external proposal becomes referendum first then public proposals + assert_eq!( + // in fork DataHighway-DHX/substrate, branch luke/democracy, + // commit 527101517d0ad67780131def8d227de51e503a89 + // we made this `referendum_status` a public function + Democracy::referendum_status(0), + Ok(ReferendumStatus { + end: 11_000_020, // block when voting on referendum ends + proposal_hash: pre_image_hash.clone(), + threshold: VoteThreshold::SuperMajorityApprove, + delay: 2, + tally: Tally { ayes: 0, nays: 0, turnout: 0 }, + }) + ); + + System::set_block_number(11_000_001); + // end of voting on referendum + System::set_block_number(11_000_050); + // vote on referenda using time-lock voting with a conviction to scale the vote power + // note: second parameter is the referendum index being voted on + assert_ok!(Democracy::vote( + Origin::signed(1), + 0, + // aye(1), // cannot use aye(..) from Substrate pallet_democracy + // since functions used as tests cannot have any arguments + AccountVote::Standard { vote: AYE, balance: Balances::free_balance(1) }, + )); + assert_eq!(Democracy::referendum_status(r).unwrap().tally, Tally { ayes: 30000000000000, nays: 0, turnout: 300000000000000 }); + assert_eq!(Balances::locks(1)[0], + BalanceLock { + id: [100, 101, 109, 111, 99, 114, 97, 99], + amount: 300000000000000, + reasons: Reasons::Misc + } + ); + }); +} + +#[test] +fn it_sets_min_mpower_daily() { + new_test_ext().execute_with(|| { + assert_ok!(MiningRewardsAllowanceTestModule::set_min_mpower_daily( + Origin::signed(1), + 5u128, + )); + }); +} + +#[test] +#[ignore] +fn it_allows_us_to_retrieve_genesis_value_for_min_mpower_daily() { + new_test_ext().execute_with(|| { + // FIXME - why doesn't it set the values we added in the chain_spec.rs at genesis + // https://matrix.to/#/!HzySYSaIhtyWrwiwEV:matrix.org/$163424903366086IiiUH:matrix.org?via=matrix.parity.io&via=corepaper.org&via=matrix.org + MiningRewardsAllowanceTestModule::on_initialize(1); + assert_eq!(MiningRewardsAllowanceTestModule::min_mpower_daily(), Some(5u128)); + }); +} + +fn distribute_rewards(amount_bonded_each_miner: u128, amount_mpower_each_miner: u128, referendum_index: u32) { + assert_ok!(MiningRewardsAllowanceTestModule::set_registered_dhx_miner(Origin::signed(1))); + assert_ok!(MiningRewardsAllowanceTestModule::set_registered_dhx_miner(Origin::signed(2))); + assert_ok!(MiningRewardsAllowanceTestModule::set_registered_dhx_miner(Origin::signed(3))); + + assert_ok!(MiningRewardsAllowanceTestModule::set_cooling_off_period_days( + Origin::signed(1), + 1_u32, // debug quickly for testing + )); + assert_ok!(MiningRewardsAllowanceTestModule::set_rewards_allowance_dhx_daily( + Origin::signed(1), + FIVE_THOUSAND_DHX, + )); + + assert_eq!(MiningRewardsAllowanceTestModule::registered_dhx_miners(), Some(vec![1, 2, 3])); + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days(), Some(1)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_daily(), Some(FIVE_THOUSAND_DHX)); + + check_eligible_for_rewards_after_cooling_off_period_if_suffient_bonded(amount_bonded_each_miner.clone(), amount_mpower_each_miner.clone()); + + // check that rewards multiplier increases by multiplier every period days and that days total and remaining are reset + check_rewards_double_each_multiplier_period(amount_mpower_each_miner.clone()); + + // check that after the multiplier doubles, they are no longer eligible to receive the rewards + // if they have the same amount bonded (since they’d then need twice the amount bonded as ratio changes from 10:1 to 20:1), + // even if they have sufficient mpower + check_ineligible_for_rewards_and_cooling_down_period_starts_if_insufficient_bonded(amount_bonded_each_miner.clone(), amount_mpower_each_miner.clone(), referendum_index.clone()); +} + +fn setup_min_mpower_daily(min_mpower_daily: u128) { + assert_ok!(MiningRewardsAllowanceTestModule::set_min_mpower_daily( + Origin::signed(1), + min_mpower_daily.clone(), + )); + assert_eq!(MiningRewardsAllowanceTestModule::min_mpower_daily(), Some(min_mpower_daily.clone())); +} + +// we have to get their mpower the day before we check if they are eligible incase there are delays in getting the off-chain data +fn change_mpower_for_each_miner(amount_mpower_each_miner: u128, next_start_date: i64) { + assert_ok!(MiningRewardsAllowanceTestModule::set_mpower_of_account_for_date(1, amount_mpower_each_miner.clone(), next_start_date)); + assert_ok!(MiningRewardsAllowanceTestModule::set_mpower_of_account_for_date(2, amount_mpower_each_miner.clone(), next_start_date)); + assert_ok!(MiningRewardsAllowanceTestModule::set_mpower_of_account_for_date(3, amount_mpower_each_miner.clone(), next_start_date)); + assert_eq!( + MiningRewardsAllowanceTestModule::mpower_of_account_for_date((next_start_date, 1)), + Some(amount_mpower_each_miner.clone()) + ); + assert_eq!( + MiningRewardsAllowanceTestModule::mpower_of_account_for_date((next_start_date, 2)), + Some(amount_mpower_each_miner.clone()) + ); + assert_eq!( + MiningRewardsAllowanceTestModule::mpower_of_account_for_date((next_start_date, 3)), + Some(amount_mpower_each_miner.clone()) + ); +} + +fn setup_bonding(amount_bonded_each_miner: u128, min_bonding_dhx_daily: u128) -> u32 { + assert_ok!(MiningRewardsAllowanceTestModule::set_min_bonded_dhx_daily( + Origin::signed(1), + min_bonding_dhx_daily.clone(), + )); + assert_eq!(MiningRewardsAllowanceTestModule::min_bonded_dhx_daily(), Some(min_bonding_dhx_daily.clone())); + + // create a test that instead of using a hard-coded value for `locks_first_amount_as_u128` + // that is in the implementation, it instead sets the locked value of each of them using frame_balances + // for the 3x miners, since we can then store that with `set_bonded_dhx_of_account_for_date` and + // then use that easier for the tests too for trying different values that they have bonded. + // + // in this test we'll test that it distributes rewards when each of their account balances are very large + // (i.e. a third of the total supply) ONE_THIRD_OF_TOTAL_SUPPLY_DHX + + assert_ok!(Balances::set_balance(Origin::root(), 1, amount_bonded_each_miner, 0)); + assert_ok!(Balances::set_balance(Origin::root(), 2, amount_bonded_each_miner, 0)); + assert_ok!(Balances::set_balance(Origin::root(), 3, amount_bonded_each_miner, 0)); + + assert_eq!(Balances::free_balance(&1), amount_bonded_each_miner); + assert_eq!(Balances::free_balance(&2), amount_bonded_each_miner); + assert_eq!(Balances::free_balance(&3), amount_bonded_each_miner); + + assert_eq!(Balances::reserved_balance(&1), 0); + + let pre_image_hash = BlakeTwo256::hash(b"test"); + // params: end block, proposal hash, threshold, delay + let r = Democracy::inject_referendum(1, pre_image_hash.clone(), VoteThreshold::SuperMajorityApprove, 2); + + bond_each_miner_by_voting_for_referendum(amount_bonded_each_miner, r); + + return r; +} + +fn setup_multiplier() { + assert_ok!(MiningRewardsAllowanceTestModule::set_rewards_multiplier_operation( + Origin::signed(0), + 1u8, + )); + + // in the tests we want the period between each 10:1, 20:1 cycle to be just 2 days instead of 90 days + // since we don't want to wait so long to check that it changes each cycle in the tests + assert_ok!(MiningRewardsAllowanceTestModule::set_rewards_multiplier_default_period_days( + Origin::signed(0), + 2u32, + )); + + assert_ok!(MiningRewardsAllowanceTestModule::set_rewards_multiplier_next_period_days( + Origin::signed(0), + 2u32, + )); +} + +fn setup_treasury_balance() { + // set the balance of the treasury so it distributes rewards + Balances::set_balance(Origin::root(), Treasury::account_id(), INIT_DAO_BALANCE_DHX, 0); + assert_eq!(Balances::usable_balance(&Treasury::account_id()), INIT_DAO_BALANCE_DHX); +} + +fn bond_each_miner_by_voting_for_referendum(amount_bonded_each_miner: u128, referendum_index: u32) { + // we're actually bonding with their entire account balance + let b1 = Balances::free_balance(&1); + let b2 = Balances::free_balance(&2); + let b3 = Balances::free_balance(&3); + + // lock the whole balance of account 1, 2, and 3 in voting + let v1a1 = AccountVote::Standard { vote: AYE, balance: b1.clone() }; + let v1a2 = AccountVote::Standard { vote: AYE, balance: b2.clone() }; + let v1a3 = AccountVote::Standard { vote: AYE, balance: b3.clone() }; + // vote on referenda using time-lock voting with a conviction to scale the vote power + // note: second parameter is the referendum index being voted on + assert_ok!(Democracy::vote(Origin::signed(1), referendum_index, v1a1)); + assert_ok!(Democracy::vote(Origin::signed(2), referendum_index, v1a2)); + assert_ok!(Democracy::vote(Origin::signed(3), referendum_index, v1a3)); + + assert_eq!(Balances::locks(1)[0], + BalanceLock { + id: [100, 101, 109, 111, 99, 114, 97, 99], + amount: b1.clone(), + reasons: Reasons::Misc + } + ); + assert_eq!(Balances::locks(2)[0], + BalanceLock { + id: [100, 101, 109, 111, 99, 114, 97, 99], + amount: b2.clone(), + reasons: Reasons::Misc + } + ); + assert_eq!(Balances::locks(3)[0], + BalanceLock { + id: [100, 101, 109, 111, 99, 114, 97, 99], + amount: b3.clone(), + reasons: Reasons::Misc + } + ); +} + +fn unbond_each_miner_by_removing_their_referendum_vote(referendum_index: u32) { + // remove the votes and then unlock for each account + // note: `remove_vote` must be done before `unlock` + assert_ok!(Democracy::remove_vote(Origin::signed(1), referendum_index)); + assert_ok!(Democracy::remove_vote(Origin::signed(2), referendum_index)); + assert_ok!(Democracy::remove_vote(Origin::signed(3), referendum_index)); + // we removed their votes + assert_eq!(Democracy::referendum_status(referendum_index).unwrap().tally, Tally { ayes: 0, nays: 0, turnout: 0 }); + assert_ok!(Democracy::unlock(Origin::signed(1), 1)); + assert_ok!(Democracy::unlock(Origin::signed(2), 2)); + assert_ok!(Democracy::unlock(Origin::signed(3), 3)); + + // check that all accounts are unlocked + assert_eq!(Balances::locks(1), vec![]); + assert_eq!(Balances::locks(2), vec![]); + assert_eq!(Balances::locks(3), vec![]); +} + +fn check_eligible_for_rewards_after_cooling_off_period_if_suffient_bonded(amount_bonded_each_miner: u128, amount_mpower_each_miner: u128) { + // since the timestamp is 0 (corresponds to 1970-01-01) at block number #1, we early exit from on_initialize in + // that block in the implementation and do not set any storage values associated with the date until block #2. + // in the tests we could set the timestamp before we run on_initialize(1), but that wouldn't reflect reality. + MiningRewardsAllowanceTestModule::on_initialize(1); + + // IMPORTANT: if we don't set the mpower for each miner for the current date beforehand, we won't be able to accumulate their rewards + // let's assume that we receive sufficient mpower and it's above the min. mpower, + // from off-chain on-time early enough on the same day so we have all other info we need + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630022400000i64); + + // 27th August 2021 @ ~7am is 1630049371000 + // where milliseconds/day 86400000 + // 27th August 2021 @ 12am is 1630022400000 (start of day) + Timestamp::set_timestamp(1630049371000u64); + MiningRewardsAllowanceTestModule::on_initialize(2); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1630022400000, 1630022400000, 2u32, 2u32))); + // System::on_initialize(2); + // System::on_finalize(2); + // System::set_block_number(2); + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1630022400000), Some(FIVE_THOUSAND_DHX)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining_distributed(1630022400000), Some(false)); + + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1635379200000i64); + + // https://www.epochconverter.com/ + // 28th August 2021 @ ~7am is 1635406274000 + // where milliseconds/day 86400000 + // 28th August 2021 @ 12am is 1635379200000 (start of day) + Timestamp::set_timestamp(1635406274000u64); + MiningRewardsAllowanceTestModule::on_initialize(3); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1630022400000, 1635379200000, 2u32, 1u32))); + + // check that on_initialize has populated this storage value automatically for the start of the current date + // still cooling off so no rewards distributed on this date + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1635379200000), Some(FIVE_THOUSAND_DHX)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining_distributed(1635379200000), Some(false)); + + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1635379200000, 1)), Some(amount_bonded_each_miner)); + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1635379200000, 2)), Some(amount_bonded_each_miner)); + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1635379200000, 3)), Some(amount_bonded_each_miner)); + + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630195200000i64); + + // 29th August 2021 @ ~7am is 1630220400000 + // 29th August 2021 @ 12am is 1630195200000 (start of day) + Timestamp::set_timestamp(1630195200000u64); + MiningRewardsAllowanceTestModule::on_initialize(4); + + // a day before we start the new multiplier period and change from 10:1 to 20:1 since no more days remaining + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1630022400000, 1630195200000, 2u32, 0u32))); + + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1630195200000, 1)), Some(amount_bonded_each_miner)); + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1630195200000, 2)), Some(amount_bonded_each_miner)); + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1630195200000, 3)), Some(amount_bonded_each_miner)); + + // i.e. for example, if locked is 25_133_000_000_000_000_000_000u128 (NORMAL_AMOUNT), which is 25,133 DHX, + // then with 10:1 each of the 3x accounts get 2513.3 DHX, which is ~7538.9 DHX combined + // or 33_333_333_333_000_000_000_000_000u128 (LARGE_AMOUNT_DHX), + // but the results are rounded to the nearest integer so it would be 2513 DHX, not 2513.3 DHX + if amount_bonded_each_miner.clone() == NORMAL_AMOUNT { + assert_eq!(MiningRewardsAllowanceTestModule::rewards_aggregated_dhx_for_all_miners_for_date(1630195200000), Some(7_539_000_000_000_000_000_000u128)); + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630195200000, 1)), Some(2_513_000_000_000_000_000_000u128)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630195200000, 2)), Some(2_513_000_000_000_000_000_000u128)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630195200000, 3)), Some(2_513_000_000_000_000_000_000u128)); + } else if amount_bonded_each_miner.clone() == LARGE_AMOUNT_DHX { + assert_eq!(MiningRewardsAllowanceTestModule::rewards_aggregated_dhx_for_all_miners_for_date(1630195200000), Some(9_999_999_000_000_000_000_000_000u128)); + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630195200000, 1)), Some(3_333_333_000_000_000_000_000_000u128)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630195200000, 2)), Some(3_333_333_000_000_000_000_000_000u128)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630195200000, 3)), Some(3_333_333_000_000_000_000_000_000u128)); + } + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1630195200000), Some(TWO_DHX)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining_distributed(1630195200000), Some(true)); + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630195200000, 0, 1))); + + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630281600000i64); + + // 30th August 2021 @ ~7am is 1630306800000 + // 30th August 2021 @ 12am is 1630281600000 (start of day) + Timestamp::set_timestamp(1630306800000u64); + MiningRewardsAllowanceTestModule::on_initialize(5); + + // we have finished the cooling off period and should now be distributing rewards each day unless they reduce their bonded + // amount below the min. bonded DHX daily amount + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630281600000, 0, 1))); + // check that the min_bonded_dhx_daily doubled after 3 months from 10 DHX to 20 DHX + assert_eq!(MiningRewardsAllowanceTestModule::min_bonded_dhx_daily(), Some(TWENTY_DHX)); + // the change between each multiplier period is 10 unless a user sets it to a different value + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_change(), Some(10u32)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_next_change(), Some(10u32)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_next_period_days(), Some(2u32)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_total(), Some(2u32)); + // start of new multiplier period + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1630281600000, 1630281600000, 2u32, 2u32))); + + // Note - these are just notes. no further action required + // Note - why is this 2u128 instead of reset back to say 5000u128 DHX (unless set do different value?? + // this should be reset after rewards aggregated/accumulated each day + // since distribution/claiming may not be done by a user each day + // Update: it gets reset but difficult to add a test, have to run the logs with only one test running to see it gets accumulated/aggregated + // to all miners each day over a few days + // assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1630281600000), Some(FIVE_THOUSAND_DHX)); + // Note - why is this 'true' when the day just started and nothing has been distributed? + // Update: difficult to add a test, check it works using the logs. they will be claiming rewards anyway, so we need separate tests for that + // assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining_distributed(1630281600000), Some(false)); + // Note - why haven't these been reset to 0u128 for the next day? + // Update: difficult to add a test to check they are reset before next day, just check it works using the logs. + // assert_eq!(MiningRewardsAllowanceTestModule::rewards_aggregated_dhx_for_all_miners_for_date(1630281600000), Some(0u128)); + // assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630281600000, 1)), Some(0u128)); +} + +fn check_rewards_double_each_multiplier_period(amount_mpower_each_miner: u128) { + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630368000000i64); + + // 31th August 2021 @ ~7am is 1630393200000 + // 31th August 2021 @ 12am is 1630368000000 (start of day) + Timestamp::set_timestamp(1630393200000u64); + MiningRewardsAllowanceTestModule::on_initialize(6); + // cooling off period doesn't change again unless they unbond + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630368000000, 0, 1))); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1630281600000, 1630368000000, 2u32, 1u32))); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_change(), Some(10u32)); + + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630454400000i64); + + // 1st Sept 2021 @ ~7am is 1630479600000 + // 1st Sept 2021 @ 12am is 1630454400000 (start of day) + Timestamp::set_timestamp(1630479600000u64); + MiningRewardsAllowanceTestModule::on_initialize(7); + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630454400000, 0, 1))); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1630281600000, 1630454400000, 2u32, 0u32))); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_change(), Some(10u32)); + + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630540800000i64); + + // 2nd Sept 2021 @ ~7am is 1630566000000 + // 2nd Sept 2021 @ 12am is 1630540800000 (start of day) + Timestamp::set_timestamp(1630566000000u64); + MiningRewardsAllowanceTestModule::on_initialize(7); + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630540800000, 0, 1))); + // start of new multiplier period + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1630540800000, 1630540800000, 2u32, 2u32))); + // check that the min_bonded_dhx_daily doubled after 3 months (we're only doing it after 2 days in the tests though) from 20 DHX to 30 DHX + assert_eq!(MiningRewardsAllowanceTestModule::min_bonded_dhx_daily(), Some(THIRTY_DHX)); +} + +fn check_ineligible_for_rewards_and_cooling_down_period_starts_if_insufficient_bonded(amount_bonded_each_miner: u128, amount_mpower_each_miner: u128, referendum_index: u32) { + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630627200000i64); + + // 3rd Sept 2021 @ ~7am is 1630652400000 + // 3rd Sept 2021 @ 12am is 1630627200000 (start of day) + Timestamp::set_timestamp(1630652400000u64); + MiningRewardsAllowanceTestModule::on_initialize(8); + + // the below works to unbond each of the accounts + + // check that the referendum that we created earlier still exists + assert_eq!(Democracy::referendum_count(), 1, "referenda not created"); + + unbond_each_miner_by_removing_their_referendum_vote(referendum_index.clone()); + + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630713600000i64); + + // now wait for the next day when we iterate through the miner accounts and they should have no locks + // 4th Sept 2021 @ ~7am is 1630738800000 + // 4th Sept 2021 @ 12am is 1630713600000 (start of day) + Timestamp::set_timestamp(1630738800000u64); + MiningRewardsAllowanceTestModule::on_initialize(9); + + // IMPORTANT NOTE: The min. DHX bonded has increased from 10 (10:1) to 20 (20:1) in order to be eligible + // for rewards, however none of the miner's increased their bonded DHX amount proportionally to still remain + // eligible for rewards, so since having insufficient bonded DHX is the same as unbonding, we expect the + // cooling off period days remaining to change so they are now going through the unbonding cool down period, + // (which we also count using `cooling_off_period_days_remaining`) + // where they aren't eligble for rewards until they bond the new min. DHX so cooling off period starts and + // then they'd be eligible for rewards after waiting that period, but also note that if they don't bond the new min. + // DHX and wait until the end of the cool down period then they'll be able to withdraw the amount they had bonded. + // + // but in the tests the initial bonded amounts were much more than the min. DHX bonded, so even after it increases + // from 10 (10:1) to 20 (20:1) they are still eligible for rewards. + // so in the tests we've just decided to remove their vote and `unlock` their bonded DHX so they don't have a lock + // and so don't satisfy the min. DHX bonded + + // params: start of date, days remaining, bonding status + // note: since they don't have the min. DHX bonded their bonding status changes to `2`, which is unbonding + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630713600000, 1, 2))); + + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1630713600000, 1)), Some(0u128)); + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1630713600000, 2)), Some(0u128)); + assert_eq!(MiningRewardsAllowanceTestModule::bonded_dhx_of_account_for_date((1630713600000, 3)), Some(0u128)); + + // check they are not eligible for rewards due to insufficient bonded amount + assert_eq!(MiningRewardsAllowanceTestModule::rewards_aggregated_dhx_for_all_miners_for_date(1630713600000), None); + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630713600000, 1)), None); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630713600000, 2)), None); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_accumulated_dhx_for_miner_for_date((1630713600000, 3)), None); + + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining(1630713600000), Some(FIVE_THOUSAND_DHX)); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_allowance_dhx_for_date_remaining_distributed(1630713600000), Some(false)); + + check_cooling_off_period_starts_again_if_sufficient_bonded_again(amount_bonded_each_miner.clone(), amount_mpower_each_miner.clone(), referendum_index.clone()); +} + +fn check_cooling_off_period_starts_again_if_sufficient_bonded_again(amount_bonded_each_miner: u128, amount_mpower_each_miner: u128, referendum_index: u32) { + + bond_each_miner_by_voting_for_referendum(amount_bonded_each_miner, referendum_index); + + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1630800000000i64); + + // now wait for the next day when we iterate through the miner accounts and they should have no locks + // 5th Sept 2021 @ ~7am is 1630825200000 + // 5th Sept 2021 @ 12am is 1630800000000 (start of day) + Timestamp::set_timestamp(1630825200000u64); + MiningRewardsAllowanceTestModule::on_initialize(10); + + // params: start of date, days remaining, bonding status + // note: since they have the min. DHX bonded again their bonding status changes to `1`, which is bonding + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630800000000, 0, 1))); + + check_ineligible_for_rewards_and_cooling_down_period_starts_if_insufficient_mpower(amount_bonded_each_miner.clone(), amount_mpower_each_miner.clone(), referendum_index.clone()); +} + +fn check_ineligible_for_rewards_and_cooling_down_period_starts_if_insufficient_mpower(amount_bonded_each_miner: u128, amount_mpower_each_miner: u128, referendum_index: u32) { + // no mpower to check they'll be ineligible for rewards + change_mpower_for_each_miner(0u128, 1630886400000i64); + + // 6th Sept 2021 @ ~7am is 1630911600000 + // 6th Sept 2021 @ 12am is 1630886400000 (start of day) + Timestamp::set_timestamp(1630911600000u64); + MiningRewardsAllowanceTestModule::on_initialize(11); + + // no mpower to check they'll be ineligible for rewards + change_mpower_for_each_miner(0u128, 1630972800000i64); + + // 7th Sept 2021 @ ~7am is 1630998000000 + // 7th Sept 2021 @ 12am is 1630972800000 (start of day) + Timestamp::set_timestamp(1630998000000u64); + MiningRewardsAllowanceTestModule::on_initialize(12); + + // params: start of date, days remaining, bonding status + // note: since they don't have min. mPower their bonding status changes to `2`, which is unbonding + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1630972800000, 0, 2))); + + check_cooling_off_period_starts_again_if_sufficient_mpower_again(amount_bonded_each_miner.clone(), amount_mpower_each_miner.clone(), referendum_index.clone()); +} + +fn check_cooling_off_period_starts_again_if_sufficient_mpower_again(amount_bonded_each_miner: u128, amount_mpower_each_miner: u128, referendum_index: u32) { + // reset mpower to what it was + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1631059200000i64); + + // 8th Sept 2021 @ ~7am is 1631084400000 + // 8th Sept 2021 @ 12am is 1631059200000 (start of day) + Timestamp::set_timestamp(1631084400000u64); + MiningRewardsAllowanceTestModule::on_initialize(13); + + // params: start of date, days remaining, bonding status + // note: they have min. mPower again so their bonding status changes to `0`, which is unbonded + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1631059200000, 0, 0))); + + // use original mpower + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1631145600000i64); + + // 9th Sept 2021 @ ~7am is 1631170800000 + // 9th Sept 2021 @ 12am is 1631145600000 (start of day) + Timestamp::set_timestamp(1631170800000u64); + MiningRewardsAllowanceTestModule::on_initialize(14); + + // params: start of date, days remaining, bonding status + // note: they have min. mPower again so their bonding status changes to `1`, which means they are bonded again + assert_eq!(MiningRewardsAllowanceTestModule::cooling_off_period_days_remaining(1), Some((1631145600000, 1, 1))); + + // params: total days, days remaining + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1631059200000, 1631145600000, 2u32, 1u32))); + + // we're up to 50:1 now + assert_eq!(MiningRewardsAllowanceTestModule::min_bonded_dhx_daily(), Some(50_000_000_000_000_000_000_u128)); + + check_pause_and_reset_rewards_multiplier_works(amount_bonded_each_miner.clone(), amount_mpower_each_miner.clone(), referendum_index.clone()); +} + +fn check_pause_and_reset_rewards_multiplier_works(amount_bonded_each_miner: u128, amount_mpower_each_miner: u128, referendum_index: u32) { + // we want to check if pausing will prevent it from changing from 50:1 to 60:1 when the rewards multiplier for current period in days remaining ends + + assert_ok!(MiningRewardsAllowanceTestModule::change_rewards_multiplier_paused_status(true)); + + // use original mpower + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1631232000000i64); + + // 10th Sept 2021 @ ~7am is 1631257200000 + // 10th Sept 2021 @ 12am is 1631232000000 (start of day) + Timestamp::set_timestamp(1631257200000u64); + MiningRewardsAllowanceTestModule::on_initialize(15); + + // use original mpower + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1631318400000i64); + + // 11th Sept 2021 @ ~7am is 1631343600000 + // 11th Sept 2021 @ 12am is 1631318400000 (start of day) + Timestamp::set_timestamp(1631343600000u64); + MiningRewardsAllowanceTestModule::on_initialize(16); + + // params: total days, days remaining + // assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1631318400000, 1631318400000, 2u32, 2u32))); + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1631059200000, 1631145600000, 2u32, 1u32))); + + // we've paused it, so it should still be 50:10 (if we didn't pause it, it would have increased to 60:1 since we were at end of a reward multiplier period) + assert_eq!(MiningRewardsAllowanceTestModule::min_bonded_dhx_daily(), Some(50_000_000_000_000_000_000_u128)); + + // unpause again + assert_ok!(MiningRewardsAllowanceTestModule::change_rewards_multiplier_paused_status(false)); + + // reset - reset to change back to 10:1 instead of 50:1 + assert_ok!(MiningRewardsAllowanceTestModule::change_rewards_multiplier_reset_status(true)); + + // use original mpower + change_mpower_for_each_miner(amount_mpower_each_miner.clone(), 1631404800000i64); + + // 12th Sept 2021 @ ~7am is 1631430000000 + // 12th Sept 2021 @ 12am is 1631404800000 (start of day) + Timestamp::set_timestamp(1631430000000u64); + MiningRewardsAllowanceTestModule::on_initialize(17); + + // this starts reducing again since we unpaused it + assert_eq!(MiningRewardsAllowanceTestModule::rewards_multiplier_current_period_days_remaining(), Some((1631059200000, 1631404800000, 2u32, 0u32))); + + // check that reset worked + assert_eq!(MiningRewardsAllowanceTestModule::min_bonded_dhx_daily(), Some(TEN_DHX)); +} diff --git a/pallets/mining/sampling/hardware/Cargo.toml b/pallets/mining/sampling/hardware/Cargo.toml index 45193358f..e4c1ad9a9 100644 --- a/pallets/mining/sampling/hardware/Cargo.toml +++ b/pallets/mining/sampling/hardware/Cargo.toml @@ -29,15 +29,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } mining-setting-hardware = { default-features = false, package = 'mining-setting-hardware', path = '../../../mining/setting/hardware' } diff --git a/pallets/mining/sampling/token/Cargo.toml b/pallets/mining/sampling/token/Cargo.toml index 75d3e3bae..ee16e4a3a 100644 --- a/pallets/mining/sampling/token/Cargo.toml +++ b/pallets/mining/sampling/token/Cargo.toml @@ -29,15 +29,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } mining-setting-token = { default-features = false, package = 'mining-setting-token', path = '../../../mining/setting/token' } diff --git a/pallets/mining/setting/hardware/Cargo.toml b/pallets/mining/setting/hardware/Cargo.toml index fd006fb07..26592a6af 100644 --- a/pallets/mining/setting/hardware/Cargo.toml +++ b/pallets/mining/setting/hardware/Cargo.toml @@ -28,15 +28,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } diff --git a/pallets/mining/setting/token/Cargo.toml b/pallets/mining/setting/token/Cargo.toml index 8960a0c7a..49facc9b1 100644 --- a/pallets/mining/setting/token/Cargo.toml +++ b/pallets/mining/setting/token/Cargo.toml @@ -28,15 +28,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../../roaming/roaming-operators' } diff --git a/pallets/primitives/Cargo.toml b/pallets/primitives/Cargo.toml index 57072ae4a..2d45d66b1 100644 --- a/pallets/primitives/Cargo.toml +++ b/pallets/primitives/Cargo.toml @@ -7,10 +7,10 @@ edition = '2018' [dependencies] serde = { version = '1.0.126', optional = true, features = ['derive'] } codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } bitmask = { version = '0.5.0', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } [features] default = ['std'] diff --git a/pallets/roaming/roaming-accounting-policies/Cargo.toml b/pallets/roaming/roaming-accounting-policies/Cargo.toml index bb20c8d22..7146deb4b 100644 --- a/pallets/roaming/roaming-accounting-policies/Cargo.toml +++ b/pallets/roaming/roaming-accounting-policies/Cargo.toml @@ -29,15 +29,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-networks = { default-features = false, package = 'roaming-networks', path = '../roaming-networks' } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../roaming-operators' } diff --git a/pallets/roaming/roaming-agreement-policies/Cargo.toml b/pallets/roaming/roaming-agreement-policies/Cargo.toml index 6a8851110..956b96114 100644 --- a/pallets/roaming/roaming-agreement-policies/Cargo.toml +++ b/pallets/roaming/roaming-agreement-policies/Cargo.toml @@ -30,15 +30,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } # env = { default-features = false, package = 'env', path = '../../env' } roaming-networks = { default-features = false, package = 'roaming-networks', path = '../roaming-networks' } diff --git a/pallets/roaming/roaming-billing-policies/Cargo.toml b/pallets/roaming/roaming-billing-policies/Cargo.toml index 7a4bbd389..c023a1296 100644 --- a/pallets/roaming/roaming-billing-policies/Cargo.toml +++ b/pallets/roaming/roaming-billing-policies/Cargo.toml @@ -28,15 +28,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-charging-policies/Cargo.toml b/pallets/roaming/roaming-charging-policies/Cargo.toml index 65cbf2c63..962667b30 100644 --- a/pallets/roaming/roaming-charging-policies/Cargo.toml +++ b/pallets/roaming/roaming-charging-policies/Cargo.toml @@ -28,15 +28,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-device-profiles/Cargo.toml b/pallets/roaming/roaming-device-profiles/Cargo.toml index c387a31d8..70ebe9beb 100644 --- a/pallets/roaming/roaming-device-profiles/Cargo.toml +++ b/pallets/roaming/roaming-device-profiles/Cargo.toml @@ -31,15 +31,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-devices/Cargo.toml b/pallets/roaming/roaming-devices/Cargo.toml index dbab3c608..54e64a560 100644 --- a/pallets/roaming/roaming-devices/Cargo.toml +++ b/pallets/roaming/roaming-devices/Cargo.toml @@ -30,15 +30,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-network-profiles/Cargo.toml b/pallets/roaming/roaming-network-profiles/Cargo.toml index a4a46707b..e46ade5f1 100644 --- a/pallets/roaming/roaming-network-profiles/Cargo.toml +++ b/pallets/roaming/roaming-network-profiles/Cargo.toml @@ -31,15 +31,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-network-servers/Cargo.toml b/pallets/roaming/roaming-network-servers/Cargo.toml index 792d663f3..83f3e1022 100644 --- a/pallets/roaming/roaming-network-servers/Cargo.toml +++ b/pallets/roaming/roaming-network-servers/Cargo.toml @@ -28,15 +28,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-networks/Cargo.toml b/pallets/roaming/roaming-networks/Cargo.toml index 8343c681a..0032e4278 100644 --- a/pallets/roaming/roaming-networks/Cargo.toml +++ b/pallets/roaming/roaming-networks/Cargo.toml @@ -30,21 +30,21 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../roaming-operators' } [dev-dependencies] -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } diff --git a/pallets/roaming/roaming-operators/Cargo.toml b/pallets/roaming/roaming-operators/Cargo.toml index 3b41cc100..3ed80ece1 100644 --- a/pallets/roaming/roaming-operators/Cargo.toml +++ b/pallets/roaming/roaming-operators/Cargo.toml @@ -28,15 +28,15 @@ std = [ [dependencies] codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-organizations/Cargo.toml b/pallets/roaming/roaming-organizations/Cargo.toml index b12cd8068..e0712242c 100644 --- a/pallets/roaming/roaming-organizations/Cargo.toml +++ b/pallets/roaming/roaming-organizations/Cargo.toml @@ -29,15 +29,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-packet-bundles/Cargo.toml b/pallets/roaming/roaming-packet-bundles/Cargo.toml index 301770b6b..93db9c563 100644 --- a/pallets/roaming/roaming-packet-bundles/Cargo.toml +++ b/pallets/roaming/roaming-packet-bundles/Cargo.toml @@ -32,15 +32,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-routing-profiles/Cargo.toml b/pallets/roaming/roaming-routing-profiles/Cargo.toml index c25ff95da..1af0f13b4 100644 --- a/pallets/roaming/roaming-routing-profiles/Cargo.toml +++ b/pallets/roaming/roaming-routing-profiles/Cargo.toml @@ -31,15 +31,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-service-profiles/Cargo.toml b/pallets/roaming/roaming-service-profiles/Cargo.toml index 2497df3dc..d1e81205a 100644 --- a/pallets/roaming/roaming-service-profiles/Cargo.toml +++ b/pallets/roaming/roaming-service-profiles/Cargo.toml @@ -29,15 +29,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/roaming/roaming-sessions/Cargo.toml b/pallets/roaming/roaming-sessions/Cargo.toml index 0e969d410..64dfc5c48 100644 --- a/pallets/roaming/roaming-sessions/Cargo.toml +++ b/pallets/roaming/roaming-sessions/Cargo.toml @@ -31,15 +31,15 @@ std = [ codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } diff --git a/pallets/treasury/dao/Cargo.toml b/pallets/treasury/dao/Cargo.toml index 59a539545..c841d649b 100644 --- a/pallets/treasury/dao/Cargo.toml +++ b/pallets/treasury/dao/Cargo.toml @@ -29,16 +29,16 @@ hex-literal = { version = '0.3.1', optional = false } codec = { version = '2.2.0', package = 'parity-scale-codec', default-features = false, features = ['derive', 'max-encoded-len'] } log = { version = '0.4.14', default-features = false } safe-mix = { version = '1.0.0', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-treasury = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-treasury = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } roaming-operators = { default-features = false, package = 'roaming-operators', path = '../../roaming/roaming-operators' } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index f2b03fa3a..5c8589d8f 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -17,58 +17,58 @@ log = { version = '0.4.14', default-features = false } serde = { version = '1.0.126', optional = true, features = ['derive'] } # primitives -sp-authority-discovery = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-api = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-block-builder = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-inherents = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-io = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-offchain = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-session = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-staking = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-transaction-pool = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-transaction-storage-proof = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-version = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -sp-npos-elections = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +sp-authority-discovery = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-api = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-block-builder = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-consensus-aura = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-core = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-inherents = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-io = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-offchain = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-runtime = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-session = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-staking = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-transaction-pool = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-transaction-storage-proof = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-version = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +sp-npos-elections = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } module-primitives = { default-features = false, path = '../pallets/primitives' } # frame dependencies -frame-executive = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-system-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -frame-election-provider-support = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-aura = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-authorship = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-authority-discovery = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-bounties = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-collective = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-democracy = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-elections-phragmen = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-election-provider-multi-phase = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-grandpa = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-identity = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-im-online = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-indices = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-membership = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-multisig = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-offences = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-randomness-collective-flip = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-scheduler = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-session = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false, features = ['historical'] } -pallet-staking = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-staking-reward-curve = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-sudo = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-timestamp = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-tips = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-treasury = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } -pallet-utility = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +frame-executive = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-system-rpc-runtime-api = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +frame-election-provider-support = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-aura = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-authorship = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-authority-discovery = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-balances = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-bounties = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-collective = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-democracy = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-elections-phragmen = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-election-provider-multi-phase = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-grandpa = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-identity = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-im-online = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-indices = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-membership = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-multisig = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-offences = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-randomness-collective-flip = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-scheduler = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-session = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false, features = ['historical'] } +pallet-staking = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-staking-reward-curve = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-sudo = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-timestamp = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-tips = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-treasury = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } +pallet-utility = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false } # custom pallets @@ -93,6 +93,7 @@ mining-setting-token = { default-features = false, package = 'mining-setting-tok mining-setting-hardware = { default-features = false, package = 'mining-setting-hardware', path = '../pallets/mining/setting/hardware' } mining-rates-token = { default-features = false, package = 'mining-rates-token', path = '../pallets/mining/rates/token' } mining-rates-hardware = { default-features = false, package = 'mining-rates-hardware', path = '../pallets/mining/rates/hardware' } +mining-rewards-allowance = { default-features = false, package = 'mining-rewards-allowance', path = '../pallets/mining/rewards-allowance' } mining-sampling-token = { default-features = false, package = 'mining-sampling-token', path = '../pallets/mining/sampling/token' } mining-sampling-hardware = { default-features = false, package = 'mining-sampling-hardware', path = '../pallets/mining/sampling/hardware' } mining-eligibility-token = { default-features = false, package = 'mining-eligibility-token', path = '../pallets/mining/eligibility/token' } @@ -178,6 +179,7 @@ std = [ 'mining-setting-hardware/std', 'mining-rates-token/std', 'mining-rates-hardware/std', + 'mining-rewards-allowance/std', 'mining-sampling-token/std', 'mining-sampling-hardware/std', 'mining-eligibility-token/std', @@ -190,4 +192,4 @@ std = [ ] [build-dependencies] -substrate-wasm-builder = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false, package = 'substrate-wasm-builder' } +substrate-wasm-builder = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false, package = 'substrate-wasm-builder' } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 9f232f042..92063b768 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1146,6 +1146,11 @@ impl mining_execution_token::Config for Runtime { type MiningExecutionTokenIndex = u64; } +impl mining_rewards_allowance::Config for Runtime { + type Event = Event; + type Currency = Balances; +} + impl exchange_rate::Config for Runtime { type DOTRate = u64; type DecimalsAfterPoint = u32; @@ -1217,6 +1222,7 @@ construct_runtime!( MiningSettingHardware: mining_setting_hardware::{Pallet, Call, Storage, Event}, MiningRatesToken: mining_rates_token::{Pallet, Call, Storage, Event}, MiningRatesHardware: mining_rates_hardware::{Pallet, Call, Storage, Event}, + MiningRewardsAllowance: mining_rewards_allowance::{Pallet, Call, Storage, Config, Event}, MiningSamplingToken: mining_sampling_token::{Pallet, Call, Storage, Event}, MiningSamplingHardware: mining_sampling_hardware::{Pallet, Call, Storage, Event}, MiningEligibilityToken: mining_eligibility_token::{Pallet, Call, Storage, Event}, diff --git a/runtime/tests/cli_integration_tests_mining_tokens.rs b/runtime/tests/cli_integration_tests_mining_tokens.rs index 4478e9a37..13d0aafad 100644 --- a/runtime/tests/cli_integration_tests_mining_tokens.rs +++ b/runtime/tests/cli_integration_tests_mining_tokens.rs @@ -6,6 +6,9 @@ extern crate mining_setting_token as mining_setting_token; extern crate mining_eligibility_token as mining_eligibility_token; extern crate mining_execution_token as mining_execution_token; extern crate mining_rates_token as mining_rates_token; +// Note: We are adding tests for mining_rewards_allowance in +// pallets/mining/rewards-allowance/src/mock.rs and pallets/mining/rewards-allowance/src/tests.rs +// extern crate mining_rewards_allowance as mining_rewards_allowance; extern crate mining_sampling_token as mining_sampling_token; extern crate roaming_operators as roaming_operators; diff --git a/traits/account-set/Cargo.toml b/traits/account-set/Cargo.toml index 88f9bed8d..eae05b75c 100644 --- a/traits/account-set/Cargo.toml +++ b/traits/account-set/Cargo.toml @@ -23,4 +23,4 @@ std = [ [dependencies] # Substrate packages -sp-std = { git = 'https://github.com/paritytech/substrate', rev = '852bab073407b65b5e3e461baaa0541c4e0bc3d6', default-features = false } +sp-std = { git = 'https://github.com/DataHighway-DHX/substrate', rev = 'f5dc02a8a491c149fba05a2a5a51c80ce1b3cead', default-features = false }