Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weichweich committed Aug 31, 2023
1 parent 86ce1d2 commit 1969966
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion pallets/did/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,13 @@ pub mod pallet {
Ok(())
}

#[allow(clippy::boxed_local)]
#[pallet::call_index(15)]
#[pallet::weight(1000)]
pub fn dispatch_as(
origin: OriginFor<T>,
did_identifier: DidIdentifierOf<T>,
call: DidCallableOf<T>,
call: Box<DidCallableOf<T>>,
) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;

Expand Down
2 changes: 1 addition & 1 deletion pallets/did/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ pub fn get_ecdsa_delegation_key(default: bool) -> ecdsa::Pair {
}
}

pub fn generate_key_id(key: &DidPublicKey) -> KeyIdOf<Test> {
pub fn generate_key_id(key: &DidPublicKey<AccountId>) -> KeyIdOf<Test> {
crate_utils::calculate_key_id::<Test>(key)
}

Expand Down
2 changes: 1 addition & 1 deletion pallets/did/src/mock_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn generate_base_did_creation_details<T: Config>(
}

pub fn generate_base_did_details<T>(
authentication_key: DidVerificationKey,
authentication_key: DidVerificationKey<AccountIdOf<T>>,
deposit_owner: Option<AccountIdOf<T>>,
) -> DidDetails<T>
where
Expand Down
2 changes: 1 addition & 1 deletion runtime-api/did/src/did_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct DidDetails<Key: Ord, BlockNumber: MaxEncodedLen, AccountId, Balance>
pub key_agreement_keys: BTreeSet<Key>,
pub delegation_key: Option<Key>,
pub attestation_key: Option<Key>,
pub public_keys: BTreeMap<Key, DidPublicKeyDetails<BlockNumber>>,
pub public_keys: BTreeMap<Key, DidPublicKeyDetails<BlockNumber, AccountId>>,
pub last_tx_counter: u64,
pub deposit: Deposit<AccountId, Balance>,
}
Expand Down
2 changes: 1 addition & 1 deletion runtimes/peregrine/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn did_storage_sizes() {
assert_eq!(max_did_endpoint_size, MAX_SERVICE_ENDPOINT_BYTE_LENGTH as usize);

// DID key
let max_did_key_size = did::did_details::DidPublicKey::max_encoded_len();
let max_did_key_size = did::did_details::DidPublicKey::<AccountId>::max_encoded_len();
assert_eq!(max_did_key_size, MAX_KEY_LENGTH as usize);
}

Expand Down
2 changes: 1 addition & 1 deletion runtimes/spiritnet/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn did_storage_sizes() {
assert_eq!(max_did_endpoint_size, MAX_SERVICE_ENDPOINT_BYTE_LENGTH as usize);

// DID key
let max_did_key_size = did::did_details::DidPublicKey::max_encoded_len();
let max_did_key_size = did::did_details::DidPublicKey::<AccountId>::max_encoded_len();
assert_eq!(max_did_key_size, MAX_KEY_LENGTH as usize);
}

Expand Down

0 comments on commit 1969966

Please sign in to comment.