Skip to content

feat(wasm-utxo): export testutils module, fix testutils browser compat#118

Merged
OttoAllmendinger merged 2 commits intomasterfrom
BTC-2980.export-testutils
Jan 29, 2026
Merged

feat(wasm-utxo): export testutils module, fix testutils browser compat#118
OttoAllmendinger merged 2 commits intomasterfrom
BTC-2980.export-testutils

Conversation

@OttoAllmendinger
Copy link
Contributor

@OttoAllmendinger OttoAllmendinger commented Jan 29, 2026

Summary

  • Export testutils namespace from the main index.ts to make test utilities available to library consumers
  • Add BIP32.fromSeedSha256() method for creating BIP32 keys from string seeds by hashing with SHA256, simplifying deterministic test key generation and eliminating the need for Node's crypto module in testutils

Changes

fromSeedSha256 (Rust + TypeScript)

  • New WASM method that takes a string, hashes it with SHA256, and creates a master BIP32 key
  • Removes dependency on Node's crypto module from js/testutils/keys.ts

testutils export

  • Adds testutils namespace export to js/index.ts

Test plan

  • All 925 mocha tests pass
  • New tests verify fromSeedSha256 produces identical results to manual SHA256 + fromSeed approach
  • TypeScript compiles without errors

Issue: BTC-2980

OttoAllmendinger and others added 2 commits January 29, 2026 14:27
Implements a new method to create BIP32 keys from string seeds by hashing
them with SHA256. This simplifies deterministic test key generation and
eliminates the need for the crypto module in testutils.

Issue: BTC-2980

Co-authored-by: llm-git <llm-git@ttll.de>
Add testutils namespace export to the main index.ts file to make test
utilities available to consumers of the library.

Issue: BTC-2980

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2980.export-testutils branch from d49d1ce to fec213d Compare January 29, 2026 13:27
@OttoAllmendinger OttoAllmendinger changed the title feat(wasm-utxo): export testutils module feat(wasm-utxo): export testutils module, fix testutils browser compat Jan 29, 2026
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review January 29, 2026 13:35
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner January 29, 2026 13:35
@OttoAllmendinger OttoAllmendinger merged commit 5c34219 into master Jan 29, 2026
6 checks passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2980.export-testutils branch January 29, 2026 14:53
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.

2 participants