Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ substrate-wasm-builder = {git = "https://github.com/paritytech/substrate", branc
# External (without extra features and with default disabled if necessary)
base58 = {version = "0.2.0", default-features = false}
bitflags = {version = "1.3.2", default-features = false}
cfg-if = "1.0"
clap = "4.1.6"
env_logger = "0.10.0"
fluent-uri = { version = "0.1.4", default-features = false }
Expand Down Expand Up @@ -68,7 +69,7 @@ pallet-migration = {path = "pallets/pallet-migration", default-features = false}

# Internal support (with default disabled)
kilt-asset-dids = {path = "crates/assets", default-features = false}
kilt-dip-support = {path = "crates/kilt-dip-support", default-features = false}
kilt-dip-primitives = {path = "crates/kilt-dip-primitives", default-features = false}
kilt-support = {path = "support", default-features = false}
runtime-common = {path = "runtimes/common", default-features = false}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
authors.workspace = true
description = "Support types, traits, and functions for the KILT Decentralized Identity Provider (DIP) functionality as implemented by the KILT blockchain."
description = "Primitive types, traits, and functions for the KILT Decentralized Identity Provider (DIP) functionality as implemented by the KILT blockchain."
documentation.workspace = true
edition.workspace = true
homepage.workspace = true
license-file.workspace = true
name = "kilt-dip-support"
name = "kilt-dip-primitives"
readme.workspace = true
repository.workspace = true
version.workspace = true
Expand All @@ -14,7 +14,7 @@ version.workspace = true
# External dependencies
hash-db.workspace = true
log.workspace = true
cfg-if = "1.0"
cfg-if.workspace = true

# Internal dependencies
did.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use sp_std::vec::Vec;

use crate::{
merkle::RevealedDidKey,
traits::{Bump, DidSignatureVerifierContext, DipCallOriginFilter},
traits::{DidSignatureVerifierContext, DipCallOriginFilter, Incrementable},
};

/// Type returned by the Merkle proof verifier component of the DIP consumer
Expand Down Expand Up @@ -136,7 +136,7 @@ where
ContextProvider::BlockNumber: Encode + CheckedSub + From<u16> + PartialOrd,
ContextProvider::Hash: Encode,
ContextProvider::SignedExtra: Encode,
DidLocalDetails: Bump + Default + Encode,
DidLocalDetails: Incrementable + Default + Encode,
RemoteAccountId: Clone,
MerkleProofEntries: sp_std::borrow::Borrow<[RevealedDidKey<RemoteKeyId, RemoteBlockNumber, RemoteAccountId>]>,
CallVerifier:
Expand Down Expand Up @@ -207,7 +207,7 @@ where
}

if let Some(details) = local_details {
details.bump();
details.increment();
} else {
*local_details = Some(DidLocalDetails::default());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@

// If you feel like getting in touch with us, you can do so at [email protected]

/// Verification logic to integrate a child chain as a DIP provider.
pub mod child;
/// Verification logic to integrate a sibling chain as a DIP provider.
pub mod sibling;
pub mod parachain;
/// Verification logic to integrate a child chain as a DIP provider.
pub mod relaychain;

mod common;

pub use child::{
DipChildProviderStateProofVerifierError, KiltVersionedChildProviderVerifier, VersionedChildParachainDipStateProof,
pub use parachain::{
DipParachainStateProofVerifierError, KiltVersionedParachainVerifier, VersionedDipParachainStateProof,
};
pub use sibling::{
DipSiblingProviderStateProofVerifierError, KiltVersionedSiblingProviderVerifier,
VersionedSiblingParachainDipStateProof,
pub use relaychain::{
DipRelaychainStateProofVerifierError, KiltVersionedRelaychainVerifier, VersionedRelaychainStateProof,
Comment on lines +26 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not a bit redundant? The mods are public or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps. The goal is to allow a consumer to import directly from the root, and we export the most important types there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I do not have a strong opinion on that. Discard the comment if you like.

Maybe the developer experience is better having shorter names. Instead of DipParachainStateProofVerifierError it could be renamed to StateProofVerifierError, which is imported from parachain? Just an idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are conflicts if the same type is re-exported from two different modules. I would move on for now, but won't close this issue. It will probably be part of the next batch of improvements.

};

pub mod latest {
pub use super::{child::latest::*, common::latest::*, sibling::latest::*};
pub use super::{common::latest::*, parachain::latest::*, relaychain::latest::*};
}
Loading