Skip to content
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

Refactor RFQ BuyOrder struct #1175

Merged
merged 6 commits into from
Nov 7, 2024
Merged

Refactor RFQ BuyOrder struct #1175

merged 6 commits into from
Nov 7, 2024

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Nov 5, 2024

  • Add missing asset max amount field.
  • Improve documentation.
  • Make peer field fn.Option.
  • Remove unused field.

Refactor BuyOrder by replacing the fields "asset ID" and "asset
group key" with a single "asset specifier" field for simplicity
and consistency.
This commit repurposes the `MinAssetAmount` field in `BuyOrder` to
`AssetMaxAmt`, defining the upper limit on the inbound asset amount
from the RFQ initiator's perspective. This change applies when the
requestor sets up an invoice to receive payment in tap asset (sending
a "buy" RFQ request).

The `AssetMaxAmt` field will be populated in a `BuyRequest` to ensure
that the counterparty can accommodate this requirement.
This commit removes an unused field.
@ffranr ffranr self-assigned this Nov 5, 2024
@ffranr ffranr requested review from guggero and GeorgeTsagk November 5, 2024 16:13
@ffranr ffranr force-pushed the buyorder-refactor branch from 6e10413 to 853ff2a Compare November 5, 2024 16:14
@coveralls
Copy link

coveralls commented Nov 5, 2024

Pull Request Test Coverage Report for Build 11709454558

Details

  • 0 of 35 (0.0%) changed or added relevant lines in 4 files are covered.
  • 15 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.02%) to 40.701%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rfq/manager.go 0 1 0.0%
rfqmsg/buy_request.go 0 1 0.0%
rfq/negotiator.go 0 14 0.0%
rpcserver.go 0 19 0.0%
Files with Coverage Reduction New Missed Lines %
tapdb/addrs.go 2 79.04%
commitment/tap.go 2 84.43%
tapchannel/aux_leaf_signer.go 3 36.33%
universe/interface.go 4 50.22%
tapgarden/caretaker.go 4 68.5%
Totals Coverage Status
Change from base Build 11684840814: 0.02%
Covered Lines: 24691
Relevant Lines: 60665

💛 - Coveralls

@dstadulis dstadulis added this to the v0.5 (v0.4.2 rename) milestone Nov 5, 2024
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

rpcserver.go Outdated Show resolved Hide resolved
Currently, the `BuyOrder.Peer` field must be specified, but in the
future, the negotiator should be able to select the optimal peer
automatically. This commit updates the interface to support this future
functionality by making `BuyOrder.Peer` an Option type. Note that this
field was already a pointer.
@ffranr ffranr force-pushed the buyorder-refactor branch from 853ff2a to 7f95ca1 Compare November 6, 2024 18:14
Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ⚖️

@guggero guggero merged commit 55c55c9 into main Nov 7, 2024
18 checks passed
@guggero guggero deleted the buyorder-refactor branch November 7, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

5 participants