Skip to content

Commit 5cf55eb

Browse files
authored
test: DIP consumer tests (#611)
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
1 parent 13d9921 commit 5cf55eb

File tree

60 files changed

+5790
-2469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5790
-2469
lines changed

Cargo.lock

Lines changed: 31 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ base58 = {version = "0.2.0", default-features = false}
3434
bitflags = {version = "1.3.2", default-features = false}
3535
cfg-if = "1.0"
3636
clap = "4.1.6"
37+
enum-iterator = "2.0.0"
3738
env_logger = "0.10.0"
3839
fluent-uri = { version = "0.1.4", default-features = false }
3940
futures = {version = "0.3.21", default-features = false}

crates/kilt-dip-primitives/Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ version.workspace = true
1414
# External dependencies
1515
hash-db.workspace = true
1616
log.workspace = true
17-
cfg-if.workspace = true
1817

1918
# Internal dependencies
2019
did.workspace = true
@@ -43,7 +42,12 @@ sp-trie.workspace = true
4342
cumulus-primitives-core.workspace = true
4443

4544
[dev-dependencies]
45+
cumulus-pallet-parachain-system = { workspace = true, features = ["std"] }
46+
enum-iterator.workspace = true
4647
hex-literal.workspace = true
48+
peregrine-runtime = { workspace = true, features = ["std"] }
49+
rococo-runtime = { workspace = true, features = ["std"] }
50+
spiritnet-runtime = { workspace = true, features = ["std"] }
4751
sp-io = { workspace = true, features = ["std"] }
4852

4953
[features]
@@ -73,5 +77,5 @@ std = [
7377
runtime-benchmarks = [
7478
"kilt-support/runtime-benchmarks",
7579
"pallet-dip-consumer/runtime-benchmarks",
76-
"pallet-dip-provider/runtime-benchmarks",
80+
"pallet-dip-provider/runtime-benchmarks"
7781
]

crates/kilt-dip-primitives/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#![cfg_attr(not(feature = "std"), no_std)]
2828

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

41-
pub use merkle::latest::*;
41+
pub use merkle_proofs::latest::*;
4242
pub use traits::RelayStateRootsViaRelayStorePallet;
4343
pub use verifier::*;

0 commit comments

Comments
 (0)