Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR enhances the fixture utility with type-safe functions supporting
multiple file formats, adds PSBT fixtures in JSON format for testing,
implements deterministic nonce creation with fixed sessionId, and fixes a
circular dependency issue in testutil/mock.ts.

Key changes:

  • Add functionality to save PSBT fixtures in JSON format for more robust testing
  • Extend fixture util with type-safe functions supporting .json, .hex, and .txt
  • Replace fs-extra with native fs.promises for better modularity
  • Use fixed sessionId for deterministic nonce creation
  • Fix circular imports in testutil/mock.ts by importing directly from bitgo module
  • Rename neutratedRootWalletKeys to rootWalletKeysXpubs for clarity

Issue: BTC-2651

@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2651.extend-fixtures branch 2 times, most recently from 40a4785 to b11adc5 Compare October 15, 2025 15:10
OttoAllmendinger and others added 4 commits October 15, 2025 17:45
Import directly from bitgo module to prevent circular dependency error.

Co-authored-by: llm-git <llm-git@ttll.de>

Issue: BTC-2651
Issue: BTC-2651

Co-authored-by: llm-git <llm-git@ttll.de>
Add support for different file formats (.json, .hex, .txt) with proper
type handling in fixture loading. Replace fs-extra with native fs.promises
for better modularity.

Issue: BTC-2651

Co-authored-by: llm-git <llm-git@ttll.de>
Add functionality to save PSBT fixtures in JSON format for testing. This
helps to make the tests more robust and allows for easier debugging.

Also rename `neutratedRootWalletKeys` to the more descriptive
`rootWalletKeysXpubs` to better reflect its purpose.

Issue: BTC-2651

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2651.extend-fixtures branch from b11adc5 to e73e640 Compare October 15, 2025 15:46
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review October 15, 2025 18:58
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner October 15, 2025 18:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances PSBT fixture handling by introducing type-safe utility functions supporting multiple file formats (.json, .hex, .txt), replacing fs-extra with native fs.promises, and implementing deterministic nonce creation with a fixed sessionId. It also resolves circular import issues and renames neutratedRootWalletKeys to rootWalletKeysXpubs for improved clarity.

Key changes:

  • Extended fixture utilities with type-safe file format support
  • Added deterministic PSBT fixtures in JSON format
  • Fixed circular dependencies in testutil/mock.ts

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
modules/utxo-lib/test/fixture.util.ts Added getFixture function with multi-format support and replaced fs-extra with fs.promises
modules/utxo-lib/test/bitgo/psbt/SignVerifyPsbtAndTx.ts Renamed neutratedRootWalletKeys, added fixture comparison test, added deterministic flag
modules/utxo-lib/test/bitgo/fixtures/psbt/*.json Added PSBT fixture files in JSON format for various coins and signing states
modules/utxo-lib/src/testutil/psbt.ts Added fixed sessionId for deterministic nonce creation
modules/utxo-lib/src/testutil/mock.ts Fixed circular imports by importing directly from specific modules

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@davidkaplanbitgo davidkaplanbitgo merged commit dd94e04 into master Oct 16, 2025
13 checks passed
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.

4 participants