Skip to content

Commit

Permalink
bench: attempt to fix default accountid for dids
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Feb 1, 2022
1 parent 844b60b commit 1c2acfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pallets/did/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ benchmarks! {
where_clause {
where
T::DidIdentifier: From<AccountId>,
<T as frame_system::Config>::Origin: From<RawOrigin<T::DidIdentifier>>
<T as frame_system::Config>::Origin: From<RawOrigin<T::DidIdentifier>>,
<T as frame_system::Config>::AccountId: From<AccountId>,
}

/* create extrinsic */
Expand Down
8 changes: 6 additions & 2 deletions pallets/did/src/mock_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,16 @@ pub fn generate_base_did_creation_details<T: Config>(
}
}

pub fn generate_base_did_details<T: Config>(authentication_key: DidVerificationKey) -> DidDetails<T> {
pub fn generate_base_did_details<T>(authentication_key: DidVerificationKey) -> DidDetails<T>
where
T: crate::Config,
<T as frame_system::Config>::AccountId: From<runtime_common::AccountId>,
{
DidDetails::new(
authentication_key,
BlockNumberOf::<T>::default(),
Deposit {
owner: Default::default(),
owner: runtime_common::AccountId::new([0u8; 32]).into(),
amount: Zero::zero(),
},
)
Expand Down
2 changes: 1 addition & 1 deletion pallets/did/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2834,7 +2834,7 @@ fn check_null_key_error() {
did,
caller.clone(),
);
let signature = ed25519::Signature::default();
let signature = ed25519::Signature::from_raw([0u8; 64]);

ExtBuilder::default().build(None).execute_with(|| {
assert_noop!(
Expand Down

0 comments on commit 1c2acfb

Please sign in to comment.