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

Add version fields to RFQ wire messages #911

Merged
merged 6 commits into from
May 22, 2024
Merged

Add version fields to RFQ wire messages #911

merged 6 commits into from
May 22, 2024

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented May 21, 2024

Closes #908

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.
@ffranr ffranr self-assigned this May 21, 2024
@ffranr ffranr added version Issues which relate to data structure versioning rfq labels May 21, 2024
@ffranr ffranr added this to the v0.4 milestone May 21, 2024
@ffranr ffranr requested review from GeorgeTsagk and guggero May 21, 2024 17:13
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.

Nice!

@ffranr ffranr requested a review from guggero May 21, 2024 18:16
ffranr added 5 commits May 21, 2024 19:16
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.
@ffranr ffranr requested review from jharveyb and removed request for GeorgeTsagk May 21, 2024 18:41
Copy link
Contributor

@jharveyb jharveyb left a 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)
Copy link
Contributor

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)

Copy link
Contributor Author

@ffranr ffranr May 22, 2024

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.

Copy link
Contributor

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.

@guggero guggero added this pull request to the merge queue May 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 22, 2024
@guggero guggero added this pull request to the merge queue May 22, 2024
Merged via the queue into main with commit 1f580d7 May 22, 2024
14 checks passed
@guggero guggero deleted the rfqmsg-version branch May 22, 2024 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfq version Issues which relate to data structure versioning
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[feature]: add version field to RFQ wire messages
4 participants