Designing Cross-Language SDK Conformance Tests
Research status: Theoretical SDK design. Examples are illustrative and have not been built or tested against the live engine.
Contract before implementation
Go, Python, TypeScript, Swift and Kotlin should expose equivalent operation semantics without requiring identical idiomatic interfaces. Maintain a versioned fixture corpus based on documented requests and sanitized observed responses. Separate wire compatibility from local application policy. Use integer satoshi amounts and verify exact serialization; JavaScript clients must reject unsafe integers or use an explicitly supported exact representation. Do not invent new wire fields to accommodate one language.
Conceptual fixture
{
"case": "application_rejection",
"http_status": 200,
"body": {"ok": false},
"expected_sdk_state": "rejected"
}This minimal synthetic fixture tests classification only; it is not a complete captured engine response. Include documented success envelopes, missing required fields, unknown optional fields, malformed types, large amounts and timeouts. Preserve unknown error information without exposing secrets. A decoder must not accept a string amount as an integer unless the contract explicitly permits that representation.
Harness design
Each language adapter consumes the same fixture set and emits a normalized report with case identifier, expected state, actual state and pass/fail. A mock HTTP server records method, path, headers and body, using dummy credentials. Compare semantic JSON rather than object key order. Add tests for request identifier preservation, network mapping and cancellation behavior. Test the actual outbound request as well as the decoded response. Pin fixture revisions to the API contract used to derive them.
Acceptance plan
Run unit tests and mock transport tests in CI without real funds. Require all mandatory cases to pass before live integration. Add a regression fixture whenever a real mismatch is discovered, with credentials removed. Keep live observations separate from synthetic fixtures and do not claim cross-language compatibility until the implementations have actually passed the same suite.
Primary reference
https://thamer.org/api
Related reading
https://thamer.org/docs/wab-sdk-cross-language-interfaces
https://thamer.org/docs/wab-sdk-typed-json-contracts
https://thamer.org/docs/wab-sdk-swift-bitcoin-payments
https://thamer.org/docs/wab-sdk-kotlin-bitcoin-applications
