Phase 2.1 PROVENANCE pallet — 9 integration tests E2E via FRAME mock runtime
composition (`construct_runtime!` macro + derive_impl + sp_io::TestExternalities).
Cierra honest disclosure sesión 2 ("real chain runtime aún NO arranca"). Pallet
end-to-end validado canonical sin esperar Slice 2e WASM resolution structural.
## 9 integration tests canonical PROV-3 flow
5 scenarios:
- scenario_1_passed_info_anchored_canonical (PROV-2/3/7) ✅
- scenario_2_warning_anchored_canonical (PROV-2/3/6/7) ✅
- scenario_3_failed_critical_rejected_canonical (PROV-6) ❌ NotAnchorable
- scenario_4_passed_block_security_rejected_canonical (PROV-6) ❌ NotAnchorable
- scenario_5_anonymous_level_0_rejected_canonical (PROV-5) ❌ ValidatorTierInsufficient
4 additional:
- additional_idempotency_already_attested_rejected_canonical (PROV-2) ❌ AlreadyAttested
- additional_tampered_signature_rejected_canonical (PROV-4) ❌ InvalidSignature
- additional_tampered_payload_rejected_canonical (PROV-4) ❌ InvalidSignature
- additional_6_step_prov_3_walkthrough_canonical (PROV-3 full) ✅ Pre/post assertions
## Own fixtures canonical
Per audit canonical sesión 3+ (docs/L7_roadmaps/AUDIT_CHARON_SESION_3_STATE_V1.md),
Ergon E2E fixture diary claim aspirational sin shipped commit verified — filesystem
+ git history confirma no source file canonical. Charon construye own fixtures
basados en vendor copy ValidationAttestation real existente. Pattern análogo
Slice 3 mock-WASM + v0.0.16 Ed25519 interim encoding.
## Files canonical
- NEW: crates/origin-chain-provenance/src/mock.rs (75 LOC mock runtime)
- NEW: crates/origin-chain-provenance/src/tests_integration.rs (270 LOC, 9 tests)
- EDIT: crates/origin-chain-provenance/Cargo.toml (sp-core+sp-io+sp-runtime dev-deps)
- EDIT: crates/origin-chain-provenance/src/lib.rs (mod mock + mod tests_integration + docstring v0.0.18)
- EDIT: CHANGELOG.md (v0.0.18 entry canonical pattern Phase 2.1)
## Verification
- cargo test -p origin-chain-provenance — 17 tests verde, 0 failures
(9 integration + 6 standalone Ed25519 + 2 auto-generated)
- Workspace tests no regressions
- Cero warnings críticos
🎉 Phase 2.1 PROVENANCE pallet validated E2E via mock runtime canonical.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
57 lines
1.7 KiB
TOML
57 lines
1.7 KiB
TOML
[package]
|
|
name = "origin-chain-provenance"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
repository.workspace = true
|
|
homepage.workspace = true
|
|
description = "Asset attestation pallet canonical per CHN-7. Phase 2.1 scaffold v0.0.14 — trait-first foundation pattern. Real impl post Ergon arkhe-noesis-attestation-types Cap 42+ sub-crate."
|
|
|
|
[dependencies]
|
|
# Origin Chain canonical types (vendor ValidationAttestation interim Option B)
|
|
origin-chain-types = { workspace = true }
|
|
|
|
# FRAME canonical pallet macro + storage + dispatch + events + errors
|
|
frame-support = { workspace = true }
|
|
frame-system = { workspace = true }
|
|
|
|
# Runtime API canonical (v0.0.17 PROV-8 — verify_provenance read-only RPC query)
|
|
sp-api = { workspace = true }
|
|
|
|
# Crypto canonical
|
|
blake3 = { workspace = true }
|
|
ed25519-dalek = { workspace = true }
|
|
|
|
# SCALE codec canonical
|
|
parity-scale-codec = { workspace = true }
|
|
scale-info = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
# Mock runtime canonical para integration tests v0.0.18 — PROV-3 E2E flow.
|
|
# Per pallet Substrate convention: sp-io TestExternalities + sp-runtime
|
|
# AccountId32 + frame_support construct_runtime macro.
|
|
sp-core = { workspace = true, default-features = true }
|
|
sp-io = { workspace = true, default-features = true }
|
|
sp-runtime = { workspace = true, default-features = true }
|
|
|
|
[features]
|
|
default = ["std"]
|
|
std = [
|
|
"origin-chain-types/std",
|
|
"frame-support/std",
|
|
"frame-system/std",
|
|
"sp-api/std",
|
|
"parity-scale-codec/std",
|
|
"scale-info/std",
|
|
]
|
|
runtime-benchmarks = [
|
|
"frame-support/runtime-benchmarks",
|
|
"frame-system/runtime-benchmarks",
|
|
]
|
|
try-runtime = [
|
|
"frame-support/try-runtime",
|
|
"frame-system/try-runtime",
|
|
]
|