-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add version fields to RFQ wire messages #911
Conversation
This commit adds an enumeration type for the wire message data field version to the `rfqmsg` package. This enum type can be used across all RFQ wire messages.
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.
Nice!
This commit adds a version field to the wire message data component of the Reject message type.
This commit adds a version field to the wire message data component of the BuyRequest message type.
This commit adds a version field to the wire message data component of the BuyAccept message type.
This commit adds a version field to the wire message data component of the SellRequest message type.
This commit adds a version field to the wire message data component of the SellAccept message type.
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 💯
func WireMsgDataVersionEncoder(w io.Writer, val any, buf *[8]byte) error { | ||
if version, ok := val.(*WireMsgDataVersion); ok { | ||
versionUint8 := uint8(*version) | ||
return tlv.EUint8(w, &versionUint8, buf) |
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: why not EUint8T
like in asset.VersionEncoder
?
return tlv.EUint8T(w, uint8(*version), buf)
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.
It should have been tlv.EUint8T
. I'll try to keep that in mind in the future. This PR was merged before I got a chance to modify it.
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.
Sg, could be in the follow-up PR you mentioned above.
Closes #908