-
Notifications
You must be signed in to change notification settings - Fork 117
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
RFQ refactor towards adding asset sell request support #845
Conversation
1ed8c7d
to
a0e40e8
Compare
45edb8c
to
681e4b0
Compare
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.
Changes look good with the exception of the last commit (see inline comment).
0896416
to
8323b0b
Compare
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.
Needs a rebase, otherwise LGTM 🎉
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 ⚡
few nits
// Given valid RFQ message id, we then define a RFQ short chain id | ||
// (SCID) by taking the last 8 bytes of the RFQ message id and | ||
// interpreting them as a 64-bit integer. | ||
scidBytes := id[24:] |
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.
nit
scidBytes := id[24:] | |
scidBytes := id[len(id)-8] |
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.
I don't think your suggesting works. We want to select the last 8 elements from the id
array, not the single element at len(id)-8
.
We need to generalise our reject message constructor so that we can generate reject messages for the new sell request message type in addition to the existing buy request message type.
This commit renames the RFQ event type `IncomingAcceptQuoteEvent` to `PeerAcceptedBuyQuoteEvent` such that it is "buy" specific. We will add a new "sell" specific event type in a future commit.
In this commit, we rename methods, RPC endpoints, and variables to clarify that the subject quotes are those that were requested by our node and were accepted by our peers. They are not quotes that our node has accepted. Quotes that our node has accepted are stored as sale/purchase policies in the RFQ order handler.
In this commit we rename a test and update its doc to clarify that the payment made as part of the test is initiated via an asset buy RFQ request. This change is made in preparation for adding a future itest where a payment is made following an asset sell RFQ request.
In this commit we ensure that the mock price oracle returns an ask price when queried even if a suggested bid price is not provided.
This commit makes three changes: 1. Drop the word "remit" in favour of the more well known word "policy". 2. Make the policy struct asset sale specific to make room for an asset purchase policy which will be added in a future commit. 3. Add new `Policy` interface so that the code remains simple going forward.
The short channel ID (SCID) is derived from the message ID. We add a method to the message ID type in an effort to remove duplication of the SCID derivation code.
bf2b678
to
13dddf3
Compare
Last commit ( |
Towards fixing #818
This PR contains commits which refactor the RFQ service towards solving #818 .
The changes in this PR shouldn't change the functionality of the RFQ service. They should rename methods, functions, types, and variables so that the changes necessary for #818 are easier to make in a different PR.