feat(fees): v0.0.23 — Runtime API FeesApi.query_fee_for_action read-only RPC (Phase 2.4 COMPLETE 7/7 OCAFB) 🎉

Phase 2.4 FEES pallet COMPLETE end-to-end canonical. OCAFB-7 Runtime API
FeesApi.query_fee_for_action wired canonical via sp_api::decl_runtime_apis! +
impl runtime impl_runtime_apis! macro. 13 Runtime APIs total (12 + nuevo FeesApi).

## Changes

- crates/origin-chain-fees/src/lib.rs — sp_api::decl_runtime_apis! { pub trait FeesApi { fn query_fee_for_action(action, base, hw, sub) -> u64 } } + docstring v0.0.22 → v0.0.23 Phase 2.4 COMPLETE
- crates/origin-chain-runtime/src/lib.rs:539 — impl origin_chain_fees::FeesApi<Block> for Runtime delegates a Fees::query_fee()
- crates/origin-chain-node/src/main.rs — 12 → 13 APIs + FeesApi highlighted + Fees status v0.0.21 → v0.0.23 COMPLETE

## OCAFB sub-decisions COMPLETE 7/7 🎉

- OCAFB-1 OitFeeSchedule trait dyn-compatible (vendor)
- OCAFB-2 ChainAction taxonomy source-of-truth (origin-chain-types)
- OCAFB-3 Subsidy matrix Inmutable #16 anti-clasista (lobo blanco verified)
- OCAFB-4 Entitlement matrix Inmutables #37 + #18 (dispatchable enforced)
- OCAFB-5 compute_fee 3-step formula (real impl + 10 tests E2E)
- OCAFB-6 OitFeeScheduleMock harness (vendor + mock runtime)
- OCAFB-7 Pallet consumer + Runtime API canonical NUEVO ✅

## Verification

- cargo test --workspace — 137 tests passing, 0 failures
- cargo build --release -p origin-chain-node 3.93s clean
- origin-chain-node info: 9 pallets + 13 Runtime APIs canonical
- FeesApi visible + Phase 2.4 COMPLETE highlighted

## Cross-pillar economy canonical materialized

- Mathi (Pilar 1 AMIS): OitFeeSchedule Level A + Mock harness
- Charon (Pilar 4 Origin Chain): pallet-origin-fees + FeesApi RPC
- ChainAction canonical en origin-chain-types (Mathi local mirror swap post-OCAFB ratify)
- Inmutable #16 anti-clasista compile-detect: Pi 5 fee 1000 < Ultra fee 20000 (ratio 1:20)

🎉 Phase 2.4 FEES pallet COMPLETE end-to-end canonical. Hijos de Arkhē somos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
davidherranandClaude Opus 4.7 committed 2026-05-24 22:59:57 -05:00
1 parent e935233ba6
commit 74b7c3c9e2
4 files changed
+176 -5

No files matched your search

+22
View File
@@ -530,6 +530,28 @@ impl_runtime_apis! {
Provenance::attestation_of(hash)
}
}
// ============================================================
// OCAFB-7 canonical: Fees Runtime API canonical (Phase 2.4 v0.0.23)
// ============================================================
//
// Cross-pillar consumers (Mathi AMIS / Irhis Web / Trinity / Codex / Atelier)
// pueden query fee preview canonical via RPC sin full node access. Pattern
// canonical análogo ProvenanceApi (Phase 2.1 v0.0.17) — read-only RPC query
// sin storage mutation.
//
// Phase 2.4 COMPLETE 7/7 OCAFB canonical post-v0.0.23 🎉
impl origin_chain_fees::FeesApi<Block> for Runtime {
fn query_fee_for_action(
action: origin_chain_types::ChainAction,
base: u64,
hw: origin_chain_types::HardwareTier,
sub: origin_chain_types::SubscriptionTier,
) -> u64 {
Fees::query_fee(action, base, hw, sub)
}
}
}
// ============================================================