From e3832c51162fbf1061ceb3ff5ea8346e1dcb0076 Mon Sep 17 00:00:00 2001 From: Tlalocman Date: Tue, 17 Oct 2023 15:22:28 -0600 Subject: [PATCH] Update dependencies to use Polkadot v1.0.0 (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🚀 chore(afloat): update dependencies to use Polkadot v1.0.0 branch for frame-support, frame-system, frame-benchmarking, sp-core, sp-io, sp-runtime, and sp-std 🚀 chore(bitcoin-vaults): update dependencies to use Polkadot v1.0.0 branch for frame-support, frame-system, frame-benchmarking, sp-core, sp-io, sp-runtime, and sp-std 🚀 chore(confidential-docs): update dependencies to use Polkadot v1.0.0 branch for frame-support, frame-system, and frame-benchmarking 🔀 chore(Cargo.toml): update substrate dependencies to use polkadot-v1.0.0 branch for fruniques, fund-admin-records, and fund-admin pallets 🔀 chore(Cargo.toml): update dependencies to use polkadot-v1.0.0 branch for frame-support, frame-system, frame-benchmarking, sp-runtime, pallet-uniques, pallet-balances, pallet-timestamp, sp-core, sp-io, and pallet-balances in gated-marketplace, mapped-assets, and rbac pallets 🔀 chore(Cargo.toml): update substrate dependencies to use polkadot-v1.0.0 branch for frame-support, frame-system, frame-benchmarking, sp-std, sp-core, sp-io, and sp-runtime to align with the latest version of Substrate framework * 🔧 chore(migration.rs): fix indentation and formatting in log messages for better readability 🔧 chore(rust-toolchain.toml): update Rust toolchain channel to nightly-2023-10-01 for compatibility with dependencies and add rustfmt component * update format --- Cargo.lock | 72 ++++++++++---------- pallets/afloat/Cargo.toml | 22 +++--- pallets/afloat/src/functions.rs | 10 +-- pallets/bitcoin-vaults/Cargo.toml | 18 ++--- pallets/bitcoin-vaults/src/functions.rs | 28 ++++---- pallets/bitcoin-vaults/src/lib.rs | 12 ++-- pallets/confidential-docs/Cargo.toml | 12 ++-- pallets/confidential-docs/src/types.rs | 6 +- pallets/fruniques/Cargo.toml | 16 ++--- pallets/fruniques/src/functions.rs | 8 +-- pallets/fruniques/src/lib.rs | 4 +- pallets/fruniques/src/types.rs | 16 ++--- pallets/fund-admin-records/Cargo.toml | 14 ++-- pallets/fund-admin/Cargo.toml | 16 ++--- pallets/fund-admin/src/functions.rs | 29 ++++---- pallets/fund-admin/src/migration.rs | 12 ++-- pallets/fund-admin/src/tests.rs | 30 ++++---- pallets/gated-marketplace/Cargo.toml | 20 +++--- pallets/gated-marketplace/src/functions.rs | 28 ++++---- pallets/gated-marketplace/src/lib.rs | 15 ++-- pallets/gated-marketplace/src/tests.rs | 68 +++++++++--------- pallets/mapped-assets/Cargo.toml | 18 ++--- pallets/mapped-assets/src/functions.rs | 40 +++++------ pallets/mapped-assets/src/impl_stored_map.rs | 2 +- pallets/mapped-assets/src/lib.rs | 2 +- pallets/mapped-assets/src/types.rs | 2 +- pallets/rbac/Cargo.toml | 12 ++-- pallets/template/Cargo.toml | 16 ++--- rust-toolchain.toml | 5 -- 29 files changed, 278 insertions(+), 275 deletions(-) delete mode 100644 rust-toolchain.toml diff --git a/Cargo.lock b/Cargo.lock index 077f81b1..7d770fb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -734,7 +734,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-support-procedural", @@ -771,7 +771,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bitflags", "environmental", @@ -804,7 +804,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "cfg-expr", @@ -819,7 +819,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -831,7 +831,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -841,7 +841,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "log", @@ -1643,7 +1643,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -1816,7 +1816,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -2462,7 +2462,7 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "hash-db", "log", @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "blake2", @@ -2494,7 +2494,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -2507,7 +2507,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "integer-sqrt", "num-traits", @@ -2521,7 +2521,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "base58", @@ -2564,7 +2564,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "blake2b_simd", "byteorder", @@ -2578,7 +2578,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -2589,7 +2589,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -2599,7 +2599,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "environmental", "parity-scale-codec", @@ -2610,7 +2610,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -2625,7 +2625,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bytes", "ed25519", @@ -2650,7 +2650,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -2667,7 +2667,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "backtrace", "lazy_static", @@ -2677,7 +2677,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "either", "hash256-std-hasher", @@ -2699,7 +2699,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -2717,7 +2717,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "proc-macro-crate", @@ -2729,7 +2729,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -2741,7 +2741,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "hash-db", "log", @@ -2761,12 +2761,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -2779,7 +2779,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures-timer", @@ -2794,7 +2794,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sp-std", @@ -2806,7 +2806,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ahash 0.8.3", "hash-db", @@ -2829,7 +2829,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -2846,7 +2846,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -2857,7 +2857,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -2871,7 +2871,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", diff --git a/pallets/afloat/Cargo.toml b/pallets/afloat/Cargo.toml index 34a988d4..d236c4fe 100644 --- a/pallets/afloat/Cargo.toml +++ b/pallets/afloat/Cargo.toml @@ -21,23 +21,23 @@ serde = { version = "1.0.140", default-features = false, features = ["derive"] } scale-info = { version = "2.1.1", default-features = false, features = [ "derive" ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } pallet-fruniques = { path = "../fruniques", default-features = false, version = "0.1.0-dev" } pallet-rbac = { path = "../rbac/", default-features = false, version = "4.0.0-dev" } pallet-gated-marketplace = { path = "../gated-marketplace/", default-features = false, version = "4.0.0-dev" } pallet-mapped-assets = { path = "../mapped-assets/", default-features = false, version = "4.0.0-dev" } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } [features] default = ["std"] diff --git a/pallets/afloat/src/functions.rs b/pallets/afloat/src/functions.rs index 4c39a1ea..037753a7 100644 --- a/pallets/afloat/src/functions.rs +++ b/pallets/afloat/src/functions.rs @@ -64,7 +64,7 @@ impl Pallet { AfloatCollectionId::::put(collection_id); Ok(()) } else { - return Err(Error::::FailedToCreateFruniquesCollection.into()) + return Err(Error::::FailedToCreateFruniquesCollection.into()); } } @@ -461,8 +461,8 @@ impl Pallet { ); //ensure user has enough afloat balance ensure!( - Self::do_get_afloat_balance(who.clone()) >= - offer.price_per_credit * tax_credit_amount.into(), + Self::do_get_afloat_balance(who.clone()) + >= offer.price_per_credit * tax_credit_amount.into(), Error::::NotEnoughAfloatBalanceAvailable ); let zero_balance: T::Balance = Zero::zero(); @@ -609,7 +609,7 @@ impl Pallet { let tax_credit_amount_u32 = if let Ok(amount) = transaction.tax_credit_amount.try_into() { amount } else { - return Err(Error::::TaxCreditAmountOverflow.into()) + return Err(Error::::TaxCreditAmountOverflow.into()); }; let child_offer_id = pallet_gated_marketplace::Pallet::::do_enlist_sell_offer( @@ -713,7 +713,7 @@ impl Pallet { >::try_mutate(offer_id, |offer| -> DispatchResult { let offer = offer.as_mut().ok_or(Error::::OfferNotFound)?; if transaction.tax_credit_amount > offer.tax_credit_amount_remaining { - return Err(Error::::Underflow.into()) + return Err(Error::::Underflow.into()); } offer.tax_credit_amount_remaining = offer.tax_credit_amount_remaining - transaction.tax_credit_amount; diff --git a/pallets/bitcoin-vaults/Cargo.toml b/pallets/bitcoin-vaults/Cargo.toml index f573a120..8ef42930 100644 --- a/pallets/bitcoin-vaults/Cargo.toml +++ b/pallets/bitcoin-vaults/Cargo.toml @@ -22,17 +22,17 @@ lite-json = { version = "0.1", default-features = false } scale-info = { version = "2.1.1", default-features = false, features = [ "derive" ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } [features] default = ["std"] diff --git a/pallets/bitcoin-vaults/src/functions.rs b/pallets/bitcoin-vaults/src/functions.rs index a963f995..046dcc7c 100644 --- a/pallets/bitcoin-vaults/src/functions.rs +++ b/pallets/bitcoin-vaults/src/functions.rs @@ -33,7 +33,7 @@ impl Pallet { vault_members.clone().into_iter().try_for_each(|acc| { // check if all users have an xpub if !>::contains_key(acc.clone()) { - return Err(Error::::XPubNotFound) + return Err(Error::::XPubNotFound); } >::try_mutate(acc, |vault_vec| vault_vec.try_push(vault_id.clone())) .map_err(|_| Error::::SignerVaultLimit) @@ -153,8 +153,8 @@ impl Pallet { ensure!(vault.is_vault_member(&signer), Error::::SignerPermissionsNeeded); // if its finalized then fire error "already finalized" or "already broadcasted" ensure!( - proposal.status.eq(&ProposalStatus::Pending) || - proposal.status.eq(&ProposalStatus::Finalized), + proposal.status.eq(&ProposalStatus::Pending) + || proposal.status.eq(&ProposalStatus::Finalized), Error::::PendingProposalRequired ); // signs must be greater or equal than threshold @@ -265,7 +265,7 @@ impl Pallet { } } else { // xpub registered and the account doesnt own it: unavailable - return XpubStatus::Taken + return XpubStatus::Taken; } // Does the user owns the registered xpub? if yes, available } @@ -338,9 +338,9 @@ impl Pallet { pub fn get_pending_vaults() -> Vec<[u8; 32]> { >::iter() .filter_map(|(entry, vault)| { - if vault.descriptors.output_descriptor.is_empty() && - (vault.offchain_status.eq(&BDKStatus::::Pending) || - vault.offchain_status.eq( + if vault.descriptors.output_descriptor.is_empty() + && (vault.offchain_status.eq(&BDKStatus::::Pending) + || vault.offchain_status.eq( &BDKStatus::::RecoverableError( BoundedVec::::default(), ), @@ -356,11 +356,11 @@ impl Pallet { pub fn get_pending_proposals() -> Vec<[u8; 32]> { >::iter() .filter_map(|(id, proposal)| { - if proposal.psbt.is_empty() && - (proposal + if proposal.psbt.is_empty() + && (proposal .offchain_status - .eq(&BDKStatus::::Pending) || - proposal.offchain_status.eq( + .eq(&BDKStatus::::Pending) + || proposal.offchain_status.eq( &BDKStatus::::RecoverableError( BoundedVec::::default(), ), @@ -393,7 +393,7 @@ impl Pallet { >::iter() .filter_map(|(id, p)| { if p.can_be_finalized() { - return Some(id) + return Some(id); } None }) @@ -434,13 +434,13 @@ impl Pallet { let vec_body = response.body().collect::>(); let msj_str = str::from_utf8(vec_body.as_slice()).unwrap_or("Error 400: Bad request"); - return Err(Self::build_offchain_err(false, msj_str)) + return Err(Self::build_offchain_err(false, msj_str)); }, 500..=599 => { let vec_body = response.body().collect::>(); let msj_str = str::from_utf8(vec_body.as_slice()).unwrap_or("Error 500: Server error"); - return Err(Self::build_offchain_err(false, msj_str)) + return Err(Self::build_offchain_err(false, msj_str)); }, _ => return Err(Self::build_offchain_err(true, "Unknown error")), } diff --git a/pallets/bitcoin-vaults/src/lib.rs b/pallets/bitcoin-vaults/src/lib.rs index 632f22c0..67d4423f 100644 --- a/pallets/bitcoin-vaults/src/lib.rs +++ b/pallets/bitcoin-vaults/src/lib.rs @@ -279,7 +279,7 @@ pub mod pallet { // transactions without it let signer = Signer::::any_account(); if !signer.can_sign() { - return + return; } // Check if this OCW can modify the vaults @@ -745,7 +745,7 @@ pub mod pallet { let tx_res = Self::do_insert_descriptors(vault_payload.vault_id, descriptors, status); if tx_res.is_err() { - return Some(tx_res) + return Some(tx_res); } None }) @@ -775,7 +775,7 @@ pub mod pallet { let tx_res = Self::do_insert_psbt(proposal_psbt.proposal_id, bounded_psbt, status); if tx_res.is_err() { - return Some(tx_res) + return Some(tx_res); } None }) @@ -826,19 +826,19 @@ pub mod pallet { match call { Call::ocw_insert_descriptors { ref payload, ref signature } => { if !SignedPayload::::verify::(payload, signature.clone()) { - return InvalidTransaction::BadProof.into() + return InvalidTransaction::BadProof.into(); } valid_tx(b"unsigned_extrinsic_with_signed_payload".to_vec()) }, // compiler complains if they aren't on different match arms Call::ocw_insert_psbts { ref payload, ref signature } => { if !SignedPayload::::verify::(payload, signature.clone()) { - return InvalidTransaction::BadProof.into() + return InvalidTransaction::BadProof.into(); } valid_tx(b"unsigned_extrinsic_with_signed_payload".to_vec()) }, Call::ocw_finalize_psbts { ref payload, ref signature } => { if !SignedPayload::::verify::(payload, signature.clone()) { - return InvalidTransaction::BadProof.into() + return InvalidTransaction::BadProof.into(); } valid_tx(b"unsigned_extrinsic_with_signed_payload".to_vec()) }, diff --git a/pallets/confidential-docs/Cargo.toml b/pallets/confidential-docs/Cargo.toml index bba917aa..31e7e64e 100644 --- a/pallets/confidential-docs/Cargo.toml +++ b/pallets/confidential-docs/Cargo.toml @@ -19,14 +19,14 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.1.1", default-features = false, features = [ "derive" ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } [features] default = ["std"] diff --git a/pallets/confidential-docs/src/types.rs b/pallets/confidential-docs/src/types.rs index 6735c984..84881ff6 100644 --- a/pallets/confidential-docs/src/types.rs +++ b/pallets/confidential-docs/src/types.rs @@ -117,8 +117,8 @@ impl GroupMember { } pub fn can_remove_group_member(&self, group_member: &GroupMember) -> bool { - group_member.role != GroupRole::Owner && - (self.role == GroupRole::Owner || - (self.role == GroupRole::Admin && group_member.authorizer == self.member)) + group_member.role != GroupRole::Owner + && (self.role == GroupRole::Owner + || (self.role == GroupRole::Admin && group_member.authorizer == self.member)) } } diff --git a/pallets/fruniques/Cargo.toml b/pallets/fruniques/Cargo.toml index ef440b49..d76a5a3e 100644 --- a/pallets/fruniques/Cargo.toml +++ b/pallets/fruniques/Cargo.toml @@ -20,17 +20,17 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { default-features = false, version = "2.0.1", features = [ "derive" ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", optional = true } -sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -pallet-uniques = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } +sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-uniques = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } pallet-rbac = { path = "../rbac/", default-features = false, version = "4.0.0-dev" } [dev-dependencies] -sp-core = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } +sp-core = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [features] default = ["std"] diff --git a/pallets/fruniques/src/functions.rs b/pallets/fruniques/src/functions.rs index 59f2d2e8..14093231 100644 --- a/pallets/fruniques/src/functions.rs +++ b/pallets/fruniques/src/functions.rs @@ -62,7 +62,7 @@ impl Pallet { ) -> AttributeValue { if let Some(a) = pallet_uniques::Pallet::::attribute(class_id, instance_id, key) { return BoundedVec::::try_from(a) - .expect("Error on converting the attribute to BoundedVec") + .expect("Error on converting the attribute to BoundedVec"); } BoundedVec::::default() } @@ -80,14 +80,14 @@ impl Pallet { pub fn collection_exists(class_id: &T::CollectionId) -> bool { if let Some(_owner) = pallet_uniques::Pallet::::collection_owner(*class_id) { - return true + return true; } false } pub fn instance_exists(class_id: &T::CollectionId, instance_id: &T::ItemId) -> bool { if let Some(_owner) = pallet_uniques::Pallet::::owner(*class_id, *instance_id) { - return true + return true; } false } @@ -314,7 +314,7 @@ impl Pallet { Self::do_mint(collection, owner.clone(), metadata.clone(), attributes)?; if let Some(ref parent_info) = parent_info { - return Self::do_nft_division(collection, item, metadata, parent_info, owner) + return Self::do_nft_division(collection, item, metadata, parent_info, owner); } let frunique_data = FruniqueData { diff --git a/pallets/fruniques/src/lib.rs b/pallets/fruniques/src/lib.rs index b862cfa1..5c3480d6 100644 --- a/pallets/fruniques/src/lib.rs +++ b/pallets/fruniques/src/lib.rs @@ -341,7 +341,7 @@ pub mod pallet { Self::do_spawn(class_id, owner, metadata, attributes, Some(parent_info))?; - return Ok(()) + return Ok(()); }; Self::do_spawn(class_id, owner, metadata, attributes, None)?; @@ -377,7 +377,7 @@ pub mod pallet { |frunique_data| -> DispatchResult { let frunique = frunique_data.as_mut().ok_or(Error::::FruniqueNotFound)?; if frunique.verified == true || frunique.verified_by.is_some() { - return Err(Error::::FruniqueAlreadyVerified.into()) + return Err(Error::::FruniqueAlreadyVerified.into()); } frunique.verified = true; frunique.verified_by = Some(caller.clone()); diff --git a/pallets/fruniques/src/types.rs b/pallets/fruniques/src/types.rs index 93a2ea93..27ab8f58 100644 --- a/pallets/fruniques/src/types.rs +++ b/pallets/fruniques/src/types.rs @@ -43,10 +43,10 @@ pub struct ParentInfo { impl PartialEq for ParentInfo { fn eq(&self, other: &Self) -> bool { - self.collection_id == other.collection_id && - self.parent_id == other.parent_id && - self.parent_weight == other.parent_weight && - self.is_hierarchical == other.is_hierarchical + self.collection_id == other.collection_id + && self.parent_id == other.parent_id + && self.parent_weight == other.parent_weight + && self.is_hierarchical == other.is_hierarchical } } @@ -84,10 +84,10 @@ impl ParentInfoCall { impl PartialEq for ParentInfoCall { fn eq(&self, other: &Self) -> bool { - self.collection_id == other.collection_id && - self.parent_id == other.parent_id && - self.parent_percentage == other.parent_percentage && - self.is_hierarchical == other.is_hierarchical + self.collection_id == other.collection_id + && self.parent_id == other.parent_id + && self.parent_percentage == other.parent_percentage + && self.is_hierarchical == other.is_hierarchical } } diff --git a/pallets/fund-admin-records/Cargo.toml b/pallets/fund-admin-records/Cargo.toml index 5a11dbc6..03df82c2 100644 --- a/pallets/fund-admin-records/Cargo.toml +++ b/pallets/fund-admin-records/Cargo.toml @@ -20,15 +20,15 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.0.1", default-features = false, features = [ "derive" ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", optional = true } -sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -pallet-timestamp = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } +sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-timestamp = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [dev-dependencies] -sp-core = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } +sp-core = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [features] default = ["std"] diff --git a/pallets/fund-admin/Cargo.toml b/pallets/fund-admin/Cargo.toml index 2e9d80dc..e84e9937 100644 --- a/pallets/fund-admin/Cargo.toml +++ b/pallets/fund-admin/Cargo.toml @@ -20,17 +20,17 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.0.1", default-features = false, features = [ "derive" ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", optional = true } -sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -pallet-timestamp = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } +sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-timestamp = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } pallet-rbac = { default-features = false, version = "4.0.0-dev", path = "../rbac/" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } [dev-dependencies] -sp-core = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" } +sp-core = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [features] default = ["std"] diff --git a/pallets/fund-admin/src/functions.rs b/pallets/fund-admin/src/functions.rs index 5faf71f5..5ad22852 100644 --- a/pallets/fund-admin/src/functions.rs +++ b/pallets/fund-admin/src/functions.rs @@ -1606,8 +1606,8 @@ impl Pallet { DrawdownsInfo::::get(drawdown_id).ok_or(Error::::DrawdownNotFound)?; ensure!( - drawdown_data.drawdown_type == DrawdownType::ConstructionLoan || - drawdown_data.drawdown_type == DrawdownType::DeveloperEquity, + drawdown_data.drawdown_type == DrawdownType::ConstructionLoan + || drawdown_data.drawdown_type == DrawdownType::DeveloperEquity, Error::::DrawdownTypeNotSupportedForBulkUpload ); @@ -2843,7 +2843,7 @@ impl Pallet { // Check if the user role trying to be assigned matches the actual user role from UsersInfo // storage if user_data.role != role { - return Err(Error::::UserCannotHaveMoreThanOneRole.into()) + return Err(Error::::UserCannotHaveMoreThanOneRole.into()); } // Match user role. Check the max numbers of projects a user can be assigned to @@ -2851,7 +2851,7 @@ impl Pallet { ProxyRole::Administrator => { // Can't assign an administrator role account to a project, admins are scoped // globally - return Err(Error::::CannotAddAdminRole.into()) + return Err(Error::::CannotAddAdminRole.into()); }, ProxyRole::Investor => { // Investors can be assigned to a maximum of 1 project @@ -2896,8 +2896,9 @@ impl Pallet { match drawdown_data.status { DrawdownStatus::Draft => Ok(()), DrawdownStatus::Rejected => Ok(()), - DrawdownStatus::Submitted => - Err(Error::::CannotPerformActionOnSubmittedDrawdown.into()), + DrawdownStatus::Submitted => { + Err(Error::::CannotPerformActionOnSubmittedDrawdown.into()) + }, DrawdownStatus::Approved => { // Ensure admin permissions if Self::is_authorized( @@ -3225,8 +3226,9 @@ impl Pallet { match revenue_data.status { RevenueStatus::Draft => Ok(()), RevenueStatus::Rejected => Ok(()), - RevenueStatus::Submitted => - Err(Error::::CannotPerformActionOnSubmittedRevenue.into()), + RevenueStatus::Submitted => { + Err(Error::::CannotPerformActionOnSubmittedRevenue.into()) + }, RevenueStatus::Approved => { // Ensure admin permission if Self::is_authorized( @@ -3257,8 +3259,9 @@ impl Pallet { match revenue_transaction_data.status { RevenueTransactionStatus::Draft => Ok(()), RevenueTransactionStatus::Rejected => Ok(()), - RevenueTransactionStatus::Submitted => - Err(Error::::CannotPerformActionOnSubmittedRevenueTransaction.into()), + RevenueTransactionStatus::Submitted => { + Err(Error::::CannotPerformActionOnSubmittedRevenueTransaction.into()) + }, RevenueTransactionStatus::Approved => { // Ensure admin permissions if Self::is_authorized( @@ -3453,7 +3456,7 @@ impl Pallet { T::Currency::transfer(&admin, &user, T::TransferAmount::get(), KeepAlive)?; Ok(()) } else { - return Ok(()) + return Ok(()); } } @@ -3629,8 +3632,8 @@ impl Pallet { let transaction_data = TransactionsInfo::::get(transaction_id) .ok_or(Error::::TransactionNotFound)?; - if transaction_data.status != TransactionStatus::Approved && - transaction_data.status != TransactionStatus::Confirmed + if transaction_data.status != TransactionStatus::Approved + && transaction_data.status != TransactionStatus::Confirmed { >::try_mutate::<_, _, DispatchError, _>( transaction_id, diff --git a/pallets/fund-admin/src/migration.rs b/pallets/fund-admin/src/migration.rs index e08d68bd..9adde220 100644 --- a/pallets/fund-admin/src/migration.rs +++ b/pallets/fund-admin/src/migration.rs @@ -127,12 +127,12 @@ pub mod v1 { current_version.put::>(); log::info!( - target: LOG_TARGET, - "Upgraded {} DrawdownData from {} initial drawdowns, storage to version {:?}", - count_drawdowns, - translated_drawdowns, - current_version - ); + target: LOG_TARGET, + "Upgraded {} DrawdownData from {} initial drawdowns, storage to version {:?}", + count_drawdowns, + translated_drawdowns, + current_version + ); log::info!( target: LOG_TARGET, diff --git a/pallets/fund-admin/src/tests.rs b/pallets/fund-admin/src/tests.rs index c9d233f7..51ad5ccb 100644 --- a/pallets/fund-admin/src/tests.rs +++ b/pallets/fund-admin/src/tests.rs @@ -376,8 +376,8 @@ fn get_drawdown_id( for i in 0..drawdonws_by_project.len() { let drawdown_data = DrawdownsInfo::::get(drawdonws_by_project[i]).unwrap(); - if drawdown_data.drawdown_type == drawdown_type && - drawdown_data.drawdown_number == drawdown_number + if drawdown_data.drawdown_type == drawdown_type + && drawdown_data.drawdown_number == drawdown_number { drawdown_id = drawdonws_by_project[i]; } @@ -412,9 +412,9 @@ fn get_transaction_id( for i in 0..transactions_by_drawdown.len() { let transaction_data = TransactionsInfo::::get(transactions_by_drawdown[i]).unwrap(); - if transaction_data.project_id == project_id && - transaction_data.drawdown_id == drawdown_id && - transaction_data.expenditure_id == expenditure_id + if transaction_data.project_id == project_id + && transaction_data.drawdown_id == drawdown_id + && transaction_data.expenditure_id == expenditure_id { transaction_id = transactions_by_drawdown[i]; } @@ -459,9 +459,9 @@ fn get_revenue_transaction_id( for i in 0..transactions_by_revenue.len() { let revenue_transaction_data = RevenueTransactionsInfo::::get(transactions_by_revenue[i]).unwrap(); - if revenue_transaction_data.project_id == project_id && - revenue_transaction_data.revenue_id == revenue_id && - revenue_transaction_data.job_eligible_id == job_eligible_id + if revenue_transaction_data.project_id == project_id + && revenue_transaction_data.revenue_id == revenue_id + && revenue_transaction_data.job_eligible_id == job_eligible_id { revenue_transaction_id = transactions_by_revenue[i]; } @@ -1888,7 +1888,7 @@ fn expenditures_add_a_hard_cost_budget_expenditure_for_a_given_project_works() { .unwrap(); if expenditure_data.name == make_field_name("Expenditure Test: HardCost") { target_expenditure_id = expenditure_id; - break + break; } } @@ -1949,7 +1949,7 @@ fn expenditures_add_a_softcost_budget_expenditure_for_a_given_project_works() { .unwrap(); if expenditure_data.name == make_field_name("Expenditure Test: SoftCost") { target_expenditure_id = expenditure_id; - break + break; } } @@ -2010,7 +2010,7 @@ fn expenditures_add_an_operational_budget_expenditure_for_a_given_project_works( .unwrap(); if expenditure_data.name == make_field_name("Expenditure Test: Operational") { target_expenditure_id = expenditure_id; - break + break; } } @@ -2071,7 +2071,7 @@ fn expenditures_add_an_others_budget_expenditure_for_a_given_project_works() { .unwrap(); if expenditure_data.name == make_field_name("Expenditure Test: Others") { target_expenditure_id = expenditure_id; - break + break; } } @@ -2270,7 +2270,7 @@ fn expenditures_edit_a_given_expenditure_works() { if expenditure_data.name == make_field_name("Expenditure Test: Hard Cost") { target_expenditure_id = expenditure_id; - break + break; } } @@ -2444,7 +2444,7 @@ fn expenditures_admnistrator_tries_to_update_a_non_existent_expenditure_should_f if expenditure_data.name == make_field_name("Expenditure Test: Hard Cost") { target_expenditure_id = expenditure_id; - break + break; } } @@ -2522,7 +2522,7 @@ fn expenditures_delete_a_selected_expenditure_works() { if expenditure_data.name == make_field_name("Expenditure Test: Hard Cost") { target_expenditure_id = expenditure_id; - break + break; } } diff --git a/pallets/gated-marketplace/Cargo.toml b/pallets/gated-marketplace/Cargo.toml index 06bc4699..ceed6ef3 100644 --- a/pallets/gated-marketplace/Cargo.toml +++ b/pallets/gated-marketplace/Cargo.toml @@ -21,21 +21,21 @@ serde = { version = "1.0.140", default-features = false, features = ["derive"] } scale-info = { version = "2.1.1", default-features = false, features = [ "derive" ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } pallet-fruniques = { path = "../fruniques", default-features = false, version = "0.1.0-dev" } pallet-rbac = { path = "../rbac/", default-features = false, version = "4.0.0-dev" } pallet-mapped-assets = { path = "../mapped-assets/", default-features = false, version = "4.0.0-dev" } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } [features] default = ["std"] diff --git a/pallets/gated-marketplace/src/functions.rs b/pallets/gated-marketplace/src/functions.rs index f6924d9e..ee3073f0 100644 --- a/pallets/gated-marketplace/src/functions.rs +++ b/pallets/gated-marketplace/src/functions.rs @@ -176,7 +176,7 @@ impl Pallet { AccountOrApplication::Application(application_id) => >::iter() .find_map(|(acc, m_id, app_id)| { if m_id == marketplace_id && app_id == application_id { - return Some(acc) + return Some(acc); } None }) @@ -271,7 +271,7 @@ impl Pallet { match authority_type { MarketplaceRole::Owner => { ensure!(Self::owner_exist(marketplace_id), Error::::OwnerNotFound); - return Err(Error::::CantRemoveOwner.into()) + return Err(Error::::CantRemoveOwner.into()); }, MarketplaceRole::Admin => { // Admins can not delete themselves @@ -338,7 +338,7 @@ impl Pallet { if let Some(a) = pallet_uniques::Pallet::::owner(collection_id, item_id) { ensure!(a == authority, Error::::NotOwner); } else { - return Err(Error::::CollectionNotFound.into()) + return Err(Error::::CollectionNotFound.into()); } //ensure the price is valid @@ -414,7 +414,7 @@ impl Pallet { if let Some(a) = pallet_uniques::Pallet::::owner(collection_id, item_id) { ensure!(a != authority, Error::::CannotCreateOffer); } else { - return Err(Error::::CollectionNotFound.into()) + return Err(Error::::CollectionNotFound.into()); } //ensure the holder of NFT is in the same marketplace as the caller making the offer @@ -1128,10 +1128,12 @@ impl Pallet { .map_err(|_| Error::::ApplicationNotFound)?; match application.status { - ApplicationStatus::Pending => - return Err(Error::::ApplicationStatusStillPending.into()), - ApplicationStatus::Approved => - return Err(Error::::ApplicationHasAlreadyBeenApproved.into()), + ApplicationStatus::Pending => { + return Err(Error::::ApplicationStatusStillPending.into()) + }, + ApplicationStatus::Approved => { + return Err(Error::::ApplicationHasAlreadyBeenApproved.into()) + }, ApplicationStatus::Rejected => { //If status is Rejected, we need to delete the previous application from all the // storage sources. @@ -1217,10 +1219,10 @@ impl Pallet { for offer in offers { let offer_info = >::get(offer).ok_or(Error::::OfferNotFound)?; //ensure the offer_type is SellOrder, because this vector also contains buy offers. - if offer_info.marketplace_id == marketplace_id && - offer_info.offer_type == OfferType::SellOrder + if offer_info.marketplace_id == marketplace_id + && offer_info.offer_type == OfferType::SellOrder { - return Err(Error::::OfferAlreadyExists.into()) + return Err(Error::::OfferAlreadyExists.into()); } } } @@ -1240,7 +1242,7 @@ impl Pallet { //We need to check if the owner is in the marketplace if let Some(owner) = pallet_uniques::Pallet::::owner(*class_id, *instance_id) { if Self::is_authorized(owner, marketplace_id, Permission::EnlistSellOffer).is_ok() { - return Ok(()) + return Ok(()); } } Err(Error::::OwnerNotInMarketplace.into()) @@ -1296,7 +1298,7 @@ impl Pallet { if let Some(a) = pallet_uniques::Pallet::::owner(collection_id, item_id) { ensure!(a == who, Error::::NotOwner); } else { - return Err(Error::::CollectionNotFound.into()) + return Err(Error::::CollectionNotFound.into()); } let redemption_data: RedemptionData = RedemptionData { diff --git a/pallets/gated-marketplace/src/lib.rs b/pallets/gated-marketplace/src/lib.rs index c9fa43f6..c3f3fce1 100644 --- a/pallets/gated-marketplace/src/lib.rs +++ b/pallets/gated-marketplace/src/lib.rs @@ -404,8 +404,9 @@ pub mod pallet { let who = ensure_signed(origin)?; match block_args { BlockUserArgs::BlockUser(user) => Self::do_block_user(who, marketplace_id, user), - BlockUserArgs::UnblockUser(user) => - Self::do_unblock_user(who, marketplace_id, user), + BlockUserArgs::UnblockUser(user) => { + Self::do_unblock_user(who, marketplace_id, user) + }, } } @@ -818,10 +819,12 @@ pub mod pallet { ) -> DispatchResult { let who = ensure_signed(origin)?; match redeem { - RedeemArgs::AskForRedemption { collection_id, item_id } => - return Self::do_ask_for_redeem(who, marketplace, collection_id, item_id), - RedeemArgs::AcceptRedemption(redemption_id) => - return Self::do_accept_redeem(who, marketplace, redemption_id), + RedeemArgs::AskForRedemption { collection_id, item_id } => { + return Self::do_ask_for_redeem(who, marketplace, collection_id, item_id) + }, + RedeemArgs::AcceptRedemption(redemption_id) => { + return Self::do_accept_redeem(who, marketplace, redemption_id) + }, } } diff --git a/pallets/gated-marketplace/src/tests.rs b/pallets/gated-marketplace/src/tests.rs index e88400f8..e159b7bc 100644 --- a/pallets/gated-marketplace/src/tests.rs +++ b/pallets/gated-marketplace/src/tests.rs @@ -238,8 +238,8 @@ fn apply_to_marketplace_works() { )); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending).len() == - 1 + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending).len() + == 1 ); }); } @@ -266,8 +266,8 @@ fn apply_with_custodian_works() { )); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending).len() == - 1 + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending).len() + == 1 ); assert!(GatedMarketplace::custodians(4, m_id).pop().is_some()); }); @@ -1487,16 +1487,16 @@ fn remove_marketplace_deletes_storage_from_applicants_by_marketplace_status_pend None )); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) == - vec![3] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) + == vec![3] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) + == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) + == vec![] ); assert_ok!(GatedMarketplace::remove_marketplace(RuntimeOrigin::signed(1), m_id)); @@ -1505,12 +1505,12 @@ fn remove_marketplace_deletes_storage_from_applicants_by_marketplace_status_pend GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) + == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) + == vec![] ); assert!(GatedMarketplace::marketplaces(m_id).is_none()); }); @@ -1549,12 +1549,12 @@ fn remove_marketplace_deletes_storage_from_applicants_by_marketplace_status_appr GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) == - vec![3] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) + == vec![3] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) + == vec![] ); assert_ok!(GatedMarketplace::remove_marketplace(RuntimeOrigin::signed(1), m_id)); @@ -1563,12 +1563,12 @@ fn remove_marketplace_deletes_storage_from_applicants_by_marketplace_status_appr GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) + == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) + == vec![] ); assert!(GatedMarketplace::marketplaces(m_id).is_none()); }); @@ -1607,12 +1607,12 @@ fn remove_marketplace_deletes_storage_from_applicants_by_marketplace_status_reje GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) + == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) == - vec![3] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) + == vec![3] ); assert_ok!(GatedMarketplace::remove_marketplace(RuntimeOrigin::signed(1), m_id)); @@ -1621,12 +1621,12 @@ fn remove_marketplace_deletes_storage_from_applicants_by_marketplace_status_reje GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Approved) + == vec![] ); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) == - vec![] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Rejected) + == vec![] ); assert!(GatedMarketplace::marketplaces(m_id).is_none()); }); @@ -1655,8 +1655,8 @@ fn remove_marketplace_deletes_storage_from_applicantions_by_account_works() { )); let app_id = GatedMarketplace::applications_by_account(3, m_id).unwrap(); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) == - vec![3] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) + == vec![3] ); assert_ok!(GatedMarketplace::enroll( RuntimeOrigin::signed(1), @@ -1704,8 +1704,8 @@ fn remove_marketplace_deletes_storage_from_applications_works() { let app_id = GatedMarketplace::applications_by_account(3, m_id).unwrap(); assert!( - GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) == - vec![3] + GatedMarketplace::applicants_by_marketplace(m_id, ApplicationStatus::Pending) + == vec![3] ); assert_ok!(GatedMarketplace::enroll( RuntimeOrigin::signed(1), diff --git a/pallets/mapped-assets/Cargo.toml b/pallets/mapped-assets/Cargo.toml index 7f06d8a2..7e8b3a30 100644 --- a/pallets/mapped-assets/Cargo.toml +++ b/pallets/mapped-assets/Cargo.toml @@ -17,21 +17,21 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.1.1", default-features = false, features = [ "derive" ] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } # Needed for various traits. In our case, `OnFinalize`. -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } # Needed for type-safe access to storage DB. -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } # `system` module provides us with all sorts of useful stuff and macros depend on it being around. -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } pallet-rbac = { default-features = false, version = "4.0.0-dev", path = "../rbac/" } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } [features] default = ["std"] diff --git a/pallets/mapped-assets/src/functions.rs b/pallets/mapped-assets/src/functions.rs index 98f0c4bf..e9ffaf55 100644 --- a/pallets/mapped-assets/src/functions.rs +++ b/pallets/mapped-assets/src/functions.rs @@ -150,21 +150,21 @@ impl, I: 'static> Pallet { None => return DepositConsequence::UnknownAsset, }; if increase_supply && details.supply.checked_add(&amount).is_none() { - return DepositConsequence::Overflow + return DepositConsequence::Overflow; } if let Some(balance) = Self::maybe_balance(id, who) { if balance.checked_add(&amount).is_none() { - return DepositConsequence::Overflow + return DepositConsequence::Overflow; } } else { if amount < details.min_balance { - return DepositConsequence::BelowMinimum + return DepositConsequence::BelowMinimum; } if !details.is_sufficient && !frame_system::Pallet::::can_inc_consumer(who) { - return DepositConsequence::CannotCreate + return DepositConsequence::CannotCreate; } if details.is_sufficient && details.sufficients.checked_add(1).is_none() { - return DepositConsequence::Overflow + return DepositConsequence::Overflow; } } @@ -184,20 +184,20 @@ impl, I: 'static> Pallet { None => return UnknownAsset, }; if details.supply.checked_sub(&amount).is_none() { - return Underflow + return Underflow; } if details.is_frozen { - return Frozen + return Frozen; } if amount.is_zero() { - return Success + return Success; } let account = match Account::::get(id, who) { Some(a) => a, None => return NoFunds, }; if account.is_frozen { - return Frozen + return Frozen; } if let Some(rest) = account.balance.checked_sub(&amount) { if let Some(frozen) = T::Freezer::frozen_balance(id, who) { @@ -288,7 +288,7 @@ impl, I: 'static> Pallet { Ok(dust) => actual.saturating_add(dust), //< guaranteed by reducible_balance Err(e) => { debug_assert!(false, "passed from reducible_balance; qed"); - return Err(e) + return Err(e); }, }; @@ -454,7 +454,7 @@ impl, I: 'static> Pallet { ) -> DispatchResult, ) -> DispatchResult { if amount.is_zero() { - return Ok(()) + return Ok(()); } Self::can_increase(id, beneficiary, amount, true).into_result()?; @@ -570,7 +570,7 @@ impl, I: 'static> Pallet { ) -> DispatchResult, ) -> Result { if amount.is_zero() { - return Ok(amount) + return Ok(amount); } let actual = Self::prep_debit(id, target, amount, f)?; @@ -591,7 +591,7 @@ impl, I: 'static> Pallet { debug_assert!(account.balance.is_zero(), "checked in prep; qed"); target_died = Some(Self::dead_account(target, details, &account.reason, false)); if let Some(Remove) = target_died { - return Ok(()) + return Ok(()); } }; *maybe_account = Some(account); @@ -644,7 +644,7 @@ impl, I: 'static> Pallet { ) -> Result<(T::Balance, Option), DispatchError> { // Early exit if no-op. if amount.is_zero() { - return Ok((amount, None)) + return Ok((amount, None)); } let details = Asset::::get(id).ok_or(Error::::Unknown)?; @@ -668,7 +668,7 @@ impl, I: 'static> Pallet { // Skip if source == dest if source == dest { - return Ok(()) + return Ok(()); } // Burn any dust if needed. @@ -714,7 +714,7 @@ impl, I: 'static> Pallet { Some(Self::dead_account(source, details, &source_account.reason, false)); if let Some(Remove) = source_died { Account::::remove(id, &source); - return Ok(()) + return Ok(()); } } Account::::insert(id, &source, &source_account); @@ -809,7 +809,7 @@ impl, I: 'static> Pallet { let _ = Self::dead_account(&who, &mut details, &v.reason, true); dead_accounts.push(who); if dead_accounts.len() >= (max_items as usize) { - break + break; } } remaining_accounts = details.accounts; @@ -849,7 +849,7 @@ impl, I: 'static> Pallet { removed_approvals = removed_approvals.saturating_add(1); details.approvals = details.approvals.saturating_sub(1); if removed_approvals >= max_items { - break + break; } } Self::deposit_event(Event::ApprovalsDestroyed { @@ -1123,7 +1123,7 @@ impl, I: 'static> Pallet { maybe_check_admin: Option, ) -> DispatchResult { if amount.is_zero() { - return Ok(()) + return Ok(()); } Self::prep_debit( asset_id, @@ -1134,7 +1134,7 @@ impl, I: 'static> Pallet { Asset::::try_mutate(asset_id, |maybe_details| -> DispatchResult { let asset = maybe_details.as_mut().ok_or(Error::::UnknownAsset)?; if amount < asset.min_balance { - return Err(TokenError::BelowMinimum.into()) + return Err(TokenError::BelowMinimum.into()); } if let Some(admin) = maybe_check_admin { ensure!(admin == asset.admin, Error::::NoPermission); diff --git a/pallets/mapped-assets/src/impl_stored_map.rs b/pallets/mapped-assets/src/impl_stored_map.rs index a4669c77..9e9af9d4 100644 --- a/pallets/mapped-assets/src/impl_stored_map.rs +++ b/pallets/mapped-assets/src/impl_stored_map.rs @@ -42,7 +42,7 @@ impl, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> f if let Some(ref mut account) = maybe_account { account.extra = extra; } else { - return Err(DispatchError::NoProviders.into()) + return Err(DispatchError::NoProviders.into()); } } else { // They want to delete it. Let this pass if the item never existed anyway. diff --git a/pallets/mapped-assets/src/lib.rs b/pallets/mapped-assets/src/lib.rs index 1225ee01..fe0d4213 100644 --- a/pallets/mapped-assets/src/lib.rs +++ b/pallets/mapped-assets/src/lib.rs @@ -1159,7 +1159,7 @@ pub mod pallet { ensure!(details.status == AssetStatus::Live, Error::::LiveAsset); ensure!(origin == details.owner, Error::::NoPermission); if details.owner == owner { - return Ok(()) + return Ok(()); } let metadata_deposit = Metadata::::get(id).deposit; diff --git a/pallets/mapped-assets/src/types.rs b/pallets/mapped-assets/src/types.rs index 722a1a45..35bb1453 100644 --- a/pallets/mapped-assets/src/types.rs +++ b/pallets/mapped-assets/src/types.rs @@ -123,7 +123,7 @@ pub enum ExistenceReason { impl ExistenceReason { pub(crate) fn take_deposit(&mut self) -> Option { if !matches!(self, ExistenceReason::DepositHeld(_)) { - return None + return None; } if let ExistenceReason::DepositHeld(deposit) = sp_std::mem::replace(self, ExistenceReason::DepositRefunded) diff --git a/pallets/rbac/Cargo.toml b/pallets/rbac/Cargo.toml index 8fdf0650..23cb284e 100644 --- a/pallets/rbac/Cargo.toml +++ b/pallets/rbac/Cargo.toml @@ -20,14 +20,14 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.1.1", default-features = false, features = [ "derive" ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } [features] default = ["std"] diff --git a/pallets/template/Cargo.toml b/pallets/template/Cargo.toml index f2712398..85df991a 100644 --- a/pallets/template/Cargo.toml +++ b/pallets/template/Cargo.toml @@ -20,16 +20,16 @@ log = { version = "0.4.14", default-features = false } scale-info = { version = "2.1.1", default-features = false, features = [ "derive" ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", optional = true } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", optional = true } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } [features] default = ["std"] diff --git a/rust-toolchain.toml b/rust-toolchain.toml deleted file mode 100644 index e75c2e20..00000000 --- a/rust-toolchain.toml +++ /dev/null @@ -1,5 +0,0 @@ -[toolchain] -channel = "nightly-2023-01-01" -components = [ "rustfmt" ] -targets = [ "wasm32-unknown-unknown" ] -profile = "minimal" \ No newline at end of file