From ca287dc7b5903dc6a4c67a2814f362b1c6ccfda0 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Wed, 13 Mar 2024 14:07:04 -0300 Subject: [PATCH 01/13] Feat: updated to polkadot_sdk 1.8.0 and migrated to workspace dependencies --- Cargo.toml | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 51d95a9a..0d8b4ba2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,5 +4,45 @@ members = [ "INV4/pallet-inv4", "OCIF/staking", "pallet-checked-inflation", - "pallet-rings" + "pallet-rings", ] + +[workspace.dependencies] + +# crates.io dependencies +codec = { package = "parity-scale-codec", version = "3.6.9", features = [ + "derive", +], default-features = false } +log = { version = "0.4.21", default-features = false } +num-traits = { version = "0.2.18", default-features = false } +scale-info = { version = "2.10.0", default-features = false, features = [ + "derive", +] } +serde = { version = "1.0.197", features = ["derive"] } +smallvec = { version = "1.13.1" } # { inv4_og_version "1.6.1"} + +# polkadot-sdk dependencies +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } + + +# dev dependencies +orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } +orml-tokens2 = { package = "orml-tokens", git = "https://github.com/arrudagates/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } +orml-traits2 = { package = "orml-traits", git = "https://github.com/arrudagates/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } From aef2d0673e673148927cc244e01068331700ce64 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Wed, 13 Mar 2024 14:07:31 -0300 Subject: [PATCH 02/13] Refactor: migrated to workspace dependencies --- INV4/pallet-inv4/Cargo.toml | 42 +++++++++++------------ OCIF/staking/Cargo.toml | 38 ++++++++++----------- pallet-checked-inflation/Cargo.toml | 30 ++++++++-------- pallet-rings/Cargo.toml | 53 +++++++++++++++-------------- primitives/Cargo.toml | 16 ++++----- 5 files changed, 90 insertions(+), 89 deletions(-) diff --git a/INV4/pallet-inv4/Cargo.toml b/INV4/pallet-inv4/Cargo.toml index 7e0b40d3..0ef929be 100644 --- a/INV4/pallet-inv4/Cargo.toml +++ b/INV4/pallet-inv4/Cargo.toml @@ -9,39 +9,39 @@ repository = 'https://github.com/InvArch/InvArch-Frames' version = '0.1.0-dev' [dependencies] -serde = { version = "1.0.132", optional = true } -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -smallvec = "1.6.1" +serde = { workspace = true, optional = true } +codec = {workspace = true} +sp-runtime = {workspace = true} +sp-arithmetic = {workspace = true} +sp-std = {workspace = true} +frame-support = {workspace = true} +smallvec = {workspace = true} -scale-info = { version = "2.0.0", features = ["derive"], default-features = false } +scale-info = {workspace = true} -log = { version = "0.4.14", default-features = false } +log = {workspace = true} # InvArch dependencies primitives = { package = "invarch-primitives", path = "../../primitives", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } +sp-io = {workspace = true} +sp-core = {workspace = true} -pallet-balances = { git = 'https://github.com/paritytech/substrate.git', default-features = false , branch = "polkadot-v0.9.43" } +pallet-balances = {workspace = true} -frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', default-features = false, optional = true , branch = "polkadot-v0.9.43" } +frame-system = {workspace = true} # frame-benchmarking requires system +frame-benchmarking = { workspace = true, optional = true } -orml-tokens2 = { package = "orml-tokens", git = "https://github.com/arrudagates/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } +orml-tokens2 = {workspace = true} -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.43" } +xcm = {workspace = true} [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-traits2 = { package = "orml-traits", git = "https://github.com/arrudagates/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } +sp-core = {workspace = true} +orml-traits = {workspace = true} +orml-traits2 = {workspace = true} +orml-tokens = {workspace = true} +orml-asset-registry = {workspace = true} [features] default = ["std"] diff --git a/OCIF/staking/Cargo.toml b/OCIF/staking/Cargo.toml index 2118b001..85f88bb0 100644 --- a/OCIF/staking/Cargo.toml +++ b/OCIF/staking/Cargo.toml @@ -12,31 +12,31 @@ version = '0.1.0-dev' targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false } -scale-info = { version = "2.1.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.140", features = ["derive"], optional = true } +codec = {workspace = true} +scale-info = {workspace = true} +serde = {workspace = true, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -num-traits = { version = "0.2", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true , branch = "polkadot-v0.9.43" } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true , branch = "polkadot-v0.9.43" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-staking = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } +frame-support = {workspace = true} +frame-system = {workspace = true} +num-traits = {workspace = true} +pallet-balances = {workspace = true, optional = true } +pallet-session = {workspace = true} +pallet-timestamp = {workspace = true, optional = true } +sp-arithmetic = {workspace = true} +sp-core = {workspace = true} +sp-io = {workspace = true} +sp-runtime = {workspace = true} +sp-staking = {workspace = true} +sp-std = {workspace = true} pallet-inv4 = { path = "../../INV4/pallet-inv4", default-features = false } -frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', default-features = false, optional = true , branch = "polkadot-v0.9.43" } +frame-benchmarking = {workspace = true, optional = true } [dev-dependencies] -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.43" } +orml-traits = {workspace = true} +orml-tokens = {workspace = true} +xcm = {workspace = true} [features] default = ["std"] diff --git a/pallet-checked-inflation/Cargo.toml b/pallet-checked-inflation/Cargo.toml index 75b6931d..478c7cb2 100644 --- a/pallet-checked-inflation/Cargo.toml +++ b/pallet-checked-inflation/Cargo.toml @@ -12,25 +12,25 @@ version = '0.1.0-dev' targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false } -scale-info = { version = "2.1.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.140", features = ["derive"], optional = true } +codec = {workspace = true} +scale-info = {workspace = true} +serde = {workspace = true, optional = true} -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -num-traits = { version = "0.2", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-staking = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } +frame-support = {workspace = true} +frame-system = {workspace = true} +num-traits = {workspace = true} +pallet-session = {workspace = true} +sp-arithmetic = {workspace = true} +sp-core = {workspace = true} +sp-io = {workspace = true} +sp-runtime = {workspace = true} +sp-staking = {workspace = true} +sp-std = {workspace = true} -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" } +frame-benchmarking = {workspace = true, optional = true} [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +pallet-balances = {workspace = true} [features] default = ["std"] diff --git a/pallet-rings/Cargo.toml b/pallet-rings/Cargo.toml index 3896c2c2..4447f92c 100644 --- a/pallet-rings/Cargo.toml +++ b/pallet-rings/Cargo.toml @@ -12,39 +12,40 @@ version = '0.1.0-dev' targets = ["x86_64-unknown-linux-gnu"] [dependencies] -log = { version = "0.4.14", default-features = false } -codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false } -scale-info = { version = "2.1.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.140", features = ["derive"], optional = true } +log = {workspace = true} +codec = {workspace = true} +scale-info = {workspace = true} +serde = {workspace = true, optional = true} -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -num-traits = { version = "0.2", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true , branch = "polkadot-v0.9.43" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-staking = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.43" } +frame-support = {workspace = true} +frame-system = {workspace = true} +num-traits = {workspace = true} +pallet-balances = {workspace = true} +pallet-session = {workspace = true} +pallet-timestamp = { workspace = true, optional = true } +sp-arithmetic = {workspace = true} +sp-core = {workspace = true} +sp-io = {workspace = true} +sp-runtime = {worspace = true} +sp-staking = {worspace = true} +sp-std = {worspace = true} pallet-inv4 = { path = "../INV4/pallet-inv4", default-features = false } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } -xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +pallet-xcm = {workspace = true} +xcm = {workspace = true} +xcm-executor = {workspace = true} -frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', default-features = false, optional = true, branch = "polkadot-v0.9.43" } +frame-benchmarking = {workspace = true} [dev-dependencies] -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-traits2 = { package = "orml-traits", git = "https://github.com/arrudagates/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-tokens2 = { package = "orml-tokens", git = "https://github.com/arrudagates/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" } +orml-traits = { workspace = true} +orml-traits2 = { workspace = true} +orml-tokens = { workspace = true} +orml-tokens2 = { workspace = true} +orml-asset-registry = { workspace = true} +xcm-builder = {workspace = true} + [features] default = ["std"] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 34ed2dc9..23d4374e 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -10,15 +10,15 @@ repository = 'https://github.com/InvArch/InvArch-Pallet-Library/ipt' [dependencies] -serde = { version = "1.0.132", optional = true } -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } -scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } +serde = { workspace = true, optional = true } +codec = {workspace = true} +scale-info = {workspace = true} -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" } +frame-system = {workspace = true} +sp-core = {workspace = true} +sp-runtime = {workspace = true} +sp-std = {workspace = true} +sp-io = {workspace = true} [features] From 5d6b0915a4a81e2ed7a4e44a36be0a2d7275e64f Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Wed, 13 Mar 2024 14:23:00 -0300 Subject: [PATCH 03/13] Fix: changed branch so crates show as their latest verion from 1.8.0 release --- Cargo.toml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0d8b4ba2..cdaf29ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,22 +22,22 @@ serde = { version = "1.0.197", features = ["derive"] } smallvec = { version = "1.13.1" } # { inv4_og_version "1.6.1"} # polkadot-sdk dependencies -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } -xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.8.0" } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } # dev dependencies From d1a3c7efb5241c1c36ce77852cd1186c2989c380 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Thu, 14 Mar 2024 15:42:30 -0300 Subject: [PATCH 04/13] Fix: updated to polkadot_sdk 1.8.0 --- pallet-checked-inflation/src/lib.rs | 6 ++--- pallet-checked-inflation/src/mock.rs | 37 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/pallet-checked-inflation/src/lib.rs b/pallet-checked-inflation/src/lib.rs index 6223148e..7bf741db 100644 --- a/pallet-checked-inflation/src/lib.rs +++ b/pallet-checked-inflation/src/lib.rs @@ -69,9 +69,8 @@ pub mod pallet { pub trait Config: frame_system::Config { /// The overarching event type. type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// The currency (token) used in this pallet. - type Currency: LockableCurrency + type Currency: LockableCurrency> + ReservableCurrency + Currency; @@ -102,7 +101,8 @@ pub mod pallet { /// Block that the next era starts at. #[pallet::storage] #[pallet::getter(fn next_era_starting_block)] - pub type NextEraStartingBlock = StorageValue<_, T::BlockNumber, ValueQuery>; + // zz + pub type NextEraStartingBlock = StorageValue<_, BlockNumberFor, ValueQuery>; /// Total token supply at the very beginning of the year before any inflation has been minted. #[pallet::storage] diff --git a/pallet-checked-inflation/src/mock.rs b/pallet-checked-inflation/src/mock.rs index 84db2ebd..72c2b914 100644 --- a/pallet-checked-inflation/src/mock.rs +++ b/pallet-checked-inflation/src/mock.rs @@ -2,19 +2,17 @@ use super::*; use crate::inflation::InflationMethod; use core::convert::TryFrom; use frame_support::{ - parameter_types, + derive_impl, parameter_types, traits::{ConstU128, ConstU32, ConstU64, Currency, Hooks, OnUnbalanced}, }; use pallet_balances::AccountData; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, Perbill}; +use sp_runtime::{traits::IdentityLookup, BuildStorage, Perbill}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type Balance = u128; type AccountId = u32; -type BlockNumber = u64; type NegativeImbalance = >::NegativeImbalance; pub const EXISTENTIAL_DEPOSIT: Balance = 1_000_000_000; @@ -23,27 +21,27 @@ pub const INFLATION_RECEIVER: AccountId = 0; pub const ALICE: AccountId = 1; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Event, Config}, - CheckedInflation: pallet::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + CheckedInflation: pallet, } ); +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { + type RuntimeTask = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; + // type BlockNumber = BlockNumber; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + // type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -61,6 +59,7 @@ impl frame_system::Config for Test { type MaxConsumers = ConstU32<16>; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<50>; /// The type for recording an account's balance. @@ -72,11 +71,11 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; - - type MaxHolds = ConstU32<1>; + type RuntimeFreezeReason = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxFreezes = (); - type HoldIdentifier = [u8; 8]; + // type HoldIdentifier = [u8; 8]; } parameter_types! { @@ -115,8 +114,8 @@ pub const GENESIS_ISSUANCE: u128 = 11700000000000000000; impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); pallet_balances::GenesisConfig:: { From 7a1146bb47020d239e6a6a4ee68a3d95d6411ccc Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Thu, 14 Mar 2024 15:47:20 -0300 Subject: [PATCH 05/13] Fix: removed reminder --- pallet-checked-inflation/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pallet-checked-inflation/src/lib.rs b/pallet-checked-inflation/src/lib.rs index 7bf741db..e20451e6 100644 --- a/pallet-checked-inflation/src/lib.rs +++ b/pallet-checked-inflation/src/lib.rs @@ -101,7 +101,6 @@ pub mod pallet { /// Block that the next era starts at. #[pallet::storage] #[pallet::getter(fn next_era_starting_block)] - // zz pub type NextEraStartingBlock = StorageValue<_, BlockNumberFor, ValueQuery>; /// Total token supply at the very beginning of the year before any inflation has been minted. From 3c369cdd327731fa66455eb8c07afe831da07f97 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Thu, 14 Mar 2024 16:33:37 -0300 Subject: [PATCH 06/13] Style: Removed types that are assigned to unit () --- pallet-checked-inflation/src/mock.rs | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/pallet-checked-inflation/src/mock.rs b/pallet-checked-inflation/src/mock.rs index 72c2b914..f0322edc 100644 --- a/pallet-checked-inflation/src/mock.rs +++ b/pallet-checked-inflation/src/mock.rs @@ -31,51 +31,30 @@ frame_support::construct_runtime!( #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type RuntimeTask = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; - // type BlockNumber = BlockNumber; type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - // type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type BlockWeights = (); - type BlockLength = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type DbWeight = (); - type BaseCallFilter = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = ConstU32<16>; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<50>; - /// The type for recording an account's balance. type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128; type AccountStore = System; - type WeightInfo = (); type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; - type RuntimeFreezeReason = (); - type RuntimeHoldReason = (); - type FreezeIdentifier = (); - type MaxFreezes = (); - // type HoldIdentifier = [u8; 8]; } parameter_types! { From 93f2b2c933c4d5485684509ba1651960bd146424 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Thu, 21 Mar 2024 13:02:17 -0300 Subject: [PATCH 07/13] Fix: right versions of sdk v1.6.0 --- Cargo.toml | 58 +++++++++-------- INV4/pallet-inv4/Cargo.toml | 98 ++++++++++++++++++----------- OCIF/staking/Cargo.toml | 78 +++++++++++------------ pallet-checked-inflation/Cargo.toml | 28 ++++----- pallet-rings/Cargo.toml | 50 +++++++-------- primitives/Cargo.toml | 17 ++--- rust-toolchain.toml | 14 ++++- 7 files changed, 194 insertions(+), 149 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cdaf29ee..bbb44681 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,39 +10,45 @@ members = [ [workspace.dependencies] # crates.io dependencies -codec = { package = "parity-scale-codec", version = "3.6.9", features = [ +codec = { package = "parity-scale-codec", version = "3.6.5", features = [ "derive", ], default-features = false } -log = { version = "0.4.21", default-features = false } -num-traits = { version = "0.2.18", default-features = false } +log = { version = "0.4.20", default-features = false } +num-traits = { version = "0.2", default-features = false } scale-info = { version = "2.10.0", default-features = false, features = [ "derive", ] } -serde = { version = "1.0.197", features = ["derive"] } -smallvec = { version = "1.13.1" } # { inv4_og_version "1.6.1"} +serde = { version = "1.0.189", features = ["derive"] } +smallvec = { version = "1.6.1" } # polkadot-sdk dependencies -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } -xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-crates-io-v1.8.0" } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } # dev dependencies -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-tokens2 = { package = "orml-tokens", git = "https://github.com/arrudagates/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } -orml-traits2 = { package = "orml-traits", git = "https://github.com/arrudagates/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } + +orml-asset-registry = { git = "https://github.com/InvArch/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" } +orml-tokens2 = { package = "orml-tokens", git = "https://github.com/arrudagates/open-runtime-module-library.git", default-features = false, rev = "bc6b41e8a9539971a2da5d62cf8f550cde985f00" } +orml-traits2 = { package = "orml-traits", git = "https://github.com/arrudagates/open-runtime-module-library.git", default-features = false, rev = "bc6b41e8a9539971a2da5d62cf8f550cde985f00" } + +orml-tokens = { package = "orml-tokens", git = "https://github.com/InvArch/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" } +orml-traits = { package = "orml-traits", git = "https://github.com/InvArch/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" } + +# orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } +# orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } +# orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, rev = "7ecebeab7e3dbc2226ed58d32ee159271a8176ae" } diff --git a/INV4/pallet-inv4/Cargo.toml b/INV4/pallet-inv4/Cargo.toml index 0ef929be..cba2b0e8 100644 --- a/INV4/pallet-inv4/Cargo.toml +++ b/INV4/pallet-inv4/Cargo.toml @@ -10,58 +10,86 @@ version = '0.1.0-dev' [dependencies] serde = { workspace = true, optional = true } -codec = {workspace = true} -sp-runtime = {workspace = true} -sp-arithmetic = {workspace = true} -sp-std = {workspace = true} -frame-support = {workspace = true} -smallvec = {workspace = true} +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ + "derive", "max-encoded-len" +] } +sp-runtime = { workspace = true, default-features = false } +sp-arithmetic = { workspace = true, default-features = false } +sp-std = { workspace = true, default-features = false } +frame-support = { workspace = true, default-features = false } +smallvec = { workspace = true } -scale-info = {workspace = true} +scale-info = { workspace = true, default-features = false } -log = {workspace = true} +log = { workspace = true, default-features = false } # InvArch dependencies primitives = { package = "invarch-primitives", path = "../../primitives", default-features = false } -sp-io = {workspace = true} -sp-core = {workspace = true} +sp-io = { workspace = true, default-features = false } +sp-core = { workspace = true, default-features = false } -pallet-balances = {workspace = true} +pallet-balances = { workspace = true, default-features = false } -frame-system = {workspace = true} # frame-benchmarking requires system -frame-benchmarking = { workspace = true, optional = true } +frame-system = { workspace = true, default-features = false } # frame-benchmarking requires system +frame-benchmarking = { workspace = true, default-features = false, optional = true } -orml-tokens2 = {workspace = true} -xcm = {workspace = true} +xcm = { workspace = true, default-features = false } +orml-tokens2 = { workspace = true, default-features = false } [dev-dependencies] -sp-core = {workspace = true} -orml-traits = {workspace = true} -orml-traits2 = {workspace = true} -orml-tokens = {workspace = true} -orml-asset-registry = {workspace = true} + +orml-traits2 = { workspace = true, default-features = false } +orml-tokens = { workspace = true, default-features = false } +orml-traits = { workspace = true, default-features = false } +orml-asset-registry = { workspace = true, default-features = false } + [features] default = ["std"] std = [ - "serde", - "codec/std", - "sp-runtime/std", - "sp-std/std", - "frame-support/std", - "frame-system/std", - "sp-io/std", - "scale-info/std", - "pallet-balances/std", - "frame-benchmarking?/std", - "orml-asset-registry/std", - "orml-tokens/std", + "serde", + "codec/std", + "sp-runtime/std", + "sp-std/std", + "frame-support/std", + "frame-system/std", + "sp-io/std", + "scale-info/std", + "pallet-balances/std", + "frame-benchmarking?/std", + "xcm/std", + "orml-asset-registry/std", + "orml-tokens/std", + "orml-tokens2/std", + "orml-traits/std", + "orml-traits2/std", ] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "frame-system/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "frame-system/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] + + +# std = [ +# "serde", +# "codec/std", +# "sp-runtime/std", +# "sp-std/std", +# "frame-support/std", +# "frame-system/std", +# "sp-io/std", +# "sp-core/std", +# "scale-info/std", +# "pallet-balances/std", +# "frame-benchmarking?/std", +# # "orml-asset-registry/std", +# "orml-tokens/std", +# # "orml-tokens2/std", +# # "orml-traits/std", +# # "orml-traits2/std", +# "xcm/std", +# ] diff --git a/OCIF/staking/Cargo.toml b/OCIF/staking/Cargo.toml index 85f88bb0..ea865a42 100644 --- a/OCIF/staking/Cargo.toml +++ b/OCIF/staking/Cargo.toml @@ -12,56 +12,56 @@ version = '0.1.0-dev' targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = {workspace = true} -scale-info = {workspace = true} -serde = {workspace = true, optional = true } +codec = { workspace = true, default-features = false } +scale-info = { workspace = true, default-features = false } +serde = { workspace = true, optional = true } -frame-support = {workspace = true} -frame-system = {workspace = true} -num-traits = {workspace = true} -pallet-balances = {workspace = true, optional = true } -pallet-session = {workspace = true} -pallet-timestamp = {workspace = true, optional = true } -sp-arithmetic = {workspace = true} -sp-core = {workspace = true} -sp-io = {workspace = true} -sp-runtime = {workspace = true} -sp-staking = {workspace = true} -sp-std = {workspace = true} +frame-support = { workspace = true, default-features = false } +frame-system = { workspace = true, default-features = false } +num-traits = { workspace = true, default-features = false } +pallet-balances = { workspace = true, default-features = false, optional = true } +pallet-session = { workspace = true, default-features = false } +pallet-timestamp = { workspace = true, default-features = false, optional = true } +sp-arithmetic = { workspace = true, default-features = false } +sp-core = { workspace = true, default-features = false } +sp-io = { workspace = true, default-features = false } +sp-runtime = { workspace = true, default-features = false } +sp-staking = { workspace = true, default-features = false } +sp-std = { workspace = true, default-features = false } pallet-inv4 = { path = "../../INV4/pallet-inv4", default-features = false } -frame-benchmarking = {workspace = true, optional = true } +frame-benchmarking = { workspace = true, default-features = false, optional = true } [dev-dependencies] -orml-traits = {workspace = true} -orml-tokens = {workspace = true} -xcm = {workspace = true} +orml-traits = { workspace = true, default-features = false } +orml-tokens = { workspace = true, default-features = false } +xcm = { workspace = true, default-features = false } [features] default = ["std"] std = [ - "serde", - "codec/std", - "scale-info/std", - "num-traits/std", - "sp-core/std", - "sp-runtime/std", - "sp-arithmetic/std", - "sp-io/std", - "sp-std/std", - "frame-support/std", - "frame-system/std", - "pallet-balances/std", - "pallet-session/std", - "pallet-timestamp/std", - "sp-staking/std", - "orml-traits/std", - "orml-tokens/std", + "serde", + "codec/std", + "scale-info/std", + "num-traits/std", + "sp-core/std", + "sp-runtime/std", + "sp-arithmetic/std", + "sp-io/std", + "sp-std/std", + "frame-support/std", + "frame-system/std", + "pallet-balances/std", + "pallet-session/std", + "pallet-timestamp/std", + "sp-staking/std", + "orml-traits/std", + "orml-tokens/std", ] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "frame-system/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "frame-system/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallet-checked-inflation/Cargo.toml b/pallet-checked-inflation/Cargo.toml index 478c7cb2..b4eaca0c 100644 --- a/pallet-checked-inflation/Cargo.toml +++ b/pallet-checked-inflation/Cargo.toml @@ -12,25 +12,25 @@ version = '0.1.0-dev' targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = {workspace = true} -scale-info = {workspace = true} +codec = {workspace = true, default-features = false} +scale-info = {workspace = true, default-features = false} serde = {workspace = true, optional = true} -frame-support = {workspace = true} -frame-system = {workspace = true} -num-traits = {workspace = true} -pallet-session = {workspace = true} -sp-arithmetic = {workspace = true} -sp-core = {workspace = true} -sp-io = {workspace = true} -sp-runtime = {workspace = true} -sp-staking = {workspace = true} -sp-std = {workspace = true} +frame-support = {workspace = true, default-features = false} +frame-system = {workspace = true, default-features = false} +num-traits = {workspace = true, default-features = false} +pallet-session = {workspace = true, default-features = false} +sp-arithmetic = {workspace = true, default-features = false} +sp-core = {workspace = true, default-features = false} +sp-io = {workspace = true, default-features = false} +sp-runtime = {workspace = true, default-features = false} +sp-staking = {workspace = true, default-features = false} +sp-std = {workspace = true, default-features = false} -frame-benchmarking = {workspace = true, optional = true} +frame-benchmarking = {workspace = true, default-features = false, optional = true} [dev-dependencies] -pallet-balances = {workspace = true} +pallet-balances = {workspace = true, default-features = false} [features] default = ["std"] diff --git a/pallet-rings/Cargo.toml b/pallet-rings/Cargo.toml index 4447f92c..fe031647 100644 --- a/pallet-rings/Cargo.toml +++ b/pallet-rings/Cargo.toml @@ -12,39 +12,39 @@ version = '0.1.0-dev' targets = ["x86_64-unknown-linux-gnu"] [dependencies] -log = {workspace = true} -codec = {workspace = true} -scale-info = {workspace = true} +log = {workspace = true, default-features = false} +codec = {workspace = true, default-features = false} +scale-info = {workspace = true, default-features = false} serde = {workspace = true, optional = true} -frame-support = {workspace = true} -frame-system = {workspace = true} -num-traits = {workspace = true} -pallet-balances = {workspace = true} -pallet-session = {workspace = true} -pallet-timestamp = { workspace = true, optional = true } -sp-arithmetic = {workspace = true} -sp-core = {workspace = true} -sp-io = {workspace = true} -sp-runtime = {worspace = true} -sp-staking = {worspace = true} -sp-std = {worspace = true} +frame-support = {workspace = true, default-features = false} +frame-system = {workspace = true, default-features = false} +num-traits = {workspace = true, default-features = false} +pallet-balances = {workspace = true, default-features = false} +pallet-session = {workspace = true, default-features = false} +pallet-timestamp = { workspace = true, default-features = false, optional = true } +sp-arithmetic = {workspace = true, default-features = false} +sp-core = {workspace = true, default-features = false} +sp-io = {workspace = true, default-features = false} +sp-runtime = {workspace = true} +sp-staking = {workspace = true} +sp-std = {workspace = true} pallet-inv4 = { path = "../INV4/pallet-inv4", default-features = false } -pallet-xcm = {workspace = true} -xcm = {workspace = true} -xcm-executor = {workspace = true} +pallet-xcm = {workspace = true, default-features = false} +xcm = {workspace = true, default-features = false} +xcm-executor = {workspace = true, default-features = false} -frame-benchmarking = {workspace = true} +frame-benchmarking = {workspace = true, default-features = false, optional = true} [dev-dependencies] -orml-traits = { workspace = true} -orml-traits2 = { workspace = true} -orml-tokens = { workspace = true} -orml-tokens2 = { workspace = true} -orml-asset-registry = { workspace = true} -xcm-builder = {workspace = true} +orml-traits = { workspace = true, default-features = false} +orml-traits2 = { workspace = true, default-features = false} +orml-tokens = { workspace = true, default-features = false} +orml-tokens2 = { workspace = true, default-features = false} +orml-asset-registry = { workspace = true, default-features = false} +xcm-builder = {workspace = true, default-features = false} [features] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 23d4374e..6c190c42 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -11,14 +11,14 @@ repository = 'https://github.com/InvArch/InvArch-Pallet-Library/ipt' [dependencies] serde = { workspace = true, optional = true } -codec = {workspace = true} -scale-info = {workspace = true} +codec = { workspace = true, default-features = false } +scale-info = { workspace = true, default-features = false } -frame-system = {workspace = true} -sp-core = {workspace = true} -sp-runtime = {workspace = true} -sp-std = {workspace = true} -sp-io = {workspace = true} +frame-system = { workspace = true, default-features = false } +sp-core = { workspace = true, default-features = false } +sp-runtime = { workspace = true, default-features = false } +sp-std = { workspace = true, default-features = false } +sp-io = { workspace = true, default-features = false } [features] @@ -30,5 +30,6 @@ std = [ "frame-system/std", "sp-std/std", "scale-info/std", - "sp-io/std" + "sp-io/std", + "sp-runtime/std", ] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 09139ba2..1a3d283f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,14 @@ [toolchain] -channel = "nightly-2024-02-06" +# channel = "nightly-2024-02-06" +channel = "1.74.0" targets = ["wasm32-unknown-unknown"] -components = [ "rustfmt", "rustc", "rust-std", "cargo", "clippy", "llvm-tools-preview"] +components = [ + "rustfmt", + "rustc", + "rust-std", + "cargo", + "clippy", + "llvm-tools", + "rust-analyzer", +] +profile = "minimal" From 2a813f36b7910f129c9a38086707c5c85924e145 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Thu, 21 Mar 2024 13:04:26 -0300 Subject: [PATCH 08/13] Feat: updated pallets to polkadot_sdk v1.6.0 --- INV4/pallet-inv4/src/account_derivation.rs | 2 +- INV4/pallet-inv4/src/dispatch.rs | 7 +- INV4/pallet-inv4/src/lib.rs | 4 +- INV4/pallet-inv4/src/origin.rs | 2 +- INV4/pallet-inv4/src/tests/mock.rs | 161 +++++++++++++++------ INV4/pallet-inv4/src/tests/mod.rs | 1 + INV4/pallet-inv4/src/voting.rs | 14 +- OCIF/staking/src/lib.rs | 4 +- OCIF/staking/src/testing/mock.rs | 34 ++--- pallet-rings/src/lib.rs | 4 +- pallet-rings/src/tests/mock.rs | 63 ++++---- pallet-rings/src/traits.rs | 2 +- 12 files changed, 179 insertions(+), 119 deletions(-) diff --git a/INV4/pallet-inv4/src/account_derivation.rs b/INV4/pallet-inv4/src/account_derivation.rs index e2abd15c..a9a0e4cb 100644 --- a/INV4/pallet-inv4/src/account_derivation.rs +++ b/INV4/pallet-inv4/src/account_derivation.rs @@ -14,7 +14,7 @@ use crate::{Config, Pallet}; use codec::{Compact, Encode}; use frame_support::traits::Get; use sp_io::hashing::blake2_256; -use xcm::latest::{BodyId, BodyPart, Junction, Junctions}; +use xcm::v3::{BodyId, BodyPart, Junction, Junctions}; /// Trait providing the XCM location and the derived account of a core. pub trait CoreAccountDerivation { /// Derives the core's AccountId. diff --git a/INV4/pallet-inv4/src/dispatch.rs b/INV4/pallet-inv4/src/dispatch.rs index ff026c2d..8721faee 100644 --- a/INV4/pallet-inv4/src/dispatch.rs +++ b/INV4/pallet-inv4/src/dispatch.rs @@ -11,10 +11,9 @@ use crate::{ origin::{INV4Origin, MultisigInternalOrigin}, Config, Error, }; -use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo}, - pallet_prelude::*, -}; +use frame_support::{dispatch::GetDispatchInfo, pallet_prelude::*}; + +use sp_runtime::traits::Dispatchable; /// Dispatch a call executing pre/post dispatch for proper fee handling. pub fn dispatch_call( diff --git a/INV4/pallet-inv4/src/lib.rs b/INV4/pallet-inv4/src/lib.rs index e87571db..07a0acd5 100644 --- a/INV4/pallet-inv4/src/lib.rs +++ b/INV4/pallet-inv4/src/lib.rs @@ -62,7 +62,7 @@ pub mod pallet { use super::*; use frame_support::{ - dispatch::{Dispatchable, GetDispatchInfo, Pays, PostDispatchInfo}, + dispatch::{GetDispatchInfo, Pays, PostDispatchInfo}, pallet_prelude::*, traits::{ fungibles, @@ -75,7 +75,7 @@ pub mod pallet { use primitives::CoreInfo; use scale_info::prelude::fmt::Display; use sp_runtime::{ - traits::{AtLeast32BitUnsigned, Member}, + traits::{AtLeast32BitUnsigned, Dispatchable, Member}, Perbill, }; use sp_std::{boxed::Box, convert::TryInto, vec::Vec}; diff --git a/INV4/pallet-inv4/src/origin.rs b/INV4/pallet-inv4/src/origin.rs index 8249a0ef..39a2328b 100644 --- a/INV4/pallet-inv4/src/origin.rs +++ b/INV4/pallet-inv4/src/origin.rs @@ -14,7 +14,7 @@ use crate::{ Config, }; use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::{error::BadOrigin, RuntimeDebug}; +use frame_support::{error::BadOrigin, pallet_prelude::RuntimeDebug}; use scale_info::TypeInfo; /// Origin representing a core by its id. diff --git a/INV4/pallet-inv4/src/tests/mock.rs b/INV4/pallet-inv4/src/tests/mock.rs index fcc29f1c..3a828386 100644 --- a/INV4/pallet-inv4/src/tests/mock.rs +++ b/INV4/pallet-inv4/src/tests/mock.rs @@ -2,10 +2,10 @@ use crate::{fee_handling::*, *}; use codec::{Decode, Encode}; use core::convert::TryFrom; use frame_support::{ - parameter_types, + derive_impl, parameter_types, traits::{ fungibles::Credit, ConstU128, ConstU32, ConstU64, Contains, Currency, EnsureOrigin, - EnsureOriginWithArg, GenesisBuild, + EnsureOriginWithArg, }, }; use frame_system::EnsureRoot; @@ -13,13 +13,12 @@ use orml_asset_registry::AssetMetadata; use pallet_balances::AccountData; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{AccountId32, BuildStorage}; use sp_std::{convert::TryInto, vec}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +// type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type Balance = u128; -type BlockNumber = u64; type AccountId = AccountId32; @@ -29,21 +28,73 @@ pub const ALICE: AccountId = AccountId::new([0u8; 32]); pub const BOB: AccountId = AccountId::new([1u8; 32]); pub const CHARLIE: AccountId = AccountId::new([2u8; 32]); pub const DAVE: AccountId = AccountId::new([3u8; 32]); +// AssetRegistry: orml_asset_registry, +// CoreAssets: orml_tokens2, + +// impl Config for Test { +// type RuntimeEvent = RuntimeEvent; +// type Currency = Balances; + +// type CoreId = ::CoreId; + +// type RuntimeCall = RuntimeCall; + +// type MaxCallers = MaxCallers; + +// type MaxMetadata = MaxCallers; + +// type RuntimeOrigin = RuntimeOrigin; + +// type CoreSeedBalance = CoreSeedBalance; + +// type CoreCreationFee = CoreCreationFee; + +// type RelayCoreCreationFee = RelayCoreCreationFee; + +// type RelayAssetId = RelayAssetId; + +// type AssetsProvider = Tokens; + +// type Tokens = Tokens; + +// type FeeCharger = FeeCharger; + +// type ParaId = ::ParaId; + +// type MaxCallSize = MaxCallSize; + +// type WeightInfo = (); +// } frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Event, Config}, - INV4: pallet::{Pallet, Call, Storage, Event, Origin}, - CoreAssets: orml_tokens2::{Pallet, Call, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, - AssetRegistry: orml_asset_registry::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Tokens: orml_tokens, + AssetRegistry: orml_asset_registry, + CoreAssets: orml_tokens2, + INV4: pallet, } ); +// System: frame_system, +// Balances: pallet_balances, +// INV4: pallet, +// Tokens: orml_tokens, + +// AssetRegistry: orml_asset_registry, +// CoreAssets: orml_tokens2, + +// System: frame_system::{Pallet, Call, Config, Storage, Event}, +// Balances: pallet_balances::{Pallet, Call, Storage, Event, Config}, +// INV4: pallet::{Pallet, Call, Storage, Event, Origin}, +// Tokens: orml_tokens::{Pallet, Call, Storage, Event}, +// AssetRegistry: orml_asset_registry::{Pallet, Call, Storage, Event, Config}, +// CoreAssets: orml_tokens2::{Pallet, Call, Storage, Event}, +// where +// Block = Block, +// NodeBlock = Block, +// UncheckedExtrinsic = UncheckedExtrinsic, pub struct TestBaseCallFilter; impl Contains for TestBaseCallFilter { @@ -52,16 +103,16 @@ impl Contains for TestBaseCallFilter { } } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; - type Lookup = IdentityLookup; - type Header = Header; + type Lookup = sp_runtime::traits::IdentityLookup; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -79,31 +130,20 @@ impl frame_system::Config for Test { type MaxConsumers = ConstU32<16>; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<50>; - /// The type for recording an account's balance. type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128; type AccountStore = System; - type WeightInfo = (); type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; - type MaxHolds = ConstU32<1>; - type FreezeIdentifier = (); - type MaxFreezes = (); - type HoldIdentifier = [u8; 8]; + type MaxFreezes = ConstU32<1>; } const UNIT: u128 = 1000000000000; -orml_traits2::parameter_type_with_key! { - pub CoreExistentialDeposits: |_currency_id: ::CoreId| -> Balance { - 1u128 - }; -} - pub struct CoreDustRemovalWhitelist; impl Contains for CoreDustRemovalWhitelist { fn contains(_: &AccountId) -> bool { @@ -112,15 +152,19 @@ impl Contains for CoreDustRemovalWhitelist { } pub struct DisallowIfFrozen; -impl orml_traits2::currency::OnTransfer::CoreId, Balance> - for DisallowIfFrozen +impl + orml_traits2::currency::OnTransfer< + ::AccountId, + ::CoreId, + Balance, + > for DisallowIfFrozen { fn on_transfer( currency_id: ::CoreId, _from: &AccountId, _to: &AccountId, _amount: Balance, - ) -> sp_runtime::DispatchResult { + ) -> sp_std::result::Result<(), orml_traits::parameters::sp_runtime::DispatchError> { if let Some(true) = INV4::is_asset_frozen(currency_id) { Err(sp_runtime::DispatchError::Token( sp_runtime::TokenError::Frozen, @@ -132,15 +176,23 @@ impl orml_traits2::currency::OnTransfer::Cor } pub struct HandleNewMembers; -impl orml_traits2::Happened<(AccountId, ::CoreId)> for HandleNewMembers { +impl + orml_traits2::Happened<( + ::AccountId, + ::CoreId, + )> for HandleNewMembers +{ fn happened((member, core_id): &(AccountId, ::CoreId)) { INV4::add_member(core_id, member) } } pub struct HandleRemovedMembers; -impl orml_traits2::Happened<(AccountId, ::CoreId)> - for HandleRemovedMembers +impl + orml_traits2::Happened<( + ::AccountId, + ::CoreId, + )> for HandleRemovedMembers { fn happened((member, core_id): &(AccountId, ::CoreId)) { INV4::remove_member(core_id, member) @@ -148,8 +200,12 @@ impl orml_traits2::Happened<(AccountId, ::CoreId)> } pub struct INV4TokenHooks; -impl orml_traits2::currency::MutationHooks::CoreId, Balance> - for INV4TokenHooks +impl + orml_traits2::currency::MutationHooks< + ::AccountId, + ::CoreId, + Balance, + > for INV4TokenHooks { type PreTransfer = DisallowIfFrozen; type OnDust = (); @@ -161,6 +217,12 @@ impl orml_traits2::currency::MutationHooks:: type OnKilledTokenAccount = HandleRemovedMembers; } +orml_traits2::parameter_type_with_key! { + pub CoreExistentialDeposits: |_currency_id: ::CoreId| -> Balance { + CExistentialDeposit::get() + }; +} + impl orml_tokens2::Config for Test { type RuntimeEvent = RuntimeEvent; type Balance = Balance; @@ -197,9 +259,11 @@ parameter_types! { pub const NativeAssetId: AssetId = NATIVE_ASSET_ID; pub const RelayAssetId: AssetId = RELAY_ASSET_ID; pub const ExistentialDeposit: u128 = 100000000000; + pub const CExistentialDeposit: u128 = 1; pub const MaxLocks: u32 = 1; pub const MaxReserves: u32 = 1; pub const MaxCallSize: u32 = 50 * 1024; + pub const StringLimit: u32 = 2125; } pub struct AssetAuthority; @@ -210,7 +274,7 @@ impl EnsureOriginWithArg> for AssetAuthority { origin: RuntimeOrigin, _asset_id: &Option, ) -> Result { - EnsureRoot::try_origin(origin) + as EnsureOrigin>::try_origin(origin) } } @@ -222,6 +286,7 @@ impl orml_asset_registry::Config for Test { type AssetProcessor = orml_asset_registry::SequentialId; type CustomMetadata = (); type WeightInfo = (); + type StringLimit = StringLimit; } pub struct DustRemovalWhitelist; @@ -251,7 +316,7 @@ impl orml_tokens::Config for Test { type WeightInfo = (); type ExistentialDeposits = ExistentialDeposits; type MaxLocks = MaxLocks; - type DustRemovalWhitelist = DustRemovalWhitelist; + type DustRemovalWhitelist = CoreDustRemovalWhitelist; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type CurrencyHooks = (); @@ -345,8 +410,8 @@ pub const INITIAL_BALANCE: Balance = 100000000000000000; impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); pallet_balances::GenesisConfig:: { @@ -366,8 +431,8 @@ impl ExtBuilder { 0u32, AssetMetadata { decimals: 12, - name: vec![], - symbol: vec![], + name: sp_core::bounded_vec::BoundedVec::::new(), + symbol: sp_core::bounded_vec::BoundedVec::::new(), existential_deposit: ExistentialDeposit::get(), location: None, additional: (), @@ -378,8 +443,8 @@ impl ExtBuilder { 1u32, AssetMetadata { decimals: 12, - name: vec![], - symbol: vec![], + name: sp_core::bounded_vec::BoundedVec::::new(), + symbol: sp_core::bounded_vec::BoundedVec::::new(), existential_deposit: ExistentialDeposit::get(), location: None, additional: (), diff --git a/INV4/pallet-inv4/src/tests/mod.rs b/INV4/pallet-inv4/src/tests/mod.rs index 73c9873b..7e9a4be7 100644 --- a/INV4/pallet-inv4/src/tests/mod.rs +++ b/INV4/pallet-inv4/src/tests/mod.rs @@ -1,3 +1,4 @@ +#[allow(unused_imports)] mod mock; extern crate alloc; diff --git a/INV4/pallet-inv4/src/voting.rs b/INV4/pallet-inv4/src/voting.rs index bd8786f9..23564d26 100644 --- a/INV4/pallet-inv4/src/voting.rs +++ b/INV4/pallet-inv4/src/voting.rs @@ -11,11 +11,11 @@ use crate::{origin::INV4Origin, BalanceOf, Config, CoreStorage, Error, Multisig, use codec::{Decode, Encode, HasCompact, MaxEncodedLen}; use core::marker::PhantomData; use frame_support::{ - pallet_prelude::Member, + pallet_prelude::{Member, RuntimeDebug}, traits::{fungibles::Inspect, PollStatus, VoteTally}, - BoundedBTreeMap, CloneNoBound, EqNoBound, Parameter, PartialEqNoBound, RuntimeDebug, - RuntimeDebugNoBound, + BoundedBTreeMap, CloneNoBound, EqNoBound, Parameter, PartialEqNoBound, RuntimeDebugNoBound, }; +use frame_system::pallet_prelude::BlockNumberFor; use scale_info::TypeInfo; use sp_runtime::{ traits::{One, Zero}, @@ -171,7 +171,7 @@ pub trait CustomPolling { impl CustomPolling> for Pallet { type Index = T::Hash; type Votes = Votes; - type Moment = T::BlockNumber; + type Moment = BlockNumberFor; type Class = T::CoreId; fn classes() -> Vec { @@ -181,7 +181,7 @@ impl CustomPolling> for Pallet { fn access_poll( class: Self::Class, index: Self::Index, - f: impl FnOnce(PollStatus<&mut Tally, T::BlockNumber, T::CoreId>) -> R, + f: impl FnOnce(PollStatus<&mut Tally, BlockNumberFor, T::CoreId>) -> R, ) -> R { match Multisig::::get(class, index) { Some(mut m) => { @@ -196,7 +196,9 @@ impl CustomPolling> for Pallet { fn try_access_poll( class: Self::Class, index: Self::Index, - f: impl FnOnce(PollStatus<&mut Tally, T::BlockNumber, T::CoreId>) -> Result, + f: impl FnOnce( + PollStatus<&mut Tally, BlockNumberFor, T::CoreId>, + ) -> Result, ) -> Result { match Multisig::::get(class, index) { Some(mut m) => { diff --git a/OCIF/staking/src/lib.rs b/OCIF/staking/src/lib.rs index 1d471c9c..e6167ad7 100644 --- a/OCIF/staking/src/lib.rs +++ b/OCIF/staking/src/lib.rs @@ -128,7 +128,7 @@ pub mod pallet { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The currency used in staking. - type Currency: LockableCurrency + type Currency: LockableCurrency> + ReservableCurrency; // type CoreId: Parameter @@ -229,7 +229,7 @@ pub mod pallet { /// Stores the block number of when the next era starts. #[pallet::storage] #[pallet::getter(fn next_era_starting_block)] - pub type NextEraStartingBlock = StorageValue<_, T::BlockNumber, ValueQuery>; + pub type NextEraStartingBlock = StorageValue<_, BlockNumberFor, ValueQuery>; /// Simple map where CoreId points to the respective core information. #[pallet::storage] diff --git a/OCIF/staking/src/testing/mock.rs b/OCIF/staking/src/testing/mock.rs index ef2e79a0..1482bccd 100644 --- a/OCIF/staking/src/testing/mock.rs +++ b/OCIF/staking/src/testing/mock.rs @@ -2,7 +2,7 @@ use crate as pallet_ocif_staking; use codec::{Decode, Encode}; use core::convert::{TryFrom, TryInto}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{ fungibles::Credit, ConstU128, ConstU32, Contains, Currency, OnFinalize, OnInitialize, }, @@ -14,9 +14,8 @@ use scale_info::TypeInfo; use sp_core::H256; use sp_io::TestExternalities; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, - AccountId32, Perbill, + AccountId32, BuildStorage, Perbill, }; pub(crate) type AccountId = AccountId32; @@ -24,7 +23,6 @@ pub(crate) type BlockNumber = u64; pub(crate) type Balance = u128; pub(crate) type EraIndex = u32; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; pub(crate) const EXISTENTIAL_DEPOSIT: Balance = 2; @@ -38,17 +36,17 @@ pub(crate) const REGISTER_DEPOSIT: Balance = 10; construct_runtime!( pub struct Test - where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, +// where + // Block = Block, + // NodeBlock = Block, + // UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system, Balances: pallet_balances, Timestamp: pallet_timestamp, OcifStaking: pallet_ocif_staking, - INV4: pallet_inv4, CoreAssets: orml_tokens, + INV4: pallet_inv4, } ); @@ -58,19 +56,18 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); + type RuntimeTask = RuntimeTask; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; - type BlockNumber = BlockNumber; + type Block = Block; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type DbWeight = (); @@ -90,6 +87,7 @@ parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = MaxLocks; type MaxReserves = (); @@ -100,10 +98,8 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); - type MaxHolds = ConstU32<1>; - type FreezeIdentifier = (); + type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); - type HoldIdentifier = [u8; 8]; } parameter_types! { @@ -292,8 +288,8 @@ pub const N: CoreId = 13; impl ExternalityBuilder { pub fn build() -> TestExternalities { - let storage = frame_system::GenesisConfig::default() - .build_storage::() + let storage = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); let mut ext = TestExternalities::from(storage); diff --git a/pallet-rings/src/lib.rs b/pallet-rings/src/lib.rs index 3ec50758..839a4e26 100644 --- a/pallet-rings/src/lib.rs +++ b/pallet-rings/src/lib.rs @@ -43,7 +43,7 @@ pub mod pallet { use pallet_inv4::origin::{ensure_multisig, INV4Origin}; use sp_std::{vec, vec::Vec}; use xcm::{ - latest::{prelude::*, MultiAsset, Weight, WildMultiAsset}, + v3::{prelude::*, MultiAsset, Weight, WildMultiAsset}, DoubleEncoded, }; @@ -136,7 +136,7 @@ pub mod pallet { ::CoreId: Into, [u8; 32]: From<::AccountId>, - T::AccountId: From<[u8; 32]>, + ::AccountId: From<[u8; 32]>, { /// Set the maintenance status of a chain. /// diff --git a/pallet-rings/src/tests/mock.rs b/pallet-rings/src/tests/mock.rs index 2a109cf5..9f32b55d 100644 --- a/pallet-rings/src/tests/mock.rs +++ b/pallet-rings/src/tests/mock.rs @@ -5,10 +5,10 @@ use crate::{ use codec::{Decode, Encode, MaxEncodedLen}; use core::convert::TryFrom; use frame_support::{ - parameter_types, + derive_impl, parameter_types, traits::{ fungibles::Credit, ConstU128, ConstU32, ConstU64, Contains, Currency, EnsureOrigin, - EnsureOriginWithArg, Everything, GenesisBuild, Nothing, + EnsureOriginWithArg, Everything, Nothing, }, }; use frame_system::EnsureRoot; @@ -17,24 +17,22 @@ use pallet_balances::AccountData; use pallet_inv4::fee_handling::*; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; pub use sp_std::{cell::RefCell, fmt::Debug}; use sp_std::{convert::TryInto, vec}; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, - FixedWeightBounds, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, FixedRateOfFungible, FixedWeightBounds, + FungibleAdapter as XcmCurrencyAdapter, IsConcrete, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, }; use xcm_executor::XcmExecutor; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type Balance = u128; type AccountId = AccountId32; -type BlockNumber = u64; pub const EXISTENTIAL_DEPOSIT: Balance = 1_000_000_000; @@ -49,19 +47,16 @@ pub const CHARLIE: AccountId = AccountId32::new([ ]); frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Event, Config}, - INV4: pallet_inv4::{Pallet, Call, Storage, Event, Origin}, - CoreAssets: orml_tokens2::{Pallet, Call, Storage, Event}, - Rings: pallet::{Pallet, Call, Storage, Event}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, - AssetRegistry: orml_asset_registry::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Tokens: orml_tokens, + CoreAssets: orml_tokens2, + AssetRegistry: orml_asset_registry, + INV4: pallet_inv4, + Rings: pallet, + XcmPallet: pallet_xcm, } ); @@ -72,16 +67,17 @@ impl Contains for TestBaseCallFilter { } } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type RuntimeTask = RuntimeTask; + type Nonce = u64; + type Block = Block; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -99,6 +95,7 @@ impl frame_system::Config for Test { type MaxConsumers = ConstU32<16>; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<50>; /// The type for recording an account's balance. @@ -111,9 +108,7 @@ impl pallet_balances::Config for Test { type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; type MaxHolds = ConstU32<1>; - type FreezeIdentifier = (); type MaxFreezes = (); - type HoldIdentifier = [u8; 8]; } thread_local! { @@ -196,6 +191,7 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; type PalletInstancesInfo = AllPalletsWithSystem; type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type Aliasers = (); } pub type LocalOriginToLocation = SignedToAccountId32; @@ -313,7 +309,7 @@ parameter_types! { pub const MaxCallers: u32 = 10000; pub const CoreSeedBalance: Balance = 1000000u128; pub const CoreCreationFee: Balance = UNIT; - + pub const StringLimit: u32 = 2125; pub const RelayCoreCreationFee: Balance = UNIT; } @@ -338,7 +334,7 @@ impl EnsureOriginWithArg> for AssetAuthority { origin: RuntimeOrigin, _asset_id: &Option, ) -> Result { - EnsureRoot::try_origin(origin) + as EnsureOrigin>::try_origin(origin) } } @@ -350,6 +346,7 @@ impl orml_asset_registry::Config for Test { type AssetProcessor = orml_asset_registry::SequentialId; type CustomMetadata = (); type WeightInfo = (); + type StringLimit = StringLimit; } pub struct DustRemovalWhitelist; @@ -559,8 +556,8 @@ pub const INITIAL_BALANCE: Balance = 100000000000000000; impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); pallet_balances::GenesisConfig:: { @@ -579,8 +576,8 @@ impl ExtBuilder { 0u32, AssetMetadata { decimals: 12, - name: vec![], - symbol: vec![], + name: sp_core::bounded_vec::BoundedVec::::new(), + symbol: sp_core::bounded_vec::BoundedVec::::new(), existential_deposit: ExistentialDeposit::get(), location: None, additional: (), @@ -591,8 +588,8 @@ impl ExtBuilder { 1u32, AssetMetadata { decimals: 12, - name: vec![], - symbol: vec![], + name: sp_core::bounded_vec::BoundedVec::::new(), + symbol: sp_core::bounded_vec::BoundedVec::::new(), existential_deposit: ExistentialDeposit::get(), location: None, additional: (), diff --git a/pallet-rings/src/traits.rs b/pallet-rings/src/traits.rs index fb6d2bc5..1868a9ce 100644 --- a/pallet-rings/src/traits.rs +++ b/pallet-rings/src/traits.rs @@ -14,7 +14,7 @@ use codec::MaxEncodedLen; use frame_support::Parameter; -use xcm::latest::MultiLocation; +use xcm::opaque::v3::MultiLocation; /// A chain [`MultiLocation`] abstraction trait. /// From 5721f97a06dd89b34ada27904da322e61ae60375 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Thu, 21 Mar 2024 13:08:04 -0300 Subject: [PATCH 09/13] Fix: restored toolchain --- rust-toolchain.toml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1a3d283f..c084c265 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,14 +1,4 @@ [toolchain] -# channel = "nightly-2024-02-06" -channel = "1.74.0" +channel = "nightly-2024-02-06" targets = ["wasm32-unknown-unknown"] -components = [ - "rustfmt", - "rustc", - "rust-std", - "cargo", - "clippy", - "llvm-tools", - "rust-analyzer", -] -profile = "minimal" +components = [ "rustfmt", "rustc", "rust-std", "cargo", "clippy", "llvm-tools-preview"] \ No newline at end of file From 9ce06e976b5619bb92935e6ca5fbbaaaa44b0a8b Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Thu, 21 Mar 2024 13:31:41 -0300 Subject: [PATCH 10/13] Fix: added sp-api --- Cargo.toml | 1 + INV4/pallet-inv4/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index bbb44681..f2200c1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", defa pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", default-features = false, branch = "release-polkadot-v1.6.0" } diff --git a/INV4/pallet-inv4/Cargo.toml b/INV4/pallet-inv4/Cargo.toml index cba2b0e8..09a1ac01 100644 --- a/INV4/pallet-inv4/Cargo.toml +++ b/INV4/pallet-inv4/Cargo.toml @@ -27,6 +27,7 @@ log = { workspace = true, default-features = false } primitives = { package = "invarch-primitives", path = "../../primitives", default-features = false } sp-io = { workspace = true, default-features = false } +sp-api = { workspace = true, default-features = false } sp-core = { workspace = true, default-features = false } pallet-balances = { workspace = true, default-features = false } From 8a5f07294331b01d0330f7123298968e2124c604 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Thu, 21 Mar 2024 13:32:04 -0300 Subject: [PATCH 11/13] Fix: changed substrate badge to polkadot sdk --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0340ac0c..1d21007a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![Telegram](https://img.shields.io/badge/Telegram-gray?logo=telegram)](https://t.me/InvArch) [![Knowledge Hub](https://img.shields.io/badge/🧠_Knwoledge_hub-gray)](https://abstracted.notion.site/Knowledge-Hub-eec0071f36364d6aa8138f0004ac8d85)
-[![Substrate version](https://img.shields.io/badge/Substrate-v3.0.0-E6007A?logo=Parity%20Substrate)](https://github.com/paritytech/substrate/releases/tag/v3.0.0) +[![Polkadot SDK version](https://img.shields.io/badge/Polkadot_SDK-V1.6.0-E6007A?logo=polkadot)](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.6.0) [![Medium](https://img.shields.io/badge/Medium-InvArch-E6007A?logo=medium)](https://invarch.medium.com/) [![License](https://img.shields.io/github/license/InvArch/InvArch?color=E6007A)](https://github.com/InvArch/InvArch/blob/main/LICENSE) [![Library Docs](https://img.shields.io/badge/Library-Docs%2Ers-E6007A?logo=docsdotrs)](https://invarch.github.io/InvArch-Frames/) @@ -22,7 +22,7 @@ ## Intro -This repository should contain the Substrate FRAME Pallets used in the InvArch blockchain, and reviews their relationships and functions. At the current stage, the goal of creating this document and repository is centered around getting feedback while we continue to write the code and develop InvArch. This is a WIP. +This repository should contain the Polkadot SDK FRAME Pallets used in the InvArch blockchain, and reviews their relationships and functions. At the current stage, the goal of creating this document and repository is centered around getting feedback while we continue to write the code and develop InvArch. This is a WIP. Check out the [Knowledge Hub](https://abstracted.notion.site/Knowledge-Hub-eec0071f36364d6aa8138f0004ac8d85), it is the perfect place to dive into all things InvArch From f585bd60d0ac756f3da76353676b78b51d1eae86 Mon Sep 17 00:00:00 2001 From: Gabriel Facco de Arruda Date: Wed, 8 May 2024 16:36:54 -0300 Subject: [PATCH 12/13] Apply suggestions from code review --- INV4/pallet-inv4/Cargo.toml | 21 ----------- INV4/pallet-inv4/src/tests/mock.rs | 56 ------------------------------ OCIF/staking/src/testing/mock.rs | 4 --- 3 files changed, 81 deletions(-) diff --git a/INV4/pallet-inv4/Cargo.toml b/INV4/pallet-inv4/Cargo.toml index 09a1ac01..20e7ff20 100644 --- a/INV4/pallet-inv4/Cargo.toml +++ b/INV4/pallet-inv4/Cargo.toml @@ -73,24 +73,3 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] - - -# std = [ -# "serde", -# "codec/std", -# "sp-runtime/std", -# "sp-std/std", -# "frame-support/std", -# "frame-system/std", -# "sp-io/std", -# "sp-core/std", -# "scale-info/std", -# "pallet-balances/std", -# "frame-benchmarking?/std", -# # "orml-asset-registry/std", -# "orml-tokens/std", -# # "orml-tokens2/std", -# # "orml-traits/std", -# # "orml-traits2/std", -# "xcm/std", -# ] diff --git a/INV4/pallet-inv4/src/tests/mock.rs b/INV4/pallet-inv4/src/tests/mock.rs index 3a828386..4af34722 100644 --- a/INV4/pallet-inv4/src/tests/mock.rs +++ b/INV4/pallet-inv4/src/tests/mock.rs @@ -16,7 +16,6 @@ use sp_core::H256; use sp_runtime::{AccountId32, BuildStorage}; use sp_std::{convert::TryInto, vec}; -// type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type Balance = u128; @@ -28,43 +27,6 @@ pub const ALICE: AccountId = AccountId::new([0u8; 32]); pub const BOB: AccountId = AccountId::new([1u8; 32]); pub const CHARLIE: AccountId = AccountId::new([2u8; 32]); pub const DAVE: AccountId = AccountId::new([3u8; 32]); -// AssetRegistry: orml_asset_registry, -// CoreAssets: orml_tokens2, - -// impl Config for Test { -// type RuntimeEvent = RuntimeEvent; -// type Currency = Balances; - -// type CoreId = ::CoreId; - -// type RuntimeCall = RuntimeCall; - -// type MaxCallers = MaxCallers; - -// type MaxMetadata = MaxCallers; - -// type RuntimeOrigin = RuntimeOrigin; - -// type CoreSeedBalance = CoreSeedBalance; - -// type CoreCreationFee = CoreCreationFee; - -// type RelayCoreCreationFee = RelayCoreCreationFee; - -// type RelayAssetId = RelayAssetId; - -// type AssetsProvider = Tokens; - -// type Tokens = Tokens; - -// type FeeCharger = FeeCharger; - -// type ParaId = ::ParaId; - -// type MaxCallSize = MaxCallSize; - -// type WeightInfo = (); -// } frame_support::construct_runtime!( pub enum Test @@ -77,24 +39,6 @@ frame_support::construct_runtime!( INV4: pallet, } ); -// System: frame_system, -// Balances: pallet_balances, -// INV4: pallet, -// Tokens: orml_tokens, - -// AssetRegistry: orml_asset_registry, -// CoreAssets: orml_tokens2, - -// System: frame_system::{Pallet, Call, Config, Storage, Event}, -// Balances: pallet_balances::{Pallet, Call, Storage, Event, Config}, -// INV4: pallet::{Pallet, Call, Storage, Event, Origin}, -// Tokens: orml_tokens::{Pallet, Call, Storage, Event}, -// AssetRegistry: orml_asset_registry::{Pallet, Call, Storage, Event, Config}, -// CoreAssets: orml_tokens2::{Pallet, Call, Storage, Event}, -// where -// Block = Block, -// NodeBlock = Block, -// UncheckedExtrinsic = UncheckedExtrinsic, pub struct TestBaseCallFilter; impl Contains for TestBaseCallFilter { diff --git a/OCIF/staking/src/testing/mock.rs b/OCIF/staking/src/testing/mock.rs index 1482bccd..8af95b48 100644 --- a/OCIF/staking/src/testing/mock.rs +++ b/OCIF/staking/src/testing/mock.rs @@ -36,10 +36,6 @@ pub(crate) const REGISTER_DEPOSIT: Balance = 10; construct_runtime!( pub struct Test -// where - // Block = Block, - // NodeBlock = Block, - // UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system, Balances: pallet_balances, From 175d38163fd9023cc1ce329b64909016b67c9c07 Mon Sep 17 00:00:00 2001 From: Gabriel Facco de Arruda Date: Wed, 8 May 2024 16:40:16 -0300 Subject: [PATCH 13/13] fmt --- OCIF/staking/src/testing/mock.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OCIF/staking/src/testing/mock.rs b/OCIF/staking/src/testing/mock.rs index 8af95b48..b3c2e768 100644 --- a/OCIF/staking/src/testing/mock.rs +++ b/OCIF/staking/src/testing/mock.rs @@ -35,8 +35,7 @@ pub(crate) const BLOCKS_PER_ERA: BlockNumber = 3; pub(crate) const REGISTER_DEPOSIT: Balance = 10; construct_runtime!( - pub struct Test - { + pub struct Test { System: frame_system, Balances: pallet_balances, Timestamp: pallet_timestamp,