diff --git a/Cargo.lock b/Cargo.lock index 3c827e91c6..a86412056b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2378,6 +2378,7 @@ dependencies = [ "pallet-identity", "pallet-im-online", "pallet-indices", + "pallet-keystore", "pallet-loans", "pallet-membership", "pallet-migration-manager", @@ -2389,7 +2390,6 @@ dependencies = [ "pallet-pools", "pallet-preimage", "pallet-proxy", - "pallet-proxy-keystore", "pallet-randomness-collective-flip", "pallet-restricted-tokens", "pallet-scheduler", @@ -6499,6 +6499,23 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-keystore" +version = "1.0.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-loans" version = "1.0.0" @@ -6782,23 +6799,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-proxy-keystore" -version = "1.0.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" diff --git a/Cargo.toml b/Cargo.toml index 13f7c24f8a..291085d573 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ members = [ "pallets/pools", "pallets/loans", "pallets/permissions", - "pallets/proxy-keystore", + "pallets/keystore", "libs/common-traits", "libs/common-types", "libs/proofs", diff --git a/pallets/proxy-keystore/Cargo.toml b/pallets/keystore/Cargo.toml similarity index 94% rename from pallets/proxy-keystore/Cargo.toml rename to pallets/keystore/Cargo.toml index 9801916796..6a52575002 100644 --- a/pallets/proxy-keystore/Cargo.toml +++ b/pallets/keystore/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = 'pallet-proxy-keystore' +name = 'pallet-keystore' authors = ["Centrifuge "] -description = 'Proxy keystore pallet for runtime' +description = 'Keystore pallet for runtime' edition = '2018' license = "LGPL-3.0" -repository = "https://github.com/centrifuge/centrifuge-chain/pallets/proxy-keystore" +repository = "https://github.com/centrifuge/centrifuge-chain/pallets/keystore" version = '1.0.0' [package.metadata.docs.rs] diff --git a/pallets/proxy-keystore/src/benchmarking.rs b/pallets/keystore/src/benchmarking.rs similarity index 100% rename from pallets/proxy-keystore/src/benchmarking.rs rename to pallets/keystore/src/benchmarking.rs diff --git a/pallets/proxy-keystore/src/lib.rs b/pallets/keystore/src/lib.rs similarity index 100% rename from pallets/proxy-keystore/src/lib.rs rename to pallets/keystore/src/lib.rs diff --git a/pallets/proxy-keystore/src/mock.rs b/pallets/keystore/src/mock.rs similarity index 96% rename from pallets/proxy-keystore/src/mock.rs rename to pallets/keystore/src/mock.rs index fa29adf4d8..ec3484ca7a 100644 --- a/pallets/proxy-keystore/src/mock.rs +++ b/pallets/keystore/src/mock.rs @@ -11,7 +11,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -use crate::{self as pallet_proxy_keystore, Config}; +use crate::{self as pallet_keystore, Config}; use frame_support::parameter_types; use frame_support::traits::EnsureOneOf; @@ -33,7 +33,7 @@ frame_support::construct_runtime!( UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system::{Pallet, Call, Config, Storage, Event}, - ProxyKeystore: pallet_proxy_keystore::{Pallet, Call, Storage, Event}, + ProxyKeystore: pallet_keystore::{Pallet, Call, Storage, Event}, Balances: pallet_balances::{Pallet, Storage, Event}, } ); diff --git a/pallets/proxy-keystore/src/tests.rs b/pallets/keystore/src/tests.rs similarity index 100% rename from pallets/proxy-keystore/src/tests.rs rename to pallets/keystore/src/tests.rs diff --git a/pallets/proxy-keystore/src/weights.rs b/pallets/keystore/src/weights.rs similarity index 90% rename from pallets/proxy-keystore/src/weights.rs rename to pallets/keystore/src/weights.rs index 5cd0132629..330ed1b3c3 100644 --- a/pallets/proxy-keystore/src/weights.rs +++ b/pallets/keystore/src/weights.rs @@ -1,4 +1,4 @@ -//! Autogenerated weights for pallet_proxy_keystore +//! Autogenerated weights for pallet_keystore //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2022-06-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -11,12 +11,12 @@ // --chain=development // --steps=50 // --repeat=20 -// --pallet=pallet-proxy-keystore +// --pallet=pallet-keystore // --extrinsic=* // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./pallets/proxy-keystore/src/weights.rs +// --output=./pallets/keystore/src/weights.rs // --template=./scripts/frame-weight-template.hbs #![allow(unused_parens)] @@ -28,14 +28,14 @@ use frame_support::{ }; use sp_std::marker::PhantomData; -/// Weight functions needed for pallet_proxy_keystore. +/// Weight functions needed for pallet_keystore. pub trait WeightInfo { fn add_keys(n: u32) -> Weight; fn revoke_keys(n: u32) -> Weight; fn set_deposit() -> Weight; } -/// Weights for pallet_proxy_keystore using the Substrate node and recommended hardware. +/// Weights for pallet_keystore using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn add_keys(n: u32) -> Weight { diff --git a/runtime/development/Cargo.toml b/runtime/development/Cargo.toml index 0de3990c47..80b38fa84b 100644 --- a/runtime/development/Cargo.toml +++ b/runtime/development/Cargo.toml @@ -127,7 +127,7 @@ pallet-permissions = { path = "../../pallets/permissions", default-features = fa pallet-nft-sales = { path = "../../pallets/nft-sales", default-features = false } pallet-bridge = { path = "../../pallets/bridge", default-features = false } pallet-nft = { path = "../../pallets/nft", default-features = false } -pallet-proxy-keystore = { path = "../../pallets/proxy-keystore", default-features = false } +pallet-keystore = { path = "../../pallets/keystore", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } @@ -221,7 +221,7 @@ std = [ "chainbridge/std", "pallet-nft/std", "pallet-bridge/std", - "pallet-proxy-keystore/std", + "pallet-keystore/std", ] runtime-benchmarks = [ @@ -249,7 +249,7 @@ runtime-benchmarks = [ "chainbridge/runtime-benchmarks", "pallet-uniques/runtime-benchmarks", "runtime-common/runtime-benchmarks", - "pallet-proxy-keystore/runtime-benchmarks", + "pallet-keystore/runtime-benchmarks", ] # A feature that should be enabled when the runtime should be build for on-chain diff --git a/runtime/development/src/lib.rs b/runtime/development/src/lib.rs index 5dbeab137b..965e2bca4d 100644 --- a/runtime/development/src/lib.rs +++ b/runtime/development/src/lib.rs @@ -355,7 +355,7 @@ pub enum ProxyType { Price, Invest, ProxyManagement, - ProxyKeystoreManagement, + KeystoreManagement, NFTMint, NFTTransfer, NFTManagement, @@ -415,10 +415,10 @@ impl InstanceFilter for ProxyType { c, Call::Proxy(..) ), - ProxyType::ProxyKeystoreManagement => matches!( + ProxyType::KeystoreManagement => matches!( c, - Call::ProxyKeystore(pallet_proxy_keystore::Call::add_keys{..}) | - Call::ProxyKeystore(pallet_proxy_keystore::Call::revoke_keys{..}) + Call::Keystore(pallet_keystore::Call::add_keys{..}) | + Call::Keystore(pallet_keystore::Call::revoke_keys{..}) ), ProxyType::NFTMint => matches!( c, @@ -1290,14 +1290,14 @@ parameter_types! { pub const DefaultKeyDeposit: Balance = 100 * CFG; } -impl pallet_proxy_keystore::pallet::Config for Runtime { +impl pallet_keystore::pallet::Config for Runtime { type Event = Event; type Balance = Balance; type Currency = Balances; type MaxKeys = MaxKeys; type DefaultKeyDeposit = DefaultKeyDeposit; type AdminOrigin = EnsureRootOr; - type WeightInfo = weights::pallet_proxy_keystore::SubstrateWeight; + type WeightInfo = weights::pallet_keystore::SubstrateWeight; } // Frame Order in this block dictates the index of each one in the metadata @@ -1356,7 +1356,7 @@ construct_runtime!( NftSales: pallet_nft_sales::{Pallet, Call, Storage, Event} = 100, Nfts: pallet_nft::{Pallet, Call, Event} = 103, Bridge: pallet_bridge::{Pallet, Call, Storage, Config, Event} = 101, - ProxyKeystore: pallet_proxy_keystore::{Pallet, Call, Storage, Event} = 102, + Keystore: pallet_keystore::{Pallet, Call, Storage, Event} = 102, // XCM XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 120, diff --git a/runtime/development/src/weights/mod.rs b/runtime/development/src/weights/mod.rs index c4ca5cc8a4..eabf053d5e 100644 --- a/runtime/development/src/weights/mod.rs +++ b/runtime/development/src/weights/mod.rs @@ -20,5 +20,5 @@ pub mod pallet_migration_manager; pub mod pallet_nft_sales; pub mod pallet_permissions; pub mod pallet_pools; -pub mod pallet_proxy_keystore; +pub mod pallet_keystore; pub mod pallet_restricted_tokens; diff --git a/runtime/development/src/weights/pallet_proxy_keystore.rs b/runtime/development/src/weights/pallet_keystore.rs similarity index 89% rename from runtime/development/src/weights/pallet_proxy_keystore.rs rename to runtime/development/src/weights/pallet_keystore.rs index 2afacea453..8a6b6dd6ec 100644 --- a/runtime/development/src/weights/pallet_proxy_keystore.rs +++ b/runtime/development/src/weights/pallet_keystore.rs @@ -1,4 +1,4 @@ -//! Autogenerated weights for pallet_proxy_keystore +//! Autogenerated weights for pallet_keystore //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2022-06-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -11,12 +11,12 @@ // --chain=development // --steps=50 // --repeat=20 -// --pallet=pallet-proxy-keystore +// --pallet=pallet-keystore // --extrinsic=* // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./runtime/development/src/weights/pallet_proxy_keystore.rs +// --output=./runtime/development/src/weights/pallet_keystore.rs // --template=./scripts/frame-weight-template.hbs #![allow(unused_parens)] @@ -26,7 +26,7 @@ use frame_support::{ traits::Get, weights::{constants::RocksDbWeight, Weight}, }; -use pallet_proxy_keystore::weights::WeightInfo; +use pallet_keystore::weights::WeightInfo; use sp_std::marker::PhantomData; /// Weights for pallet_proxy_keystore using the Substrate node and recommended hardware.