bisq-network / bisq-network/bisq2

Move MuSig offer construction out of the create-offer review controller

Open
#5,000 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
317
Forks
120
Avg merge
3d 16h
Merged PRs (30d)
41

Description

MuSigCreateOfferReviewController.initialize() still assembles the offer payload in the desktop layer: it derives the salted account ids and payload hashes, builds the AccountOption and CollateralOption entries, maps the display direction to the offer direction and only then hands the parts to MuSigService.createAndGetMuSigOffer. The 25% security deposit comes from the review model, so a domain value is sourced from the UI. None of that construction has a domain unit test, because none of it lives in the domain.

The take side already has the right shape: TakeOfferUseCase.getHandoff() returns a record the controller passes to the service. Mirror it here: a CreateOfferUseCase handoff that returns the offer id, offer direction, specs, payment methods and fully built options, with the deposit percentage as a domain constant, and unit tests for the salted id and hash construction. The controller then only displays and publishes.

MuSig is dev-gated, so this is not user-reachable yet.

Part of #4883.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with MuSigCreateOfferReviewController.initialize() and compare its responsibilities with TakeOfferUseCase.getHandoff(). Define the CreateOfferUseCase handoff and move offer construction there, including the domain deposit constant; then add unit tests covering salted account IDs and payload hashes and verify the controller only displays and publishes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, desktop
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.