Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

[FIX] Correctly determine when to set SendMax (RLJS-272) #319

Closed
wants to merge 13 commits into from

Conversation

alandotcom
Copy link
Contributor

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_account: 'ACCOUNT1',
   source_amount: {
      value: '0.0003272934271954',
      currency: 'GWD',
      issuer: ''
   },
   destination_account: 'ACCOUNT2',
   destination_amount: {
      value: '0.0003272934271954',
      currency: 'GWD',
      issuer: 'ACCOUNT2'
   }

(The blank issuer is automatically filled in by REST with ACCOUNT1)

@alandotcom alandotcom self-assigned this Mar 19, 2015
@alandotcom
Copy link
Contributor Author

Original tx_json that was generated returned a temREDUNDANT_SEND_MAX error:

  tx_json:
   { Flags: 0,
     InvoiceID: '7788EE2DCFDF27FAB1D67289A121DB21BF16117BF298B38B572CF5FC6DC4DDC4',
     TransactionType: 'Payment',
     Account: 'ACCOUNT1',
     Amount:
      { value: '0.0003272934271954',
        currency: 'GWD',
        issuer: 'ACCOUNT2' },
     Destination: 'ACCOUNT2',
     DestinationTag: 74,
     SendMax:
      { value: '0.0003272934271954',
        currency: 'GWD',
        issuer: 'ACCOUNT1' } }

@alandotcom alandotcom closed this Mar 20, 2015
Alan Cohen and others added 12 commits April 7, 2015 11:45
* release:
  Bump package version
* release:
  Bump version to 1.6.0-rc3
  [FIX] Payment state is pending until validated (RLJS-318)
Plenty of nice changes since 0.7

Highlights:

- Correctly log Error objects:
  winstonjs/winston@ad2d5e1

- Logging objects to file causes slowdown (we don't log to file in this
  project)
  winstonjs/winston@5c4bd41

- Better logging of unhandled exceptions
  winstonjs/winston#84
Correct 0.0.1 version number in config doc
Prepare/sign/submit flow for settings
});
done();
});
});

test('convert() -- payment with same currency for source and destination, no issuer for source amount', function(done) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to add a test for payment with same currency for source and destination, source amount issuer is source account, no issuer for destination amount

@alandotcom alandotcom reopened this Apr 10, 2015
- 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
Copy link
Contributor Author

Ugh, rebased against develop

@alandotcom alandotcom closed this Apr 10, 2015
@alandotcom
Copy link
Contributor Author

Moved to #345

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants