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

additional amm flags are introduced #2667

Merged
merged 5 commits into from
Mar 21, 2024
Merged

additional amm flags are introduced #2667

merged 5 commits into from
Mar 21, 2024

Conversation

ckeshava
Copy link
Collaborator

High Level Overview of Change

Fix #2666

This PR introduces additional flags used in the AMM-related transactions. I'm using these lines of code as the source of truth: https:/XRPLF/rippled/blob/69143d71f8973e33b701d7becc19da2ad6a68b68/src/ripple/protocol/TxFlags.h#L166

Context of Change

This change brings forth certain AMMFlags into the xrpl-js client library.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Did you update HISTORY.md?

  • Yes
  • No, this change does not impact library users
    Do I need to update HISTORY file? this change implements what was promised in the AMM-transaction documentation.

Test Plan

I'm not familiar with the AMM-transactions to write unit tests for all these flags. Please let me know if you have any ideas.

tfOneAssetWithdrawAll = 0x00040000,
tfTwoAssetIfEmpty = 0x00800000,
tfWithdrawSubTx = tfLPToken |
tfSingleAsset |
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can I not use existing flags to designate new flags? I get the following lint error ://

error Explicit enum value must only be a literal value (string, number, boolean, etc)

Copy link
Collaborator

Choose a reason for hiding this comment

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

There shouldn't be any masks here - the enum should just be the flags.
I would use https://xrpl.org/docs/references/protocol/transactions/types/ammdeposit/#ammdeposit-flags as your source of truth instead of rippled.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's the dev's job to | the flags together, not ours. rippled reuses a lot of these combinations, which is why that code has some combinations. They aren't independent flags, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok thanks, fixed it

@ckeshava ckeshava requested a review from mvadari March 20, 2024 21:17
@mvadari
Copy link
Collaborator

mvadari commented Mar 21, 2024

This should probably be released before AMM goes live tomorrow

Copy link
Collaborator

@mvadari mvadari left a comment

Choose a reason for hiding this comment

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

Please update the changelog

@ckeshava ckeshava requested a review from mvadari March 21, 2024 15:32
packages/xrpl/HISTORY.md Outdated Show resolved Hide resolved
Co-authored-by: Mayukha Vadari <[email protected]>
@ckeshava ckeshava merged commit b322396 into XRPLF:main Mar 21, 2024
15 checks passed
ckeshava added a commit to ckeshava/xrpl.js that referenced this pull request Jun 6, 2024
* additional amm flags are introduced

Co-authored-by: Mayukha Vadari <[email protected]>

---------

Co-authored-by: Mayukha Vadari <[email protected]>
ckeshava added a commit to ckeshava/xrpl.js that referenced this pull request Jun 12, 2024
* additional amm flags are introduced

Co-authored-by: Mayukha Vadari <[email protected]>

---------

Co-authored-by: Mayukha Vadari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tfTwoAssetIfEmpty flag is missing
3 participants