-
Notifications
You must be signed in to change notification settings - 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
Open
ffranr
wants to merge
8
commits into
0-8-0-staging
Choose a base branch
from
unit-tests-mint-pre-commit
base: 0-8-0-staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+251
−128
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
jtobin
approved these changes
Oct 10, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
no-changelog
supply commit
Work on the supply commitment feature, enabling issuers to attest to total asset supply on-chain.
unit-test
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR streamlines
fundGenesisPsbt
into 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.