diff --git a/Cargo.lock b/Cargo.lock index 91efd2ed..d5d490e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,7 +173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -321,7 +321,7 @@ checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -385,7 +385,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.30.1", + "object 0.30.4", "rustc-demangle", ] @@ -668,6 +668,7 @@ dependencies = [ "pallet-contracts", "pallet-contracts-primitives", "pallet-dex", + "pallet-general-storage", "pallet-identity", "pallet-kyc", "pallet-membership", @@ -752,6 +753,7 @@ dependencies = [ "pallet-contracts", "pallet-contracts-primitives", "pallet-dex", + "pallet-general-storage", "pallet-identity", "pallet-kyc", "pallet-membership", @@ -821,13 +823,13 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", "arrayvec 0.7.2", - "constant_time_eq 0.1.5", + "constant_time_eq 0.2.4", ] [[package]] @@ -1160,7 +1162,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1216,9 +1218,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.1" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec318a675afcb6a1ea1d4340e2d377e56e47c266f28043ceccbf4412ddfdd3b" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" @@ -1496,7 +1498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1733,7 +1735,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2045,7 +2047,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.107", ] [[package]] @@ -2062,7 +2064,7 @@ checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2088,7 +2090,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn", + "syn 1.0.107", ] [[package]] @@ -2109,7 +2111,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2122,7 +2124,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn", + "syn 1.0.107", ] [[package]] @@ -2247,7 +2249,7 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2339,7 +2341,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2359,7 +2361,7 @@ checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2370,7 +2372,7 @@ checksum = "e88bcb3a067a6555d577aba299e75eff9942da276e6506fc6274327daa026132" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2416,6 +2418,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -2463,7 +2476,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2508,7 +2521,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "thiserror", ] @@ -2725,7 +2738,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2816,7 +2829,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2828,7 +2841,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2838,7 +2851,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2d dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2995,7 +3008,7 @@ checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -3498,7 +3511,7 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -3584,7 +3597,7 @@ checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ "hermit-abi 0.2.6", "io-lifetimes 1.0.3", - "rustix 0.36.6", + "rustix 0.36.15", "windows-sys 0.42.0", ] @@ -3716,7 +3729,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -4250,7 +4263,7 @@ checksum = "a0eddc4497a8b5a506013c40e8189864f9c3a00db2b25671f428ae9007f3ba32" dependencies = [ "heck", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -4545,7 +4558,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" dependencies = [ - "rustix 0.36.6", + "rustix 0.36.15", ] [[package]] @@ -4675,7 +4688,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -4734,7 +4747,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "synstructure", ] @@ -4784,7 +4797,7 @@ checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -4987,9 +5000,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.1" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d864c91689fdc196779b98dba0aceac6118594c2df6ee5d943eb6a8df4d107a" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "memchr", ] @@ -5047,7 +5060,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -5482,7 +5495,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2d dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -5615,6 +5628,21 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-general-storage" +version = "4.0.0-dev" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + [[package]] name = "pallet-gilt" version = "4.0.0-dev" @@ -6099,7 +6127,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -6407,9 +6435,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.4.0" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -6422,14 +6450,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -6461,7 +6489,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.107", "synstructure", ] @@ -6591,7 +6619,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -6632,7 +6660,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -7891,7 +7919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.107", ] [[package]] @@ -7943,7 +7971,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "version_check", ] @@ -7960,9 +7988,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -8001,7 +8029,7 @@ checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -8031,7 +8059,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 1.0.107", "tempfile", "which", ] @@ -8059,7 +8087,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -8100,9 +8128,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -8291,7 +8319,7 @@ checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -8582,7 +8610,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ "bitflags", - "errno", + "errno 0.2.8", "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", @@ -8591,16 +8619,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.6" +version = "0.36.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" +checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" dependencies = [ "bitflags", - "errno", + "errno 0.3.2", "io-lifetimes 1.0.3", "libc", "linux-raw-sys 0.1.4", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -8779,7 +8807,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -9697,7 +9725,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -9756,9 +9784,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.3.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001cf62ece89779fd16105b5f515ad0e5cedcd5440d3dd806bb067978e7c3608" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "bitvec", "cfg-if", @@ -9770,14 +9798,14 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.3.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "303959cf613a6f6efd19ed4b4ad5bf79966a13352716299ad532cfb115f4205c" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -9929,22 +9957,22 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -10211,7 +10239,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -10451,7 +10479,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn", + "syn 1.0.107", ] [[package]] @@ -10470,7 +10498,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.33#2d dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -10690,7 +10718,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -10873,7 +10901,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -10985,7 +11013,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -10998,7 +11026,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -11039,7 +11067,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.107", ] [[package]] @@ -11165,6 +11193,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -11173,7 +11212,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "unicode-xid", ] @@ -11256,7 +11295,7 @@ checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -11380,7 +11419,7 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -11455,7 +11494,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -11498,7 +11537,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -11865,7 +11904,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-shared", ] @@ -11899,7 +11938,7 @@ checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -12409,20 +12448,74 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_msvc" @@ -12438,9 +12531,15 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" @@ -12456,9 +12555,15 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_msvc" @@ -12474,9 +12579,15 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" @@ -12492,15 +12603,27 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" @@ -12516,9 +12639,15 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winreg" @@ -12609,7 +12738,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -12643,7 +12772,7 @@ checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "synstructure", ] diff --git a/pallets/carbon-credits-pool/src/lib.rs b/pallets/carbon-credits-pool/src/lib.rs index 68647f89..15ee7f02 100644 --- a/pallets/carbon-credits-pool/src/lib.rs +++ b/pallets/carbon-credits-pool/src/lib.rs @@ -401,7 +401,7 @@ pub mod pallet { project_id, group_id, actual, - Default::default() + Default::default(), )?; // Update value in storage diff --git a/pallets/carbon-credits/src/functions.rs b/pallets/carbon-credits/src/functions.rs index 3f2d062c..51ba5907 100644 --- a/pallets/carbon-credits/src/functions.rs +++ b/pallets/carbon-credits/src/functions.rs @@ -22,7 +22,7 @@ use sp_std::{cmp, convert::TryInto, vec::Vec}; use crate::{ AssetIdLookup, AuthorizedAccounts, BatchGroupOf, BatchRetireDataList, BatchRetireDataOf, Config, Error, Event, NextAssetId, NextItemId, NextProjectId, Pallet, ProjectCreateParams, - ProjectDetail, Projects, RetiredCarbonCreditsData, RetiredCredits, ShortStringOf + ProjectDetail, Projects, RetiredCarbonCreditsData, RetiredCredits, ShortStringOf, }; impl Pallet { @@ -492,7 +492,7 @@ impl Pallet { project_id: T::ProjectId, group_id: T::GroupId, amount: T::Balance, - reason: ShortStringOf + reason: ShortStringOf, ) -> DispatchResult { let now = frame_system::Pallet::::block_number(); @@ -598,7 +598,7 @@ impl Pallet { retire_data: batch_retire_data_list.clone(), timestamp: now, count: amount, - reason : reason.clone() + reason: reason.clone(), }; //Store the details of retired batches in storage @@ -612,7 +612,7 @@ impl Pallet { account: from, amount, retire_data: batch_retire_data_list, - reason + reason, }); Ok(()) diff --git a/pallets/carbon-credits/src/lib.rs b/pallets/carbon-credits/src/lib.rs index ad2f39b3..a696ac46 100644 --- a/pallets/carbon-credits/src/lib.rs +++ b/pallets/carbon-credits/src/lib.rs @@ -301,7 +301,7 @@ pub mod pallet { /// Details of the retired token retire_data: BatchRetireDataList, /// reason for retirement - reason: ShortStringOf + reason: ShortStringOf, }, /// A project details has been updated ProjectUpdated { @@ -436,7 +436,7 @@ pub mod pallet { project_id: T::ProjectId, group_id: T::GroupId, amount: T::Balance, - reason: ShortStringOf + reason: ShortStringOf, ) -> DispatchResult { let sender = ensure_signed(origin)?; Self::check_kyc_approval(&sender)?; diff --git a/pallets/carbon-credits/src/migration.rs b/pallets/carbon-credits/src/migration.rs index a5b85b8b..d012a6dd 100644 --- a/pallets/carbon-credits/src/migration.rs +++ b/pallets/carbon-credits/src/migration.rs @@ -21,11 +21,11 @@ pub mod v2 { RetiredCredits::::translate::, _>( |_asset_id, _item_id, old| -> Option> { let converted_data = RetiredCarbonCreditsData { - account : old.account, + account: old.account, retire_data: old.retire_data, timestamp: old.timestamp, count: old.count, - reason: Default::default() // new value + reason: Default::default(), // new value }; Some(converted_data) }, diff --git a/pallets/carbon-credits/src/tests.rs b/pallets/carbon-credits/src/tests.rs index 9ddb60b6..f4edcd60 100644 --- a/pallets/carbon-credits/src/tests.rs +++ b/pallets/carbon-credits/src/tests.rs @@ -995,7 +995,13 @@ fn test_retire_non_minted_project_should_fail() { // calling retire from a non minted project should fail assert_noop!( - CarbonCredits::retire(RawOrigin::Signed(3).into(), project_id, group_id, 100u128, Default::default()), + CarbonCredits::retire( + RawOrigin::Signed(3).into(), + project_id, + group_id, + 100u128, + Default::default() + ), pallet_assets::Error::::NoAccount ); }); diff --git a/pallets/carbon-credits/src/types.rs b/pallets/carbon-credits/src/types.rs index c8c50e6a..3dd93bf5 100644 --- a/pallets/carbon-credits/src/types.rs +++ b/pallets/carbon-credits/src/types.rs @@ -153,5 +153,5 @@ pub struct RetiredCarbonCreditsData { /// The total count of credits retired pub count: T::Balance, /// Retirement reason - pub reason: ShortStringOf + pub reason: ShortStringOf, } diff --git a/pallets/general-storage/Cargo.toml b/pallets/general-storage/Cargo.toml new file mode 100644 index 00000000..5461583c --- /dev/null +++ b/pallets/general-storage/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "pallet-general-storage" +version = "4.0.0-dev" +description = "FRAME pallet template for defining custom runtime logic." +authors = ["Substrate DevHub "] +homepage = "https://substrate.io" +edition = "2021" +license = "Unlicense" +publish = false +repository = "https://github.com/substrate-developer-hub/substrate-node-template/" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.33" } +frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.33" } +frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.33" } + +[dev-dependencies] +sp-core = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.33" } +sp-io = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.33" } +sp-runtime = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.33" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.33" } + +[features] +default = ["std"] +std = [ + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "pallet-balances/std" +] +runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/general-storage/README.md b/pallets/general-storage/README.md new file mode 100644 index 00000000..8d751a42 --- /dev/null +++ b/pallets/general-storage/README.md @@ -0,0 +1 @@ +License: Unlicense \ No newline at end of file diff --git a/pallets/general-storage/src/lib.rs b/pallets/general-storage/src/lib.rs new file mode 100644 index 00000000..6c84e6b6 --- /dev/null +++ b/pallets/general-storage/src/lib.rs @@ -0,0 +1,141 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +/// Edit this file to define custom logic or remove it if it is not needed. +/// Learn more about FRAME and the core library of Substrate FRAME pallets: +/// +pub use pallet::*; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod tests; + +#[frame_support::pallet] +pub mod pallet { + use frame_support::{ + pallet_prelude::*, + sp_runtime::traits::Zero, + traits::{Currency, ReservableCurrency}, + }; + use frame_system::pallet_prelude::*; + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + /// Configure the pallet by specifying the parameters and types on which it depends. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Because this pallet emits events, it depends on the runtime's definition of an event. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + // Currency config - this is what the pallet accepts as payment + type Currency: ReservableCurrency; + /// Maximum length of key + type MaxKeyLength: Get; + /// Maximum length of value + type MaxValueLength: Get; + /// The deposit charged to store data + type DepositPerByte: Get>; + } + + // -- Types for representing key and value in pallet -- // + /// Type for short strings an descriptions + pub type KeyOf = BoundedVec::MaxKeyLength>; + + /// Type for longer strings and descriptions + pub type ValueOf = BoundedVec::MaxValueLength>; + + pub type CurrencyBalanceOf = + <::Currency as Currency<::AccountId>>::Balance; + + // The pallet's runtime storage items. + // https://docs.substrate.io/main-docs/build/runtime-storage/ + #[pallet::storage] + #[pallet::getter(fn something)] + // Learn more about declaring storage items: + // https://docs.substrate.io/main-docs/build/runtime-storage/#declaring-storage-items + pub type StoredData = + StorageDoubleMap<_, Blake2_128Concat, T::AccountId, Blake2_128Concat, KeyOf, ValueOf>; + + // Pallets use events to inform users when important changes are made. + // https://docs.substrate.io/main-docs/build/events-errors/ + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// A new data has been stored on chain + DataStored { key: KeyOf, who: T::AccountId }, + /// An existing data has been removed + DataCleared { key: KeyOf, who: T::AccountId }, + } + + // Errors inform users that something went wrong. + #[pallet::error] + pub enum Error { + /// Error names should be descriptive. + NoDataStored, + /// cannot pass empty key + EmptyInput, + } + + // Dispatchable functions allows users to interact with the pallet and invoke state changes. + // These functions materialize as "extrinsics", which are often compared to transactions. + // Dispatchable functions must be annotated with a weight and must return a DispatchResult. + #[pallet::call] + impl Pallet { + /// An example dispatchable that takes a singles value as a parameter, writes the value to + /// storage and emits an event. This function must be dispatched by a signed extrinsic. + #[pallet::weight(10_000 + T::DbWeight::get().writes(1).ref_time())] + pub fn store_data( + origin: OriginFor, + key: KeyOf, + value: ValueOf, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + + ensure!(!key.len().is_zero() && !value.len().is_zero(), Error::::EmptyInput); + + // calculate deposit fee + let deposit_amount = T::DepositPerByte::get() * (value.len() as u32).into(); + + // reserve deposit fee + T::Currency::reserve(&who, deposit_amount)?; + + // Update storage. + >::insert(who.clone(), key.clone(), value); + + // Emit an event. + Self::deposit_event(Event::DataStored { key, who }); + + Ok(()) + } + + /// An example dispatchable that may throw a custom error. + #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1).ref_time())] + pub fn clear_data(origin: OriginFor, key: KeyOf) -> DispatchResult { + let who = ensure_signed(origin)?; + + ensure!(!key.len().is_zero(), Error::::EmptyInput); + + let data = >::get(who.clone(), key.clone()); + + // does some data exist + ensure!(data.is_some(), Error::::NoDataStored); + + // calculate deposit fee + let deposit_amount = + T::DepositPerByte::get() * (data.expect("already checked!").len() as u32).into(); + + // reserve deposit fee + T::Currency::unreserve(&who, deposit_amount); + + // Update storage. + >::take(who.clone(), key.clone()); + + // Emit an event. + Self::deposit_event(Event::DataCleared { key, who }); + + Ok(()) + } + } +} diff --git a/pallets/general-storage/src/mock.rs b/pallets/general-storage/src/mock.rs new file mode 100644 index 00000000..9ef3ae2c --- /dev/null +++ b/pallets/general-storage/src/mock.rs @@ -0,0 +1,96 @@ +use crate as pallet_general_storage; +use frame_support::{ + parameter_types, + traits::{ConstU16, ConstU64}, +}; +use frame_system as system; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, +}; +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system, + Balances: pallet_balances, + GeneralStorage: pallet_general_storage, + } +); + +impl system::Config for Test { + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Header = Header; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = ConstU64<250>; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = ConstU16<42>; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 1; +} + +impl pallet_balances::Config for Test { + type AccountStore = System; + type Balance = u128; + type DustRemoval = (); + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposit = ExistentialDeposit; + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type WeightInfo = (); +} + +parameter_types! { + pub const MaxKeyLength : u32 = 10; + pub const MaxValueLength : u32 = 100; + pub const DepositPerByte : u128 = 1; +} +impl pallet_general_storage::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type MaxKeyLength = MaxKeyLength; + type MaxValueLength = MaxValueLength; + type DepositPerByte = DepositPerByte; +} + +// Build genesis storage according to the mock runtime. +pub fn new_test_ext() -> sp_io::TestExternalities { + let mut t = system::GenesisConfig::default().build_storage::().unwrap(); + + let mut ext: sp_io::TestExternalities = t.into(); + // need to set block number to 1 to test events + ext.execute_with(|| System::set_block_number(1)); + ext +} + +pub fn last_event() -> RuntimeEvent { + System::events().pop().expect("Event expected").event +} diff --git a/pallets/general-storage/src/tests.rs b/pallets/general-storage/src/tests.rs new file mode 100644 index 00000000..344adba4 --- /dev/null +++ b/pallets/general-storage/src/tests.rs @@ -0,0 +1,104 @@ +use crate::{mock::*, Error, KeyOf, StoredData}; +use frame_support::{assert_noop, assert_ok, traits::Currency}; + +#[test] +fn store_data_should_work() { + new_test_ext().execute_with(|| { + let key = "test"; + let value = "somedatatostore"; + + // should fail if given empty key + assert_noop!( + GeneralStorage::store_data( + RuntimeOrigin::signed(1), + Default::default(), + value.as_bytes().to_vec().try_into().unwrap() + ), + Error::::EmptyInput + ); + + // should fail if given empty value + assert_noop!( + GeneralStorage::store_data( + RuntimeOrigin::signed(1), + key.as_bytes().to_vec().try_into().unwrap(), + Default::default(), + ), + Error::::EmptyInput + ); + + // should fail if cannot pay deposit + assert_noop!( + GeneralStorage::store_data( + RuntimeOrigin::signed(1), + key.as_bytes().to_vec().try_into().unwrap(), + value.as_bytes().to_vec().try_into().unwrap(), + ), + pallet_balances::Error::::InsufficientBalance + ); + + // give some balance to pay deposit + Balances::make_free_balance_be(&1, 1000); + assert_ok!(GeneralStorage::store_data( + RuntimeOrigin::signed(1), + key.as_bytes().to_vec().try_into().unwrap(), + value.as_bytes().to_vec().try_into().unwrap(), + )); + + // ensure the storage is updated + let key: KeyOf = key.as_bytes().to_vec().try_into().unwrap(); + assert_eq!( + StoredData::::get(1, key), + Some(value.as_bytes().to_vec().try_into().unwrap()) + ); + }); +} + +#[test] +fn clear_data_should_work() { + new_test_ext().execute_with(|| { + let key = "test"; + let value = "somedatatostore"; + + // should fail if given empty key + assert_noop!( + GeneralStorage::clear_data(RuntimeOrigin::signed(1), Default::default(),), + Error::::EmptyInput + ); + + // should fail if no data stored + assert_noop!( + GeneralStorage::clear_data( + RuntimeOrigin::signed(1), + key.as_bytes().to_vec().try_into().unwrap(), + ), + Error::::NoDataStored + ); + + // give some balance to pay deposit + Balances::make_free_balance_be(&1, 1000); + assert_ok!(GeneralStorage::store_data( + RuntimeOrigin::signed(1), + key.as_bytes().to_vec().try_into().unwrap(), + value.as_bytes().to_vec().try_into().unwrap(), + )); + + // ensure the storage is updated + let key: KeyOf = key.as_bytes().to_vec().try_into().unwrap(); + assert_eq!( + StoredData::::get(1, key.clone()), + Some(value.as_bytes().to_vec().try_into().unwrap()) + ); + + // deletion should work now + assert_ok!(GeneralStorage::clear_data(RuntimeOrigin::signed(1), key.clone(),)); + + assert_eq!(StoredData::::get(1, key.clone()), None); + + // trying again should fail since already deleted + assert_noop!( + GeneralStorage::clear_data(RuntimeOrigin::signed(1), key,), + Error::::NoDataStored + ); + }); +} diff --git a/runtime/bitgreen/Cargo.toml b/runtime/bitgreen/Cargo.toml index 03ecb225..c853c8ce 100644 --- a/runtime/bitgreen/Cargo.toml +++ b/runtime/bitgreen/Cargo.toml @@ -101,6 +101,7 @@ pallet-transaction-pause = { default-features = false, version = '0.0.1', path = pallet-vesting-contract = { default-features = false, version = '0.0.1', path = "../../pallets/vesting-contract" } pallet-kyc = { default-features = false, version = '0.0.1', path = "../../pallets/kyc" } pallet-dex = { default-features = false, path = "../../pallets/dex" } +pallet-general-storage = { default-features = false, path = "../../pallets/general-storage" } primitives = { package = "bitgreen-primitives", path = "../../primitives", default-features = false } [features] @@ -177,7 +178,8 @@ std = [ "pallet-parachain-staking/std", "pallet-dex/std", "pallet-proxy/std", - "pallet-identity/std" + "pallet-identity/std", + "pallet-general-storage/std" ] runtime-benchmarks = [ diff --git a/runtime/bitgreen/src/lib.rs b/runtime/bitgreen/src/lib.rs index 8f606b53..dce157c4 100644 --- a/runtime/bitgreen/src/lib.rs +++ b/runtime/bitgreen/src/lib.rs @@ -175,7 +175,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bitgreen-parachain"), impl_name: create_runtime_str!("bitgreen-parachain"), authoring_version: 1, - spec_version: 1203, // v1.2.3 + spec_version: 1204, // v1.2.4 impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -934,6 +934,20 @@ impl pallet_identity::Config for Runtime { type WeightInfo = (); } +parameter_types! { + pub const MaxKeyLength : u32 = 10; + pub const MaxValueLength : u32 = 100; + pub const DepositPerByte : Balance = DOLLARS / 100; +} + +impl pallet_general_storage::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type MaxKeyLength = MaxKeyLength; + type MaxValueLength = MaxValueLength; + type DepositPerByte = DepositPerByte; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -983,6 +997,7 @@ construct_runtime!( Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 59, Dex: pallet_dex::{Pallet, Call, Storage, Event} = 60, KYC: pallet_kyc::{Pallet, Call, Storage, Config, Event} = 66, + GeneralStorage: pallet_general_storage::{Pallet, Call, Storage, Config, Event} = 67, // Utility pallets Utility: pallet_utility::{Pallet, Call, Event} = 61, diff --git a/runtime/rococo/Cargo.toml b/runtime/rococo/Cargo.toml index 191d40ee..7c4df1c4 100644 --- a/runtime/rococo/Cargo.toml +++ b/runtime/rococo/Cargo.toml @@ -101,6 +101,7 @@ pallet-transaction-pause = { default-features = false, version = '0.0.1', path = pallet-vesting-contract = { default-features = false, version = '0.0.1', path = "../../pallets/vesting-contract" } pallet-kyc = { default-features = false, version = '0.0.1', path = "../../pallets/kyc" } pallet-dex = { default-features = false, path = "../../pallets/dex" } +pallet-general-storage = { default-features = false, path = "../../pallets/general-storage" } primitives = { package = "bitgreen-primitives", path = "../../primitives", default-features = false } [features] @@ -177,7 +178,8 @@ std = [ "pallet-parachain-staking/std", "pallet-dex/std", "pallet-proxy/std", - "pallet-identity/std" + "pallet-identity/std", + "pallet-general-storage/std" ] runtime-benchmarks = [ diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 81aa1de8..ead370d0 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -174,7 +174,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bitgreen-rococo"), impl_name: create_runtime_str!("bitgreen-rococo"), authoring_version: 1, - spec_version: 1203, // v1.2.3 + spec_version: 1204, // v1.2.4 impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -929,6 +929,20 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = ConstU128<{ deposit(0, 56) }>; } +parameter_types! { + pub const MaxKeyLength : u32 = 10; + pub const MaxValueLength : u32 = 100; + pub const DepositPerByte : Balance = DOLLARS / 100; +} + +impl pallet_general_storage::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type MaxKeyLength = MaxKeyLength; + type MaxValueLength = MaxValueLength; + type DepositPerByte = DepositPerByte; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -978,6 +992,7 @@ construct_runtime!( Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 59, Dex: pallet_dex::{Pallet, Call, Storage, Event} = 60, KYC: pallet_kyc::{Pallet, Call, Storage, Config, Event} = 66, + GeneralStorage: pallet_general_storage::{Pallet, Call, Storage, Config, Event} = 67, // Utility pallets Utility: pallet_utility::{Pallet, Call, Event} = 61,