Skip to content

Special case Moonpay/Ripple destination tag handling #5612

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

Merged
merged 2 commits into from
Jun 6, 2025

Conversation

peachbits
Copy link
Contributor

@peachbits peachbits commented Jun 4, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

Approved with optional cleanups.

Comment on lines 203 to 215
const memo: EdgeMemo = {
type: 'text',
value,
hidden: true
}

switch (pluginId) {
case 'ripple': {
memo.type = 'number'
memo.memoName = 'destination tag'
}
}
return memo
Copy link
Contributor

Choose a reason for hiding this comment

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

This code seems odd. Try:

const createMemo = (pluginId: string, value: string): EdgeMemo => {
  const memo: EdgeMemo = {
    type: 'text',
    value,
    hidden: true
  }

  switch (pluginId) {
    case 'ripple': 
      return {  ...memo, type: 'number' }
    default:
      return memo
  }
}

Now all the return statements live in the switch, and we avoid editing data. Also, I don't think memoName is needed in an EdgeSpendInfo?

@samholmes samholmes enabled auto-merge June 6, 2025 20:09
@samholmes samholmes merged commit 1ba45cf into develop Jun 6, 2025
2 checks passed
@samholmes samholmes deleted the matthew/xrp-dt branch June 6, 2025 21:44
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.

3 participants