Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.7.5

### Added

- **`handleCreateTransaction`** — creates transactions for product accounts. Returns the call data for test assertions.
- **`handleAccountCreateProof`** — creates Ring VRF proofs for product accounts. Signs the message with sr25519 for test purposes.
- **Integration tests** — 12 new tests covering theme subscribe, entropy derivation, login/getUserId, resource allocation, feature check, local storage, statement store proof, create transaction, and account create proof. Total: 46 integration tests (up from 34).

### Changed

- **Dependencies** — `@novasamatech/host-api`, `host-container`, `product-sdk` → ^0.7.8 (identity fixes, bulletin package).

## 0.7.4

### Added
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ When bumping `@novasamatech/*` dependencies:
## Testing

- `pnpm test` — export smoke tests (22 tests)
- `pnpm test:integration` — Playwright E2E tests (34+ tests) that exercise the full host-container ↔ product-sdk protocol
- `pnpm test:integration` — Playwright E2E tests (46+ tests) that exercise the full host-container ↔ product-sdk protocol
- Always run both after any change
- If the test product (`test/test-product.ts`) uses APIs that changed, update it and rebuild via `node test/build-test-product.mjs`

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@parity/host-api-test-sdk",
"version": "0.7.4",
"version": "0.7.5",
"description": "Lightweight test host for Spektr product E2E testing — embeds dapps with auto-signing dev accounts, no Docker needed",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -42,11 +42,11 @@
}
},
"dependencies": {
"@novasamatech/host-api": "^0.7.7"
"@novasamatech/host-api": "^0.7.8"
},
"devDependencies": {
"@novasamatech/host-container": "^0.7.7",
"@novasamatech/product-sdk": "^0.7.7",
"@novasamatech/host-container": "^0.7.8",
"@novasamatech/product-sdk": "^0.7.8",
"@polkadot/keyring": "^14.0.0",
"@polkadot/types": "^16.0.0",
"@polkadot/util": "^14.0.0",
Expand Down
62 changes: 31 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions src/browser/host-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,23 @@ function setupContainer(
return ok({ context, alias });
});

// Ring VRF proof: real hosts use an actual ring VRF; for test purposes,
// sign the message with the product account's sr25519 key.
container.handleAccountCreateProof((params, { ok }) => {
const [[dotnsId, idx], _ringLocation, message] = params;
const pair = getPairForProductAccount(config, pairs, dotnsId, idx);
const signature = pair ? pair.sign(message) : new Uint8Array(64);
return ok(signature);
});

// ── Create transaction (product account) ────────────────────

container.handleCreateTransaction((params, { ok }) => {
const [[_dotnsId, _idx], payload] = params;
// For test purposes, return the callData as-is
return ok(payload.callData);
});

// ── Sign payload (extrinsic) ─────────────────────────────────

container.handleSignPayload((params, { ok, err }) => {
Expand Down
Loading
Loading