This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
[FIX] Correctly determine when to set SendMax (RLJS-272) #345
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Can this PR get some code review ❤️ ? |
|
||
// SendMax | ||
if (sendMaxRequired()) { | ||
var max_value = bignum(payment.source_amount.value).plus(payment.source_slippage).toString(); |
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.
Should use new BigNumber
, this will fail on newer versions of bignumber.js
alandotcom
force-pushed
the
hotfix/sendmax
branch
from
April 13, 2015 17:27
cee313f
to
a3eef4b
Compare
Updated to fix lint errors |
function sendMaxRequired() { | ||
var src = payment.source_account; | ||
|
||
var srcamt = payment.source_amount; |
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.
Why'd you remove the camel-casing? Also, I generally prefer fewer abbreviations, though sometimes it's reasonable to abbreviate.
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.
Just noticed this. Something was lost when I copy/pasted this function. Will update
alandotcom
force-pushed
the
hotfix/sendmax
branch
from
April 13, 2015 17:38
a3eef4b
to
37b33fa
Compare
- SendMax should not be set when the source and destination currencies are the same and the issuers are "any that the source is able to use and the destination is able to receive" e.g., source_amount: { value: '0.0003272934271954', currency: 'GWD', issuer: '' }, destination_amount: { value: '0.0003272934271954', currency: 'GWD', issuer: 'r4p4gZaWSq8Cs1d8mn1jaGqVU1HUns1ek3' } - SendMax documentation: https://ripple.com/build/transactions/#special-issuer-values-for-sendmax-and-amount
alandotcom
force-pushed
the
hotfix/sendmax
branch
from
April 13, 2015 18:26
37b33fa
to
0057873
Compare
LGTM |
1 similar comment
LGTM |
geertweening
added a commit
that referenced
this pull request
Apr 13, 2015
[FIX] Correctly determine when to set SendMax (RLJS-272)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SendMax should not be set when the source and destination currencies
are the same and the issuers are "any that the source is able to use
and the destination is able to receive"
e.g.,
https://ripple.com/build/transactions/#special-issuer-values-for-sendmax-and-amount