Skip to content

feat(mock): re-port MockPlatform + createMockHost onto current core#294

Draft
decrypto21 wants to merge 1 commit into
mainfrom
feat/mock-report
Draft

feat(mock): re-port MockPlatform + createMockHost onto current core#294
decrypto21 wants to merge 1 commit into
mainfrom
feat/mock-report

Conversation

@decrypto21

@decrypto21 decrypto21 commented Jul 20, 2026

Copy link
Copy Markdown

What

Re-port of the TrUAPI mock host onto current main. Supersedes the stale #258 branch (feat/mock-platform), which was on a superseded base (worktree-issue-96-rust-core-port) and written against #104's API. Main already landed the core, so this brings over only the mock-specific additions, adapted to main's core API — one clean commit on main.

Refs #257 (in-core mock host: MockPlatform + createMockHost). Part of the testing ladder tracked in sdk-team#43.

What's in it

  • truapi-platformMockPlatform behind the mock feature: in-memory storage, fixed-policy permissions, configurable chain, notifications, confirmations, theme, and lookup-only preimages. PreimageHost is lookup-only (the core owns Bulletin submission), so submit_preimage / BulletinAllowanceSigner are dropped and content is seeded via insert_preimage. Types come from truapi::latest per crate convention.
  • truapi-hostcreateMockHost returns the nested RequiredHostCallbacks shape (main's per-capability grouping, not #104's FlatHostCallbacks); mockRuntimeConfig sets the new required bulletin genesis hash.
  • wasm-bridge test — drives the real WASM core through the mock callbacks, no browser.
  • CI — @parity/truapi-host job builds the WASM and runs bun test with REQUIRE_WASM=1, wired into the ci-status gate.

Deliberately not ported

The through-core mock-wallet harness from #258 is left out: main already provides the equivalent StubPlatform + SSO statement/frame builders in truapi-server/src/test_support.rs. Converging those two doubles into one canonical mock is tracked as a follow-up (sdk-team#43-D8 / D7).

Tests

Rust truapi-platform mock tests + truapi-host create-mock-host and wasm-bridge (real WASM core) suites green. Dev-only: the mock feature is excluded from production builds.

Closure

Closes the re-port half of #257. The browser E2E harness (#260 / PR #261) rebases on top once this lands. See sdk-team#43 for the full stack and merge order.

@decrypto21
decrypto21 requested a review from a team July 20, 2026 10:13
@decrypto21 decrypto21 mentioned this pull request Jul 20, 2026
@decrypto21
decrypto21 marked this pull request as draft July 20, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant