Repository navigation
Expose SwapScript constructors from raw scripts, extract verify_submarine_preimage - #164
Merged
Merged
Conversation
This was referenced Sep 9, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The validated cooperative-claim helper (
SwapScript::submarine_cooperative_claim, which verifies the server's preimage against the invoice payment hash before partial-signing) was only reachable from a fresh swap response. Bindings that reconstruct swap scripts from storage (boltz-dart) could not use it, so they re-implemented the coop close against the raw primitives — skipping the preimage check and partial-signing whatever transaction hash the server supplies.SwapScript::from_bitcoin/SwapScript::from_liquid: build the wrapper from an already-reconstructed script, so the validated helpers are reachable for restored swaps.verify_submarine_preimageextracted fromsubmarine_cooperative_claim(behavior unchanged) so the proof-of-payment gate is a pure, unit-testable function.Validated:
cargo test --lib wrappersgreen; full submarine regtest suite green against the local regtest stack (4/4, including the cooperative claim path end to end). The pre-existingswaps::boltz::testsfailures hit the public api.boltz.exchange (currently down) and are unrelated.Companion PR: SatoshiPortal/boltz-dart (coop_close_submarine delegates to the validated flow).
Includes the CI fixes from #165 (committed Cargo.lock, ignored live-API tests, wasm lock seeding) so checks can run while that PR is open — its diff collapses to the wrappers change once #165 merges.