-
Couldn't load subscription status.
- Fork 138
Refactor fundGenesisPsbt and enhance test helpers for coverage
#1418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pull Request Test Coverage Report for Build 18406524442Details
💛 - Coveralls |
d41d194 to
83ba31c
Compare
a2263f6 to
cef2567
Compare
|
Needs rebase. |
83ba31c to
11aeea1
Compare
fundGenesisPsbt and add high-level batch funding tests
fundGenesisPsbt and add high-level batch funding testsfundGenesisPsbt and enhance test helpers for coverage
Separate the mint anchor transaction fee rate calculation from fundGenesisPsbt into anchorTxFeeRate. This refactor is part of a broader effort to simplify calling fundGenesisPsbt from unit tests.
Extract the wallet funding call into a closure that is passed as an argument. This prepares fundGenesisPsbt to become a standalone function, making it easier to call in unit tests.
Pass the pending batch and chain params into fundGenesisPsbt and convert it into a standalone function rather than a method on ChainPlanter. This change makes it easier to call fundGenesisPsbt from unit tests.
The batch key was only used for logging. This commit moves the log messages outside fundGenesisPsbt, simplifying the function for better code health.
11aeea1 to
e2e3f79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only a single nit. The unit test fail in CI appears to be a flake; that test passes for me locally.
The mock helper FundGenesisTx now returns the index of the change output. It also dynamically computes the index of the change output it adds. These enhancements will be useful when handling packets with supply pre-commitment outputs.
The funding routine now uses the refactored fundGenesisPsbt function, introduced in a previous commit. Which adds test coverage for the batch funding logic. An optional argument is also added to allow skipping funding.
RandSeedlingMintingBatch retires.
e2e3f79 to
10b3fb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Refactor `fundGenesisPsbt` and enhance test helpers for coverage
This PR streamlines
fundGenesisPsbtinto a simpler, testable entry point and factors out ancillary logic to reduce coupling. Batch funding flows are exercised via updated unit test helpers, improving coverage and confidence around mint pre-commit scenarios. The mint batch helpers and mocks are aligned with the new shape, and the older seedling batch helper is retired. No behavioural changes are intended beyond improved structure and testability.