Skip to content

Commit

Permalink
test: DIP consumer tests (#611)
Browse files Browse the repository at this point in the history
Partially fixes KILTprotocol/ticket#2562.

Adds unit tests for the verifier components (components tested are shown
in the checklist below).
It also splits up the proof verification logic into multiple files,
split by when those checks are performed. Check the
`crates/kilt-dip-primitives/src/merkle/v0/` folder for more details. It
addresses an open comment in the DIP refactoring PR:
#602 (comment).

## Elements to add tests for

- [x] `pallet-dip-consumer`
- [x] `pallet-relay-store`
- [x] `ProofVerifier`
- [x] Merge #612
- [x] Merge #613
  • Loading branch information
ntn-x2 committed Apr 4, 2024
1 parent 2bb8c93 commit 4991998
Show file tree
Hide file tree
Showing 60 changed files with 5,790 additions and 2,469 deletions.
32 changes: 31 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ base58 = {version = "0.2.0", default-features = false}
bitflags = {version = "1.3.2", default-features = false}
cfg-if = "1.0"
clap = "4.1.6"
enum-iterator = "2.0.0"
env_logger = "0.10.0"
fluent-uri = {version = "0.1.4", default-features = false}
futures = {version = "0.3.21", default-features = false}
Expand Down
8 changes: 6 additions & 2 deletions crates/kilt-dip-primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ version.workspace = true
# External dependencies
hash-db.workspace = true
log.workspace = true
cfg-if.workspace = true

# Internal dependencies
did.workspace = true
Expand Down Expand Up @@ -43,7 +42,12 @@ sp-trie.workspace = true
cumulus-primitives-core.workspace = true

[dev-dependencies]
cumulus-pallet-parachain-system = { workspace = true, features = ["std"] }
enum-iterator.workspace = true
hex-literal.workspace = true
peregrine-runtime = { workspace = true, features = ["std"] }
rococo-runtime = { workspace = true, features = ["std"] }
spiritnet-runtime = { workspace = true, features = ["std"] }
sp-io = { workspace = true, features = ["std"] }

[features]
Expand Down Expand Up @@ -73,5 +77,5 @@ std = [
runtime-benchmarks = [
"kilt-support/runtime-benchmarks",
"pallet-dip-consumer/runtime-benchmarks",
"pallet-dip-provider/runtime-benchmarks",
"pallet-dip-provider/runtime-benchmarks"
]
4 changes: 2 additions & 2 deletions crates/kilt-dip-primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#![cfg_attr(not(feature = "std"), no_std)]

/// Module to deal with cross-chain Merkle proof as generated by the KILT chain.
pub mod merkle;
pub mod merkle_proofs;
/// Module to deal with cross-chain state proofs.
pub mod state_proofs;
/// Collection of traits used throughout the crate and useful for both providers
Expand All @@ -38,6 +38,6 @@ pub mod utils;
/// deployed both on a sibling parachain and on a parent relaychain.
pub mod verifier;

pub use merkle::latest::*;
pub use merkle_proofs::latest::*;
pub use traits::RelayStateRootsViaRelayStorePallet;
pub use verifier::*;
Loading

0 comments on commit 4991998

Please sign in to comment.