Skip to content

Commit

Permalink
Fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ntn-x2 committed Jan 17, 2025
1 parent 7ea029d commit f7717c1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
8 changes: 6 additions & 2 deletions pallets/did/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ use crate::{
did_details::{
DeriveDidCallAuthorizationVerificationKeyRelationship, DidAuthorizedCallOperation, DidPublicKey, DidSignature,
DidVerificationKey,
}, mock_utils::{
},
mock_utils::{
generate_base_did_creation_details, generate_base_did_details, get_key_agreement_keys, get_service_endpoints,
}, service_endpoints::DidEndpoint, signature::DidSignatureVerify, AccountIdOf, DidAuthorizedCallOperationOf, DidIdentifierOf, HoldReason
},
service_endpoints::DidEndpoint,
signature::DidSignatureVerify,
AccountIdOf, DidAuthorizedCallOperationOf, DidIdentifierOf, HoldReason,
};

const DEFAULT_ACCOUNT_ID: &str = "tx_submitter";
Expand Down
21 changes: 9 additions & 12 deletions runtimes/peregrine/src/kilt/did.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@
// If you feel like getting in touch with us, you can do so at [email protected]

use did::{
DeriveDidCallAuthorizationVerificationKeyRelationship,
DeriveDidCallKeyRelationshipResult, DidRawOrigin, DidVerificationKeyRelationship, EnsureDidOrigin,
RelationshipDeriveError,
DeriveDidCallAuthorizationVerificationKeyRelationship, DeriveDidCallKeyRelationshipResult, DidRawOrigin,
DidVerificationKeyRelationship, EnsureDidOrigin, RelationshipDeriveError,
};
use frame_system::EnsureRoot;
use runtime_common::{
constants,
AccountId, DidIdentifier,
SendDustAndFeesToTreasury,
};
use runtime_common::{constants, AccountId, DidIdentifier, SendDustAndFeesToTreasury};
use sp_core::ConstBool;

use crate::{
Expand Down Expand Up @@ -107,14 +102,16 @@ impl did::traits::DidDeletionHook<Runtime> for EnsureNoNamesAndNoLinkedAccountsO
}
// 3. Check if there's a Web3name linked account
if pallet_did_lookup::ConnectedAccounts::<Runtime>::iter_key_prefix(did)
.next()
.is_some() {
.next()
.is_some()
{
return false;
}
// 4. Check if there's a Dotname linked account
if pallet_did_lookup::ConnectedAccounts::<Runtime, UniqueLinkingDeployment>::iter_key_prefix(did)
.next()
.is_some() {
.next()
.is_some()
{
return false;
}

Expand Down
20 changes: 9 additions & 11 deletions runtimes/spiritnet/src/kilt/did.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@
// If you feel like getting in touch with us, you can do so at [email protected]

use did::{
DeriveDidCallAuthorizationVerificationKeyRelationship,
DeriveDidCallKeyRelationshipResult, DidRawOrigin, DidVerificationKeyRelationship, EnsureDidOrigin,
RelationshipDeriveError,
DeriveDidCallAuthorizationVerificationKeyRelationship, DeriveDidCallKeyRelationshipResult, DidRawOrigin,
DidVerificationKeyRelationship, EnsureDidOrigin, RelationshipDeriveError,
};
use frame_system::EnsureRoot;
use runtime_common::{
constants,
AccountId, DidIdentifier, SendDustAndFeesToTreasury,
};
use runtime_common::{constants, AccountId, DidIdentifier, SendDustAndFeesToTreasury};
use sp_core::ConstBool;

use crate::{
Expand Down Expand Up @@ -106,14 +102,16 @@ impl did::traits::DidDeletionHook<Runtime> for EnsureNoNamesAndNoLinkedAccountsO
}
// 3. Check if there's a Web3name linked account
if pallet_did_lookup::ConnectedAccounts::<Runtime>::iter_key_prefix(did)
.next()
.is_some() {
.next()
.is_some()
{
return false;
}
// 4. Check if there's a Dotname linked account
if pallet_did_lookup::ConnectedAccounts::<Runtime, UniqueLinkingDeployment>::iter_key_prefix(did)
.next()
.is_some() {
.next()
.is_some()
{
return false;
}

Expand Down

0 comments on commit f7717c1

Please sign in to comment.