Skip to content

Conversation

@parvbitgo067
Copy link
Contributor

TICKET: BTC-2545

@parvbitgo067 parvbitgo067 requested a review from a team as a code owner December 16, 2025 12:35
Comment on lines 22 to 28
/**
* Creates a random PSBT for testing purposes with customizable options.
* This helper function generates a PSBT with a fake input and configurable outputs.
*
* @param options - Configuration options for PSBT creation
* @returns A constructed PSBT instance and the master key used
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't really want "random", it can lead to flaky tests

that being said, you are not using a lot of randomness anyway (just the keys)

rename to createTestPsbt and use fixed keys instead

you can get an ECPair instance with utxolib.bip32.fromSeed(...).privateKey

this makes the output deterministic which use good for testing

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.

3 participants