Skip to content
Snippets Groups Projects
Commit 6d6a089f authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

Fix #179 (!262)

* clippy with feature runtime-benchmarks

* replace convert by idtyattr
parent 52a27c65
No related branches found
No related tags found
1 merge request!262Fix #179
Pipeline #36989 passed
Showing with 41 additions and 53 deletions
...@@ -6532,6 +6532,7 @@ dependencies = [ ...@@ -6532,6 +6532,7 @@ dependencies = [
name = "pallet-membership" name = "pallet-membership"
version = "1.0.0" version = "1.0.0"
dependencies = [ dependencies = [
"duniter-primitives",
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",
"frame-system", "frame-system",
...@@ -6716,6 +6717,7 @@ dependencies = [ ...@@ -6716,6 +6717,7 @@ dependencies = [
name = "pallet-smith-members" name = "pallet-smith-members"
version = "1.0.0" version = "1.0.0"
dependencies = [ dependencies = [
"duniter-primitives",
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",
"frame-system", "frame-system",
...@@ -6834,6 +6836,7 @@ dependencies = [ ...@@ -6834,6 +6836,7 @@ dependencies = [
name = "pallet-universal-dividend" name = "pallet-universal-dividend"
version = "1.0.0" version = "1.0.0"
dependencies = [ dependencies = [
"duniter-primitives",
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",
"frame-system", "frame-system",
......
...@@ -30,15 +30,6 @@ use std::collections::BTreeMap; ...@@ -30,15 +30,6 @@ use std::collections::BTreeMap;
type AccountId = u64; type AccountId = u64;
type Block = frame_system::mocking::MockBlock<Test>; type Block = frame_system::mocking::MockBlock<Test>;
pub struct IdentityIndexOf<T: pallet_identity::Config>(PhantomData<T>);
impl<T: pallet_identity::Config> sp_runtime::traits::Convert<T::AccountId, Option<T::IdtyIndex>>
for IdentityIndexOf<T>
{
fn convert(account_id: T::AccountId) -> Option<T::IdtyIndex> {
pallet_identity::Pallet::<T>::identity_index_of(account_id)
}
}
// Configure a mock runtime to test the pallet. // Configure a mock runtime to test the pallet.
frame_support::construct_runtime!( frame_support::construct_runtime!(
pub enum Test { pub enum Test {
...@@ -145,12 +136,11 @@ parameter_types! { ...@@ -145,12 +136,11 @@ parameter_types! {
} }
impl pallet_membership::Config for Test { impl pallet_membership::Config for Test {
type AccountIdOf = ();
#[cfg(feature = "runtime-benchmarks")] #[cfg(feature = "runtime-benchmarks")]
type BenchmarkSetupHandler = (); type BenchmarkSetupHandler = ();
type CheckMembershipOpAllowed = DuniterWot; type CheckMembershipOpAllowed = DuniterWot;
type IdtyAttr = Identity;
type IdtyId = IdtyIndex; type IdtyId = IdtyIndex;
type IdtyIdOf = IdentityIndexOf<Self>;
type MembershipPeriod = MembershipPeriod; type MembershipPeriod = MembershipPeriod;
type MembershipRenewalPeriod = MembershipRenewalPeriod; type MembershipRenewalPeriod = MembershipRenewalPeriod;
type OnNewMembership = DuniterWot; type OnNewMembership = DuniterWot;
......
...@@ -40,6 +40,7 @@ try-runtime = [ ...@@ -40,6 +40,7 @@ try-runtime = [
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
duniter-primitives = { workspace = true }
codec = { workspace = true, features = ["derive"] } codec = { workspace = true, features = ["derive"] }
frame-benchmarking = { workspace = true, optional = true } frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true } frame-support = { workspace = true }
......
...@@ -69,7 +69,6 @@ pub mod pallet { ...@@ -69,7 +69,6 @@ pub mod pallet {
use super::*; use super::*;
use frame_support::traits::StorageVersion; use frame_support::traits::StorageVersion;
use frame_system::pallet_prelude::*; use frame_system::pallet_prelude::*;
use sp_runtime::traits::Convert;
/// The current storage version. /// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
...@@ -87,10 +86,8 @@ pub mod pallet { ...@@ -87,10 +86,8 @@ pub mod pallet {
type CheckMembershipOpAllowed: CheckMembershipOpAllowed<Self::IdtyId>; type CheckMembershipOpAllowed: CheckMembershipOpAllowed<Self::IdtyId>;
/// Something that identifies an identity /// Something that identifies an identity
type IdtyId: Copy + MaybeSerializeDeserialize + Parameter + Ord; type IdtyId: Copy + MaybeSerializeDeserialize + Parameter + Ord;
/// Something that gives the IdtyId of an AccountId /// Something that gives the IdtyId of an AccountId and reverse
type IdtyIdOf: Convert<Self::AccountId, Option<Self::IdtyId>>; type IdtyAttr: duniter_primitives::Idty<Self::IdtyId, Self::AccountId>;
/// Something that gives the AccountId of an IdtyId
type AccountIdOf: Convert<Self::IdtyId, Option<Self::AccountId>>;
/// Maximum life span of a single membership (in number of blocks) /// Maximum life span of a single membership (in number of blocks)
// (this could be renamed "validity" or "duration") // (this could be renamed "validity" or "duration")
#[pallet::constant] #[pallet::constant]
......
...@@ -22,7 +22,7 @@ use frame_support::{ ...@@ -22,7 +22,7 @@ use frame_support::{
use frame_system as system; use frame_system as system;
use sp_core::H256; use sp_core::H256;
use sp_runtime::{ use sp_runtime::{
traits::{BlakeTwo256, ConvertInto, IdentityLookup}, traits::{BlakeTwo256, IdentityLookup},
BuildStorage, BuildStorage,
}; };
...@@ -82,12 +82,11 @@ parameter_types! { ...@@ -82,12 +82,11 @@ parameter_types! {
} }
impl pallet_membership::Config for Test { impl pallet_membership::Config for Test {
type AccountIdOf = ConvertInto;
#[cfg(feature = "runtime-benchmarks")] #[cfg(feature = "runtime-benchmarks")]
type BenchmarkSetupHandler = (); type BenchmarkSetupHandler = ();
type CheckMembershipOpAllowed = (); type CheckMembershipOpAllowed = ();
type IdtyAttr = ();
type IdtyId = IdtyId; type IdtyId = IdtyId;
type IdtyIdOf = ConvertInto;
type MembershipPeriod = MembershipPeriod; type MembershipPeriod = MembershipPeriod;
type MembershipRenewalPeriod = MembershipRenewalPeriod; type MembershipRenewalPeriod = MembershipRenewalPeriod;
type OnNewMembership = (); type OnNewMembership = ();
......
...@@ -13,6 +13,7 @@ version.workspace = true ...@@ -13,6 +13,7 @@ version.workspace = true
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
duniter-primitives = { workspace = true }
codec = { workspace = true, features = ["derive"] } codec = { workspace = true, features = ["derive"] }
frame-benchmarking = { workspace = true, optional = true } frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true } frame-support = { workspace = true }
......
...@@ -20,7 +20,6 @@ use super::*; ...@@ -20,7 +20,6 @@ use super::*;
use frame_benchmarking::v2::*; use frame_benchmarking::v2::*;
use frame_system::RawOrigin; use frame_system::RawOrigin;
use sp_runtime::traits::Convert;
use crate::Pallet; use crate::Pallet;
...@@ -38,7 +37,7 @@ mod benchmarks { ...@@ -38,7 +37,7 @@ mod benchmarks {
#[benchmark] #[benchmark]
fn invite_smith() { fn invite_smith() {
let issuer: T::IdtyIndex = 1.into(); let issuer: T::IdtyIndex = 1.into();
let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap();
Pallet::<T>::on_smith_goes_online(1.into()); Pallet::<T>::on_smith_goes_online(1.into());
let receiver: T::IdtyIndex = 4.into(); let receiver: T::IdtyIndex = 4.into();
...@@ -51,14 +50,14 @@ mod benchmarks { ...@@ -51,14 +50,14 @@ mod benchmarks {
#[benchmark] #[benchmark]
fn accept_invitation() -> Result<(), BenchmarkError> { fn accept_invitation() -> Result<(), BenchmarkError> {
let issuer: T::IdtyIndex = 1.into(); let issuer: T::IdtyIndex = 1.into();
let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap();
Pallet::<T>::on_smith_goes_online(1.into()); Pallet::<T>::on_smith_goes_online(1.into());
let caller_origin: <T as frame_system::Config>::RuntimeOrigin = let caller_origin: <T as frame_system::Config>::RuntimeOrigin =
RawOrigin::Signed(caller.clone()).into(); RawOrigin::Signed(caller.clone()).into();
let receiver: T::IdtyIndex = 4.into(); let receiver: T::IdtyIndex = 4.into();
Pallet::<T>::invite_smith(caller_origin, receiver)?; Pallet::<T>::invite_smith(caller_origin, receiver)?;
let issuer: T::IdtyIndex = 4.into(); let issuer: T::IdtyIndex = 4.into();
let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap();
#[extrinsic_call] #[extrinsic_call]
_(RawOrigin::Signed(caller)); _(RawOrigin::Signed(caller));
...@@ -75,19 +74,19 @@ mod benchmarks { ...@@ -75,19 +74,19 @@ mod benchmarks {
#[benchmark] #[benchmark]
fn certify_smith() -> Result<(), BenchmarkError> { fn certify_smith() -> Result<(), BenchmarkError> {
let issuer: T::IdtyIndex = 1.into(); let issuer: T::IdtyIndex = 1.into();
let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap();
Pallet::<T>::on_smith_goes_online(1.into()); Pallet::<T>::on_smith_goes_online(1.into());
let caller_origin: <T as frame_system::Config>::RuntimeOrigin = let caller_origin: <T as frame_system::Config>::RuntimeOrigin =
RawOrigin::Signed(caller.clone()).into(); RawOrigin::Signed(caller.clone()).into();
let receiver: T::IdtyIndex = 4.into(); let receiver: T::IdtyIndex = 4.into();
Pallet::<T>::invite_smith(caller_origin, receiver)?; Pallet::<T>::invite_smith(caller_origin, receiver)?;
let issuer: T::IdtyIndex = receiver; let issuer: T::IdtyIndex = receiver;
let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap();
let caller_origin: <T as frame_system::Config>::RuntimeOrigin = let caller_origin: <T as frame_system::Config>::RuntimeOrigin =
RawOrigin::Signed(caller.clone()).into(); RawOrigin::Signed(caller.clone()).into();
Pallet::<T>::accept_invitation(caller_origin)?; Pallet::<T>::accept_invitation(caller_origin)?;
let issuer: T::IdtyIndex = 1.into(); let issuer: T::IdtyIndex = 1.into();
let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap();
#[extrinsic_call] #[extrinsic_call]
_(RawOrigin::Signed(caller), receiver); _(RawOrigin::Signed(caller), receiver);
......
...@@ -31,6 +31,7 @@ pub mod weights; ...@@ -31,6 +31,7 @@ pub mod weights;
mod benchmarking; mod benchmarking;
use codec::{Codec, Decode, Encode}; use codec::{Codec, Decode, Encode};
use duniter_primitives::Idty;
use frame_support::dispatch::DispatchResultWithPostInfo; use frame_support::dispatch::DispatchResultWithPostInfo;
use frame_support::ensure; use frame_support::ensure;
use frame_support::pallet_prelude::Get; use frame_support::pallet_prelude::Get;
...@@ -108,11 +109,9 @@ pub mod pallet { ...@@ -108,11 +109,9 @@ pub mod pallet {
+ MaxEncodedLen; + MaxEncodedLen;
/// Identifier for an authority-member /// Identifier for an authority-member
type MemberId: Copy + Ord + MaybeSerializeDeserialize + Parameter; type MemberId: Copy + Ord + MaybeSerializeDeserialize + Parameter;
/// Something that gives the IdtyId of an AccountId /// Something that gives the IdtyId of an AccountId and reverse
type IdtyIdOf: Convert<Self::AccountId, Option<Self::IdtyIndex>>; type IdtyAttr: duniter_primitives::Idty<Self::IdtyIndex, Self::AccountId>;
/// Something that give the owner key of an identity // /// Something that give the owner key of an identity
type OwnerKeyOf: Convert<Self::IdtyIndex, Option<Self::AccountId>>;
/// Something that gives the IdtyId of an AccountId
type IdtyIdOfAuthorityId: Convert<Self::MemberId, Option<Self::IdtyIndex>>; type IdtyIdOfAuthorityId: Convert<Self::MemberId, Option<Self::IdtyIndex>>;
/// Maximum number of active certifications by issuer /// Maximum number of active certifications by issuer
#[pallet::constant] #[pallet::constant]
...@@ -291,7 +290,7 @@ pub mod pallet { ...@@ -291,7 +290,7 @@ pub mod pallet {
) -> DispatchResultWithPostInfo { ) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin.clone())?; let who = ensure_signed(origin.clone())?;
let issuer = let issuer =
T::IdtyIdOf::convert(who.clone()).ok_or(Error::<T>::OriginMustHaveAnIdentity)?; T::IdtyAttr::idty_index(who.clone()).ok_or(Error::<T>::OriginMustHaveAnIdentity)?;
Self::check_invite_smith(issuer, receiver)?; Self::check_invite_smith(issuer, receiver)?;
Self::do_invite_smith(issuer, receiver); Self::do_invite_smith(issuer, receiver);
Ok(().into()) Ok(().into())
...@@ -303,7 +302,7 @@ pub mod pallet { ...@@ -303,7 +302,7 @@ pub mod pallet {
pub fn accept_invitation(origin: OriginFor<T>) -> DispatchResultWithPostInfo { pub fn accept_invitation(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin.clone())?; let who = ensure_signed(origin.clone())?;
let receiver = let receiver =
T::IdtyIdOf::convert(who.clone()).ok_or(Error::<T>::OriginMustHaveAnIdentity)?; T::IdtyAttr::idty_index(who.clone()).ok_or(Error::<T>::OriginMustHaveAnIdentity)?;
Self::check_accept_invitation(receiver)?; Self::check_accept_invitation(receiver)?;
Self::do_accept_invitation(receiver)?; Self::do_accept_invitation(receiver)?;
Ok(().into()) Ok(().into())
...@@ -318,7 +317,7 @@ pub mod pallet { ...@@ -318,7 +317,7 @@ pub mod pallet {
) -> DispatchResultWithPostInfo { ) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?; let who = ensure_signed(origin)?;
let issuer = let issuer =
T::IdtyIdOf::convert(who.clone()).ok_or(Error::<T>::OriginMustHaveAnIdentity)?; T::IdtyAttr::idty_index(who.clone()).ok_or(Error::<T>::OriginMustHaveAnIdentity)?;
Self::check_certify_smith(issuer, receiver)?; Self::check_certify_smith(issuer, receiver)?;
Self::do_certify_smith(receiver, issuer); Self::do_certify_smith(receiver, issuer);
Ok(().into()) Ok(().into())
......
...@@ -84,7 +84,7 @@ impl IsMember<u64> for EveryoneExceptIdZero { ...@@ -84,7 +84,7 @@ impl IsMember<u64> for EveryoneExceptIdZero {
} }
impl pallet_smith_members::Config for Runtime { impl pallet_smith_members::Config for Runtime {
type IdtyIdOf = ConvertInto; type IdtyAttr = ();
type IdtyIdOfAuthorityId = ConvertInto; type IdtyIdOfAuthorityId = ConvertInto;
type IdtyIndex = u64; type IdtyIndex = u64;
type IsWoTMember = EveryoneExceptIdZero; type IsWoTMember = EveryoneExceptIdZero;
...@@ -92,7 +92,6 @@ impl pallet_smith_members::Config for Runtime { ...@@ -92,7 +92,6 @@ impl pallet_smith_members::Config for Runtime {
type MemberId = u64; type MemberId = u64;
type MinCertForMembership = ConstU32<2>; type MinCertForMembership = ConstU32<2>;
type OnSmithDelete = (); type OnSmithDelete = ();
type OwnerKeyOf = ConvertInto;
type RuntimeEvent = RuntimeEvent; type RuntimeEvent = RuntimeEvent;
type SmithInactivityMaxDuration = ConstU32<5>; type SmithInactivityMaxDuration = ConstU32<5>;
type WeightInfo = (); type WeightInfo = ();
......
...@@ -49,6 +49,7 @@ default-features = false ...@@ -49,6 +49,7 @@ default-features = false
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
duniter-primitives = { workspace = true }
codec = { workspace = true, features = ["derive", "max-encoded-len"] } codec = { workspace = true, features = ["derive", "max-encoded-len"] }
frame-benchmarking = { workspace = true, optional = true } frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true } frame-support = { workspace = true }
......
...@@ -27,7 +27,6 @@ use frame_support::traits::StoredMap; ...@@ -27,7 +27,6 @@ use frame_support::traits::StoredMap;
use frame_system::RawOrigin; use frame_system::RawOrigin;
use pallet_balances::Pallet as Balances; use pallet_balances::Pallet as Balances;
use sp_runtime::traits::Bounded; use sp_runtime::traits::Bounded;
use sp_runtime::traits::Convert;
use crate::Pallet; use crate::Pallet;
...@@ -50,7 +49,7 @@ mod benchmarks { ...@@ -50,7 +49,7 @@ mod benchmarks {
// Benchmark `transfer_ud` extrinsic with the worst possible conditions: // Benchmark `transfer_ud` extrinsic with the worst possible conditions:
// * Transfer will kill the sender account. // * Transfer will kill the sender account.
// * Transfer will create the recipient account. // * Transfer will create the recipient account.
let caller: T::AccountId = T::AccountIdOf::convert(1).unwrap(); let caller: T::AccountId = T::IdtyAttr::owner_key(1).unwrap();
CurrentUdIndex::<T>::put(2054u16); CurrentUdIndex::<T>::put(2054u16);
T::MembersStorage::insert( T::MembersStorage::insert(
&caller, &caller,
...@@ -135,7 +134,7 @@ mod benchmarks { ...@@ -135,7 +134,7 @@ mod benchmarks {
#[benchmark] #[benchmark]
fn on_removed_member(i: Linear<1, { T::MaxPastReeval::get() }>) -> Result<(), BenchmarkError> { fn on_removed_member(i: Linear<1, { T::MaxPastReeval::get() }>) -> Result<(), BenchmarkError> {
let caller: T::AccountId = T::AccountIdOf::convert(1).unwrap(); let caller: T::AccountId = T::IdtyAttr::owner_key(1).unwrap();
CurrentUdIndex::<T>::put(2054u16); CurrentUdIndex::<T>::put(2054u16);
T::MembersStorage::insert( T::MembersStorage::insert(
&caller, &caller,
......
...@@ -18,12 +18,16 @@ ...@@ -18,12 +18,16 @@
mod benchmarking; mod benchmarking;
mod compute_claim_uds; mod compute_claim_uds;
mod types;
mod weights;
#[cfg(test)] #[cfg(test)]
mod mock; mod mock;
#[cfg(test)] #[cfg(test)]
mod tests; mod tests;
mod types;
mod weights; #[cfg(feature = "runtime-benchmarks")]
use duniter_primitives::Idty;
pub use pallet::*; pub use pallet::*;
pub use types::*; pub use types::*;
...@@ -86,8 +90,9 @@ pub mod pallet { ...@@ -86,8 +90,9 @@ pub mod pallet {
type UnitsPerUd: Get<BalanceOf<Self>>; type UnitsPerUd: Get<BalanceOf<Self>>;
/// Pallet weights info /// Pallet weights info
type WeightInfo: WeightInfo; type WeightInfo: WeightInfo;
/// Something that gives the IdtyId of an AccountId and reverse
#[cfg(feature = "runtime-benchmarks")] #[cfg(feature = "runtime-benchmarks")]
type AccountIdOf: Convert<u32, Option<Self::AccountId>>; type IdtyAttr: duniter_primitives::Idty<u32, Self::AccountId>;
} }
// STORAGE // // STORAGE //
......
...@@ -27,9 +27,6 @@ use sp_runtime::{ ...@@ -27,9 +27,6 @@ use sp_runtime::{
BuildStorage, BuildStorage,
}; };
#[cfg(feature = "runtime-benchmarks")]
use sp_runtime::traits::ConvertInto;
pub const BLOCK_TIME: u64 = 6_000; pub const BLOCK_TIME: u64 = 6_000;
type Balance = u64; type Balance = u64;
...@@ -142,9 +139,9 @@ impl frame_support::traits::StoredMap<u32, FirstEligibleUd> for TestMembersStora ...@@ -142,9 +139,9 @@ impl frame_support::traits::StoredMap<u32, FirstEligibleUd> for TestMembersStora
} }
impl pallet_universal_dividend::Config for Test { impl pallet_universal_dividend::Config for Test {
#[cfg(feature = "runtime-benchmarks")]
type AccountIdOf = ConvertInto;
type Currency = pallet_balances::Pallet<Test>; type Currency = pallet_balances::Pallet<Test>;
#[cfg(feature = "runtime-benchmarks")]
type IdtyAttr = ();
type MaxPastReeval = frame_support::traits::ConstU32<2>; type MaxPastReeval = frame_support::traits::ConstU32<2>;
type MembersCount = MembersCount; type MembersCount = MembersCount;
type MembersStorage = TestMembersStorage; type MembersStorage = TestMembersStorage;
......
...@@ -29,6 +29,7 @@ pub fn validate_idty_name(idty_name: &[u8]) -> bool { ...@@ -29,6 +29,7 @@ pub fn validate_idty_name(idty_name: &[u8]) -> bool {
} }
/// trait used to go from index to owner key and reverse /// trait used to go from index to owner key and reverse
// replaces less explicit "Convert" implementations
pub trait Idty<IdtyIndex, AccountId> { pub trait Idty<IdtyIndex, AccountId> {
fn owner_key(index: IdtyIndex) -> Option<AccountId>; fn owner_key(index: IdtyIndex) -> Option<AccountId>;
fn idty_index(owner_key: AccountId) -> Option<IdtyIndex>; fn idty_index(owner_key: AccountId) -> Option<IdtyIndex>;
......
...@@ -457,7 +457,7 @@ type RuntimeFreezeReason = (); ...@@ -457,7 +457,7 @@ type RuntimeFreezeReason = ();
type UnitsPerUd = frame_support::traits::ConstU64<1_000>; type UnitsPerUd = frame_support::traits::ConstU64<1_000>;
type WeightInfo = common_runtime::weights::pallet_universal_dividend::WeightInfo<Runtime>; type WeightInfo = common_runtime::weights::pallet_universal_dividend::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")] #[cfg(feature = "runtime-benchmarks")]
type AccountIdOf = common_runtime::providers::IdentityAccountIdProvider<Self>; type IdtyAttr = Identity;
} }
// WEB OF TRUST // // WEB OF TRUST //
...@@ -501,8 +501,7 @@ type RuntimeFreezeReason = (); ...@@ -501,8 +501,7 @@ type RuntimeFreezeReason = ();
impl pallet_membership::Config for Runtime { impl pallet_membership::Config for Runtime {
type CheckMembershipOpAllowed = Wot; type CheckMembershipOpAllowed = Wot;
type IdtyId = IdtyIndex; type IdtyId = IdtyIndex;
type IdtyIdOf = common_runtime::providers::IdentityIndexOf<Self>; type IdtyAttr = Identity;
type AccountIdOf = common_runtime::providers::IdentityAccountIdProvider<Self>;
type MembershipPeriod = MembershipPeriod; type MembershipPeriod = MembershipPeriod;
type MembershipRenewalPeriod = MembershipRenewalPeriod; type MembershipRenewalPeriod = MembershipRenewalPeriod;
type OnNewMembership = OnNewMembershipHandler<Runtime>; type OnNewMembership = OnNewMembershipHandler<Runtime>;
...@@ -546,7 +545,7 @@ type RuntimeFreezeReason = (); ...@@ -546,7 +545,7 @@ type RuntimeFreezeReason = ();
type RuntimeEvent = RuntimeEvent; type RuntimeEvent = RuntimeEvent;
type IdtyIndex = IdtyIndex; type IdtyIndex = IdtyIndex;
type IsWoTMember = common_runtime::providers::IsWoTMemberProvider<Runtime>; type IsWoTMember = common_runtime::providers::IsWoTMemberProvider<Runtime>;
type IdtyIdOf = common_runtime::providers::IdentityIndexOf<Self>; type IdtyAttr = Identity;
type MinCertForMembership = SmithWotMinCertForMembership; type MinCertForMembership = SmithWotMinCertForMembership;
type MaxByIssuer = SmithMaxByIssuer; type MaxByIssuer = SmithMaxByIssuer;
type SmithInactivityMaxDuration = SmithInactivityMaxDuration; type SmithInactivityMaxDuration = SmithInactivityMaxDuration;
...@@ -554,8 +553,6 @@ type RuntimeFreezeReason = (); ...@@ -554,8 +553,6 @@ type RuntimeFreezeReason = ();
type IdtyIdOfAuthorityId = sp_runtime::traits::ConvertInto; type IdtyIdOfAuthorityId = sp_runtime::traits::ConvertInto;
type MemberId = IdtyIndex; type MemberId = IdtyIndex;
type WeightInfo = common_runtime::weights::pallet_smith_members::WeightInfo<Runtime>; type WeightInfo = common_runtime::weights::pallet_smith_members::WeightInfo<Runtime>;
// TODO: remove as it is only used for benchmarking
type OwnerKeyOf = Identity;
} }
pub struct TechnicalCommitteeDefaultVote; pub struct TechnicalCommitteeDefaultVote;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment