Files
arkhe-origin-chain/crates/origin-chain-runtime
davidherranandClaude Opus 4.8 05b6c70fca feat(slice-4): v0.0.48 — runtime exporta WASM_BINARY (Paso 4a)
Slice 4 Ship 1 — prerequisito para el full sc-service. El runtime ahora exporta
WASM_BINARY que el node consumirá para construir ChainSpecs reales (Paso 4b).

build.rs ya generaba OUT_DIR/wasm_binary.rs vía substrate-wasm-builder (Slice 2e),
pero lib.rs no lo incluía. Esta ship añade el include! gateado:
- #[cfg(feature = wasm-build)] include!(OUT_DIR/wasm_binary.rs) → WASM_BINARY real
- #[cfg(not(wasm-build))] pub const WASM_BINARY: Option<&[u8]> = None → host-only
- wasm_binary_unwrap() helper con mensaje de error claro

El gate evita: (1) error de compilación cuando wasm-build off (archivo no existe),
(2) recursión en build.rs (el inner build wasm32 no hereda wasm-build, no es default).

Verificación:
- cargo check -p origin-chain-runtime (host, wasm-build off): clean, WASM_BINARY=None
- cargo build --features wasm-build + CC=LLVM: clean 39s, include! compila →
  WASM_BINARY=Some (real binary 2.8 MB)
- cargo test --workspace: 213 verde, 0 fail, sin regresiones

Próximo Ship 2 (v0.0.49): Paso 4b chain_spec GenericChainSpec + Paso 4c service.rs
+ rpc.rs + node sc-* deps.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 11:13:33 -05:00
..