Skip to content

Commit dfe812f

Browse files
committed
Fix compilation issues
1 parent f7d8058 commit dfe812f

File tree

2 files changed

+51
-3
lines changed
  • crates/kilt-dip-primitives/src/verifier/relaychain
  • dip-template/runtimes/dip-consumer/src

2 files changed

+51
-3
lines changed

crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::{
3232
merkle_proofs::v0::RevealedDidKey,
3333
traits::{DipCallOriginFilter, GetWithArg, GetWithoutArg, Incrementable},
3434
utils::OutputOf,
35-
DipOriginInfo,
35+
DipOriginInfo, RelayDipDidProof,
3636
};
3737

3838
pub mod v0;
@@ -55,7 +55,7 @@ pub enum VersionedRelaychainStateProof<
5555
KiltLinkableAccountId,
5656
> {
5757
V0(
58-
crate::merkle_proofs::v0::RelayDipDidProof<
58+
RelayDipDidProof<
5959
ConsumerBlockNumber,
6060
ConsumerBlockHasher,
6161
KiltDidKeyId,
@@ -67,6 +67,51 @@ pub enum VersionedRelaychainStateProof<
6767
),
6868
}
6969

70+
impl<
71+
ConsumerBlockNumber: Copy + Into<U256> + TryFrom<U256>,
72+
ConsumerBlockHasher: Hash,
73+
KiltDidKeyId,
74+
KiltAccountId,
75+
KiltBlockNumber,
76+
KiltWeb3Name,
77+
KiltLinkableAccountId,
78+
>
79+
From<
80+
RelayDipDidProof<
81+
ConsumerBlockNumber,
82+
ConsumerBlockHasher,
83+
KiltDidKeyId,
84+
KiltAccountId,
85+
KiltBlockNumber,
86+
KiltWeb3Name,
87+
KiltLinkableAccountId,
88+
>,
89+
>
90+
for VersionedRelaychainStateProof<
91+
ConsumerBlockNumber,
92+
ConsumerBlockHasher,
93+
KiltDidKeyId,
94+
KiltAccountId,
95+
KiltBlockNumber,
96+
KiltWeb3Name,
97+
KiltLinkableAccountId,
98+
>
99+
{
100+
fn from(
101+
value: RelayDipDidProof<
102+
ConsumerBlockNumber,
103+
ConsumerBlockHasher,
104+
KiltDidKeyId,
105+
KiltAccountId,
106+
KiltBlockNumber,
107+
KiltWeb3Name,
108+
KiltLinkableAccountId,
109+
>,
110+
) -> Self {
111+
Self::V0(value)
112+
}
113+
}
114+
70115
pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 128;
71116
pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = 1024;
72117
pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 128;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ pub type ProviderTemplateProofVerifier = KiltVersionedParachainVerifier<
6060
pub type MerkleProofVerifierInput = <ProviderTemplateProofVerifier as IdentityProofVerifier<Runtime>>::Proof;
6161
pub type MerkleProofVerifierOutput =
6262
<ProviderTemplateProofVerifier as IdentityProofVerifier<Runtime>>::VerificationResult;
63-
// Wrapper around the verifier to implement the `GetWorstCase` trait.
63+
// Wrapper around the verifier to implement the `GetWorstCase` trait (required
64+
// due to orphan rule).
6465
pub struct ProviderTemplateProofVerifierWrapper;
6566

6667
// Delegate verification logic to the specialized version of
@@ -1008,6 +1009,8 @@ mod worst_case_tests {
10081009

10091010
use crate::{dip::MAX_PROVIDER_REVEALABLE_KEYS_COUNT, ProviderTemplateProofVerifierWrapper};
10101011

1012+
// Test that the worst case actually refers to the worst case that the provider
1013+
// can generate.
10111014
#[test]
10121015
fn worst_case_max_limits() {
10131016
sp_io::TestExternalities::default().execute_with(|| {

0 commit comments

Comments
 (0)