Skip to content

Commit d7fac35

Browse files
committed
Project compiling
1 parent 443754b commit d7fac35

5 files changed

Lines changed: 13 additions & 18 deletions

File tree

  • crates/kilt-dip-primitives/src/merkle/v0
  • dip-template/runtimes

crates/kilt-dip-primitives/src/merkle/v0/dip_subject_state/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use crate::{
3030
input_common::TimeBoundDidSignature,
3131
output_common::{DidKeyRelationship, DipOriginInfo, RevealedDidKey, RevealedDidMerkleProofLeaf},
3232
},
33-
traits::BenchmarkDefault,
3433
Error,
3534
};
3635

@@ -195,9 +194,7 @@ impl<
195194
KiltWeb3Name,
196195
KiltLinkableAccountId,
197196
MAX_REVEALED_LEAVES_COUNT,
198-
> where
199-
KiltDidKeyId: BenchmarkDefault,
200-
KiltBlockNumber: BenchmarkDefault,
197+
>
201198
{
202199
/// Iterates over the revealed DID leaves to find the ones that generated a
203200
/// valid signature for the provided payload.

crates/kilt-dip-primitives/src/merkle/v0/provider_state/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::{
3333
input_common::{DidMerkleProof, DipCommitmentStateProof, ProviderHeadStateProof, TimeBoundDidSignature},
3434
},
3535
state_proofs::{verify_storage_value_proof, verify_storage_value_proof_with_decoder},
36-
traits::{BenchmarkDefault, GetWithArg},
36+
traits::GetWithArg,
3737
utils::{
3838
calculate_dip_identity_commitment_storage_key_for_runtime, calculate_parachain_head_storage_key, OutputOf,
3939
},
@@ -178,8 +178,7 @@ impl<
178178
KiltWeb3Name,
179179
KiltLinkableAccountId,
180180
ConsumerBlockNumber,
181-
> where
182-
KiltBlockNumber: BenchmarkDefault,
181+
>
183182
{
184183
/// Verifies the head data of the state proof for the provider with the
185184
/// given para ID and relaychain state root.
@@ -354,7 +353,6 @@ impl<
354353
StateRoot: Ord,
355354
ParachainHasher: Hash<Output = StateRoot>,
356355
ProviderRuntime: pallet_dip_provider::Config,
357-
IdentityCommitmentOf<ProviderRuntime>: BenchmarkDefault,
358356
{
359357
let dip_commitment_storage_key =
360358
calculate_dip_identity_commitment_storage_key_for_runtime::<ProviderRuntime>(subject, 0);

crates/kilt-dip-primitives/src/merkle/v0/relay_state/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::{
2929
input_common::{DidMerkleProof, DipCommitmentStateProof, ProviderHeadStateProof, TimeBoundDidSignature},
3030
provider_state::ParachainDipDidProof,
3131
},
32-
traits::{BenchmarkDefault, GetWithArg},
32+
traits::GetWithArg,
3333
utils::OutputOf,
3434
DipDidProofWithVerifiedStateRoot, Error,
3535
};
@@ -238,8 +238,7 @@ impl<
238238
KiltBlockNumber,
239239
KiltWeb3Name,
240240
KiltLinkableAccountId,
241-
> where
242-
KiltBlockNumber: BenchmarkDefault,
241+
>
243242
{
244243
/// Verifies the head data of the state proof for the provider with the
245244
/// given para ID.

dip-template/runtimes/dip-consumer/src/dip.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use did::{
2121
DidSignature, DidVerificationKeyRelationship, KeyIdOf,
2222
};
2323
use dip_provider_runtime_template::{
24-
AccountId as ProviderAccountId, MaxTotalKeyAgreementKeys, Runtime as ProviderRuntime,
25-
MAX_REVEALABLE_LINKED_ACCOUNTS,
24+
AccountId as ProviderAccountId, Runtime as ProviderRuntime, MAX_REVEALABLE_LINKED_ACCOUNTS,
25+
MAX_TOTAL_KEY_AGREEMENT_KEYS,
2626
};
2727
use frame_support::{pallet_prelude::ValueQuery, storage_alias, traits::Contains};
2828
use frame_system::{pallet_prelude::BlockNumberFor, EnsureSigned};
@@ -48,7 +48,7 @@ use crate::{weights, AccountId, DidIdentifier, Runtime, RuntimeCall, RuntimeOrig
4848

4949
// 3 is the attestation, delegation, and authentication key.
5050
// 1 is the web3name.
51-
const MAX_PROVIDER_REVEALABLE_KEYS_COUNT: u32 = MaxTotalKeyAgreementKeys + 3 + 1 + MAX_REVEALABLE_LINKED_ACCOUNTS;
51+
const MAX_PROVIDER_REVEALABLE_KEYS_COUNT: u32 = MAX_TOTAL_KEY_AGREEMENT_KEYS + 3 + 1 + MAX_REVEALABLE_LINKED_ACCOUNTS;
5252

5353
/// The verifier logic is tied to the provider template runtime definition.
5454
pub type ProviderTemplateProofVerifier = KiltVersionedParachainVerifier<
@@ -403,11 +403,11 @@ impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper
403403

404404
#[cfg(all(test, feature = "runtime-benchmarks"))]
405405
mod worst_case_tests {
406-
use kilt_dip_primitives::{parachain::DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED, VersionedDipParachainStateProof};
406+
use kilt_dip_primitives::VersionedDipParachainStateProof;
407407
use kilt_support::traits::GetWorstCase;
408408
use pallet_dip_consumer::benchmarking::WorstCaseOf;
409409

410-
use crate::ProviderTemplateProofVerifierWrapper;
410+
use crate::{dip::MAX_PROVIDER_REVEALABLE_KEYS_COUNT, ProviderTemplateProofVerifierWrapper};
411411

412412
#[test]
413413
fn worst_case_max_limits() {
@@ -420,7 +420,7 @@ mod worst_case_tests {
420420
sp_io::TestExternalities::default().execute_with(|| {
421421
assert_eq!(
422422
proof.dip_proof().revealed().len(),
423-
MAX_PROVIDER_REVEALABLE_KEYS as usize
423+
MAX_PROVIDER_REVEALABLE_KEYS_COUNT as usize
424424
);
425425
});
426426
});

dip-template/runtimes/dip-provider/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,10 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for RuntimeCall
376376
}
377377
}
378378

379+
pub const MAX_TOTAL_KEY_AGREEMENT_KEYS: u32 = 50;
379380
parameter_types! {
380381
#[derive(Debug, Clone, Eq, PartialEq)]
381-
pub const MaxTotalKeyAgreementKeys: u32 = 50;
382+
pub const MaxTotalKeyAgreementKeys: u32 = MAX_TOTAL_KEY_AGREEMENT_KEYS;
382383
#[derive(Debug, Clone, Eq, PartialEq, TypeInfo, Encode, Decode)]
383384
pub const MaxNewKeyAgreementKeys: u32 = 50;
384385
}

0 commit comments

Comments
 (0)