mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
Prevent 'amount' from being misinterpreted (#924)
The 'amount' field should almost never be used. With partial payments, the field can show an amount that is significantly less than the amount that the transaction actually delivered. This change sets amount to 0 XRP when it may be misleading. This change omits the `amount` when parsing payment transactions. See `HISTORY.md` for recommended alternatives.
This commit is contained in:
@@ -256,7 +256,8 @@ module.exports = function createMockRippled(port) {
|
||||
createLedgerResponse(request, fixtures.ledger.withoutCloseTime));
|
||||
} else if (request.ledger_index === 4181996) {
|
||||
conn.send(createLedgerResponse(request, fixtures.ledger.withSettingsTx));
|
||||
} else if (request.ledger_index === 100000) {
|
||||
} else if (request.ledger_index === 22420574 &&
|
||||
request.expand === true && request.transactions === true) {
|
||||
conn.send(
|
||||
createLedgerResponse(request, fixtures.ledger.withPartialPayment));
|
||||
} else if (request.ledger_index === 100001) {
|
||||
@@ -266,8 +267,12 @@ module.exports = function createMockRippled(port) {
|
||||
const response = _.assign({}, fixtures.ledger.normal,
|
||||
{ result: { ledger: fullLedger } });
|
||||
conn.send(createLedgerResponse(request, response));
|
||||
} else {
|
||||
} else if (request.ledger_index === 'validated' ||
|
||||
request.ledger_index === 14661789 ||
|
||||
request.ledger_index === 14661788 /* getTransaction - order */) {
|
||||
conn.send(createLedgerResponse(request, fixtures.ledger.normal));
|
||||
} else {
|
||||
assert(false, 'Unrecognized ledger request: ' + JSON.stringify(request));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user