Skip to content

Commit 2da45ef

Browse files
committed
Introduce funding contribution builder API
This commit introduces a `FundingBuilder`, following the builder pattern, to iteratively construct a `FundingContribution`. It supports adding/removing value (which may trigger a coin selection attempt), adding/remove outputs, and amending prior contributions (which was previously not possible). A `FundingBuilder` may be obtained in two ways: via `FundingTemplate::contribution_builder` (which resumes from the prior contribution to amend if available) or `FundingTemplate::without_prior_contribution_builder` to start from scratch and fully replace the prior contribution. When `FundingBuilder::build` is called, we attempt to build the contribution iteratively such that coin selection is our last resort. The splice-related convenience methods on `FundingTemplate` now map to the `FundingBuilder` under the hood.
1 parent 5371059 commit 2da45ef

File tree

2 files changed

+1563
-468
lines changed

2 files changed

+1563
-468
lines changed

0 commit comments

Comments
 (0)