Summary
Replace the mock's wire engine - hand-written @novasamatech/host-container - with the generated @parity/truapi-host dispatcher. Keep all value-add (dev-key derivation, real sr25519 signing, signing log, productAccounts pinning, RPC proxy, Playwright fixture, fault injection). Only the protocol layer changes.
Why now
product-sdk#186 goes direct to @parity/truapi, deleting @novasamatech/host-api(-wrapper). On merge, a migrated product emits the generated truapi envelope the current mock can't decode - so every migrating product loses its E2E harness unless the mock moves in lockstep.
Design
Swap flat container.handleXxx(...) registration to nested, versioned, tagged-union handlers via createTrUApiServer(provider, handlers). ~40 slots regroup under 15 services; legacy error classes map to generated tagged unions. The host-side iframe Provider (already built, src/truapi-engine/host-iframe-provider.ts) plugs straight in. The fault layer wraps the raw provider below the engine, so it's retained - and protocolVersion skew becomes implementable here.
Tasks
Acceptance criteria
- A product on migrated
@parity/product-sdk-* E2E-tests green against the new-engine mock; existing integration tests pass; @novasamatech/host-container removed.
Sequencing
Must land in lockstep with / after product-sdk#186
Summary
Replace the mock's wire engine - hand-written
@novasamatech/host-container- with the generated@parity/truapi-hostdispatcher. Keep all value-add (dev-key derivation, real sr25519 signing, signing log,productAccountspinning, RPC proxy, Playwright fixture, fault injection). Only the protocol layer changes.Why now
product-sdk#186 goes direct to
@parity/truapi, deleting@novasamatech/host-api(-wrapper). On merge, a migrated product emits the generated truapi envelope the current mock can't decode - so every migrating product loses its E2E harness unless the mock moves in lockstep.Design
Swap flat
container.handleXxx(...)registration to nested, versioned, tagged-union handlers viacreateTrUApiServer(provider, handlers). ~40 slots regroup under 15 services; legacy error classes map to generated tagged unions. The host-side iframeProvider(already built,src/truapi-engine/host-iframe-provider.ts) plugs straight in. The fault layer wraps the raw provider below the engine, so it's retained - andprotocolVersionskew becomes implementable here.Tasks
Provider(built)createContainerwithcreateTrUApiServer(provider, handlers); regroup ~40 slots into 15 nested services; map legacy errors → tagged unionschain.*set (14 handlers) - reuse thetruapi-host-integration/chain-handlers.tsprototype (response/follow-item mapping to finish)@parity/truapiclient (the chunkiest part - it currently uses@novasamatech/host-api-wrapper)decodeWireMessage); implementprotocolVersion@novasamatech/host-container; bump major; update CHANGELOG/forum-post/READMEAcceptance criteria
@parity/product-sdk-*E2E-tests green against the new-engine mock; existing integration tests pass;@novasamatech/host-containerremoved.Sequencing
Must land in lockstep with / after product-sdk#186