Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/kilt-dip-primitives/src/verifier/parachain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ impl<
+ pallet_did_lookup::Config,
KiltRuntime::IdentityCommitmentGenerator:
IdentityCommitmentGenerator<KiltRuntime, Output = RelaychainRuntime::Hash>,
KiltRuntime::Web3Name: Eq,
SignedExtra: GetWithoutArg,
SignedExtra::Result: Encode + Debug,
DidCallVerifier: DipCallOriginFilter<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ impl<
+ pallet_did_lookup::Config,
KiltRuntime::IdentityCommitmentGenerator:
IdentityCommitmentGenerator<KiltRuntime, Output = RelaychainRuntime::Hash>,
KiltRuntime::Web3Name: Eq,
SignedExtra: GetWithoutArg,
SignedExtra::Result: Encode + Debug,
DidCallVerifier: DipCallOriginFilter<
Expand Down
1 change: 1 addition & 0 deletions crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ impl<
+ pallet_web3_names::Config
+ pallet_did_lookup::Config,
KiltRuntime::IdentityCommitmentGenerator: IdentityCommitmentGenerator<KiltRuntime, Output = ConsumerRuntime::Hash>,
KiltRuntime::Web3Name: Eq,
SignedExtra: GetWithoutArg,
SignedExtra::Result: Encode + Debug,
DidCallVerifier: DipCallOriginFilter<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ impl<
+ pallet_web3_names::Config
+ pallet_did_lookup::Config,
KiltRuntime::IdentityCommitmentGenerator: IdentityCommitmentGenerator<KiltRuntime, Output = ConsumerRuntime::Hash>,
KiltRuntime::Web3Name: Eq,
IdentityCommitmentOf<KiltRuntime>: Into<KiltRuntime::Hash>,
SignedExtra: GetWithoutArg,
SignedExtra::Result: Encode + Debug,
Expand Down
14 changes: 9 additions & 5 deletions dip-template/runtimes/dip-provider/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

use pallet_did_lookup::linkable_account::LinkableAccountId;
use pallet_web3_names::web3_name::AsciiWeb3Name;
use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
Expand Down Expand Up @@ -437,22 +436,27 @@ impl pallet_did_lookup::Config for Runtime {
type WeightInfo = weights::pallet_did_lookup::WeightInfo<Runtime>;
}

pub type Web3Name = AsciiWeb3Name<Runtime>;
pub const MIN_NAME_LENGTH: u32 = 3;
pub const MAX_NAME_LENGTH: u32 = 3;
pub type Web3Name = runtime_common::Web3Name<MIN_NAME_LENGTH, MAX_NAME_LENGTH>;

impl pallet_web3_names::Config for Runtime {
type BalanceMigrationManager = ();
type BanOrigin = EnsureRoot<AccountId>;
type Currency = Balances;
type Deposit = ConstU128<UNIT>;
type MaxNameLength = ConstU32<32>;
type MinNameLength = ConstU32<3>;
type MaxNameLength = ConstU32<MAX_NAME_LENGTH>;
type MinNameLength = ConstU32<MIN_NAME_LENGTH>;
type OriginSuccess = DidRawOrigin<AccountId, DidIdentifier>;
type OwnerOrigin = EnsureDidOrigin<DidIdentifier, AccountId>;
type RuntimeEvent = RuntimeEvent;
type RuntimeHoldReason = RuntimeHoldReason;
type Web3Name = Web3Name;
type Web3NameOwner = DidIdentifier;
type WeightInfo = weights::pallet_web3_names::WeightInfo<Runtime>;

#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
}

#[cfg(feature = "runtime-benchmarks")]
Expand Down Expand Up @@ -639,7 +643,7 @@ impl_runtime_apis! {
BlockNumber
>
> {
let name: pallet_web3_names::web3_name::AsciiWeb3Name<Runtime> = name.try_into().ok()?;
let name: pallet_web3_names::Web3NameOf<Runtime> = name.try_into().ok()?;
pallet_web3_names::Owner::<Runtime>::get(&name)
.and_then(|owner_info| {
did::Did::<Runtime>::get(&owner_info.owner).map(|details| (owner_info, details))
Expand Down
4 changes: 2 additions & 2 deletions pallets/pallet-migration/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,6 @@ benchmarks! {

impl_benchmark_test_suite! {
Pallet,
crate::mock::runtime::ExtBuilder::default().build_with_keystore(),
crate::mock::runtime::Test
crate::mock::ExtBuilder::default().build_with_keystore(),
crate::mock::Test
}
17 changes: 6 additions & 11 deletions pallets/pallet-migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub mod default_weights;

#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
#[cfg(any(test, feature = "runtime-benchmarks"))]
#[cfg(test)]
mod mock;
#[cfg(test)]
mod test;
Expand All @@ -44,13 +44,14 @@ pub use crate::{default_weights::WeightInfo, pallet::*};
pub mod pallet {
use super::*;

use core::fmt::Debug;
use frame_support::{
pallet_prelude::*,
traits::{fungible::Inspect, Currency, ReservableCurrency},
DefaultNoBound,
};
use frame_system::pallet_prelude::*;
use sp_runtime::{traits::Hash, SaturatedConversion};
use sp_std::fmt::Debug;

use attestation::{Attestations, ClaimHashOf};
use delegation::{DelegationNodeIdOf, DelegationNodes};
Expand All @@ -66,15 +67,11 @@ pub mod pallet {

pub type HashOf<T> = <T as frame_system::Config>::Hash;

#[derive(Encode, Decode, TypeInfo, Debug, Clone, PartialEq, Eq)]
#[derive(Encode, Decode, TypeInfo, Debug, Clone, PartialEq, Eq, DefaultNoBound)]
#[scale_info(skip_type_params(T))]
pub struct EntriesToMigrate<T>
where
T: Config
+ did::Config
+ delegation::Config
+ frame_system::Config
+ pallet_web3_names::Config
+ public_credentials::Config,
T: Config + delegation::Config + did::Config + pallet_web3_names::Config + public_credentials::Config,
{
pub attestation: BoundedVec<ClaimHashOf<T>, <T as Config>::MaxMigrationsPerPallet>,
pub delegation: BoundedVec<DelegationNodeIdOf<T>, <T as Config>::MaxMigrationsPerPallet>,
Expand All @@ -93,7 +90,6 @@ pub mod pallet {
+ pallet_did_lookup::Config
+ pallet_web3_names::Config
+ public_credentials::Config
+ TypeInfo
{
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;

Expand All @@ -120,7 +116,6 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
#[pallet::getter(fn connected_dids)]
pub type MigratedKeys<T> = StorageMap<_, Blake2_128Concat, HashOf<T>, ()>;

#[pallet::event]
Expand Down
Loading