From 650d72260953440df2a83aa00b85d111a83cab9c Mon Sep 17 00:00:00 2001 From: elmurci Date: Thu, 8 Apr 2021 11:46:54 +0200 Subject: [PATCH] Fix #1353: add memos support for multiple transaction types in getTransactions (#1397) * fix(#1353): adds memos support for the following transaction types in `getTransactions`: - AccountDelete - OfferCreate - OfferCancel - CheckCancel - CheckCash - CheckCreate - DepositPreauth - SetFee - PaymentChannelFund - PaymentChannelClaim - PaymentChannelCreate - TicketCreate --- .../specifications/account-delete.json | 3 +- .../schemas/specifications/check-cancel.json | 3 +- .../schemas/specifications/check-cash.json | 3 +- .../schemas/specifications/check-create.json | 3 +- .../specifications/deposit-preauth.json | 3 +- .../specifications/payment-channel-claim.json | 3 +- .../payment-channel-create.json | 3 +- .../specifications/payment-channel-fund.json | 3 +- src/ledger/parse/account-delete.ts | 2 + src/ledger/parse/cancellation.ts | 2 + src/ledger/parse/check-cancel.ts | 2 + src/ledger/parse/check-cash.ts | 2 + src/ledger/parse/check-create.ts | 2 + src/ledger/parse/deposit-preauth.ts | 2 + src/ledger/parse/fee-update.ts | 2 + src/ledger/parse/order.ts | 2 + src/ledger/parse/payment-channel-claim.ts | 2 + src/ledger/parse/payment-channel-create.ts | 3 +- src/ledger/parse/payment-channel-fund.ts | 3 +- src/ledger/parse/payment-channel.ts | 3 +- src/ledger/parse/ticket-create.ts | 2 + test/api/getTransaction/index.ts | 108 ++++++++++ test/api/getTransactions/index.ts | 1 + test/fixtures/addresses.json | 2 +- test/fixtures/hashes.json | 30 ++- .../get-ledger-with-partial-payment.json | 16 +- ...-transaction-account-delete-with-memo.json | 39 ++++ ...et-transaction-check-cancel-with-memo.json | 32 +++ .../get-transaction-check-cash-with-memo.json | 42 ++++ ...et-transaction-check-create-with-memo.json | 39 ++++ ...transaction-deposit-preauth-with-memo.json | 32 +++ .../get-transaction-fee-update-with-memo.json | 28 +++ ...nsaction-order-cancellation-with-memo.json | 50 +++++ .../get-transaction-order-with-memo.json | 59 ++++++ ...ction-payment-channel-claim-with-memo.json | 45 +++++ ...tion-payment-channel-create-with-memo.json | 44 ++++ ...action-payment-channel-fund-with-memo.json | 43 ++++ ...t-transaction-ticket-create-with-memo.json | 32 +++ .../responses/get-transaction-with-memo.json | 74 +++++++ .../responses/get-transaction-with-memos.json | 78 +++++++ .../get-transactions-with-memos.json | 190 ++++++++++++++++++ test/fixtures/responses/index.js | 23 ++- test/fixtures/rippled/index.js | 16 +- .../rippled/tx/account-delete-with-memo.json | 74 +++++++ .../rippled/tx/check-cancel-with-memo.json | 98 +++++++++ .../rippled/tx/check-cash-with-memo.json | 117 +++++++++++ .../rippled/tx/check-create-with-memo.json | 97 +++++++++ .../rippled/tx/deposit-preauth-with-memo.json | 75 +++++++ .../rippled/tx/offer-cancel-with-memo.json | 104 ++++++++++ .../rippled/tx/offer-create-with-memo.json | 101 ++++++++++ .../tx/payment-channel-claim-with-memo.json | 79 ++++++++ .../tx/payment-channel-create-with-memo.json | 95 +++++++++ .../tx/payment-channel-fund-with-memo.json | 78 +++++++ .../rippled/tx/set-fee-with-memo.json | 52 +++++ .../rippled/tx/ticket-create-with-memo.json | 77 +++++++ test/fixtures/rippled/tx/with-memo.json | 142 +++++++++++++ test/fixtures/rippled/tx/with-memos.json | 148 ++++++++++++++ test/mock-rippled.ts | 55 +++++ 58 files changed, 2451 insertions(+), 17 deletions(-) create mode 100644 test/fixtures/responses/get-transaction-account-delete-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-check-cancel-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-check-cash-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-check-create-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-deposit-preauth-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-fee-update-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-order-cancellation-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-order-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-payment-channel-claim-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-payment-channel-create-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-payment-channel-fund-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-ticket-create-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-with-memo.json create mode 100644 test/fixtures/responses/get-transaction-with-memos.json create mode 100644 test/fixtures/responses/get-transactions-with-memos.json create mode 100644 test/fixtures/rippled/tx/account-delete-with-memo.json create mode 100644 test/fixtures/rippled/tx/check-cancel-with-memo.json create mode 100644 test/fixtures/rippled/tx/check-cash-with-memo.json create mode 100644 test/fixtures/rippled/tx/check-create-with-memo.json create mode 100644 test/fixtures/rippled/tx/deposit-preauth-with-memo.json create mode 100644 test/fixtures/rippled/tx/offer-cancel-with-memo.json create mode 100644 test/fixtures/rippled/tx/offer-create-with-memo.json create mode 100644 test/fixtures/rippled/tx/payment-channel-claim-with-memo.json create mode 100644 test/fixtures/rippled/tx/payment-channel-create-with-memo.json create mode 100644 test/fixtures/rippled/tx/payment-channel-fund-with-memo.json create mode 100644 test/fixtures/rippled/tx/set-fee-with-memo.json create mode 100644 test/fixtures/rippled/tx/ticket-create-with-memo.json create mode 100644 test/fixtures/rippled/tx/with-memo.json create mode 100644 test/fixtures/rippled/tx/with-memos.json diff --git a/src/common/schemas/specifications/account-delete.json b/src/common/schemas/specifications/account-delete.json index 2fa8c05d..6327da9b 100644 --- a/src/common/schemas/specifications/account-delete.json +++ b/src/common/schemas/specifications/account-delete.json @@ -15,7 +15,8 @@ "destinationXAddress": { "$ref": "address", "description": "X-address of an account to receive any leftover XRP after deleting the sending account. Must be a funded account in the ledger, and must not be the sending account." - } + }, + "memos": {"$ref": "memos"} }, "anyOf": [ { diff --git a/src/common/schemas/specifications/check-cancel.json b/src/common/schemas/specifications/check-cancel.json index a3558a18..676ce926 100644 --- a/src/common/schemas/specifications/check-cancel.json +++ b/src/common/schemas/specifications/check-cancel.json @@ -7,7 +7,8 @@ "checkID": { "$ref": "hash256", "description": "The ID of the Check ledger object to cancel, as a 64-character hexadecimal string." - } + }, + "memos": {"$ref": "memos"} }, "required": ["checkID"], "additionalProperties": false diff --git a/src/common/schemas/specifications/check-cash.json b/src/common/schemas/specifications/check-cash.json index 9895f318..251e7a3d 100644 --- a/src/common/schemas/specifications/check-cash.json +++ b/src/common/schemas/specifications/check-cash.json @@ -15,7 +15,8 @@ "deliverMin": { "$ref": "laxAmount", "description": "Redeem the Check for at least this amount and for as much as possible. The currency must match that of the sendMax of the corresponding CheckCreate transaction. You must provide either this field or amount." - } + }, + "memos": {"$ref": "memos"} }, "required": ["checkID"], "oneOf": [ diff --git a/src/common/schemas/specifications/check-create.json b/src/common/schemas/specifications/check-create.json index b8bb228b..cf7cee2d 100644 --- a/src/common/schemas/specifications/check-create.json +++ b/src/common/schemas/specifications/check-create.json @@ -24,7 +24,8 @@ "invoiceID": { "$ref": "hash256", "description": "256-bit hash, as a 64-character hexadecimal string, representing a specific reason or identifier for this check." - } + }, + "memos": {"$ref": "memos"} }, "required": ["destination", "sendMax"], "additionalProperties": false diff --git a/src/common/schemas/specifications/deposit-preauth.json b/src/common/schemas/specifications/deposit-preauth.json index 02c826d9..8412fb0c 100644 --- a/src/common/schemas/specifications/deposit-preauth.json +++ b/src/common/schemas/specifications/deposit-preauth.json @@ -11,7 +11,8 @@ "unauthorize": { "$ref": "address", "description": "Address of the account that can cash the check." - } + }, + "memos": {"$ref": "memos"} }, "oneOf": [ {"required": ["authorize"]}, diff --git a/src/common/schemas/specifications/payment-channel-claim.json b/src/common/schemas/specifications/payment-channel-claim.json index d0fe3aa0..197dd4ec 100644 --- a/src/common/schemas/specifications/payment-channel-claim.json +++ b/src/common/schemas/specifications/payment-channel-claim.json @@ -31,7 +31,8 @@ "close": { "type": "boolean", "description": "Request to close the channel. If the channel has no XRP remaining or the destination address requests it, closes the channel immediately (returning unclaimed XRP to the source address). Otherwise, sets the channel to expire after settleDelay seconds have passed." - } + }, + "memos": {"$ref": "memos"} }, "required": ["channel"], "additionalProperties": false diff --git a/src/common/schemas/specifications/payment-channel-create.json b/src/common/schemas/specifications/payment-channel-create.json index 82d38a37..b7bc11d7 100644 --- a/src/common/schemas/specifications/payment-channel-create.json +++ b/src/common/schemas/specifications/payment-channel-create.json @@ -32,7 +32,8 @@ "destinationTag": { "$ref": "tag", "description": "Destination tag." - } + }, + "memos": {"$ref": "memos"} }, "required": ["amount", "destination", "settleDelay", "publicKey"], "additionalProperties": false diff --git a/src/common/schemas/specifications/payment-channel-fund.json b/src/common/schemas/specifications/payment-channel-fund.json index 6aeb5917..98da5abc 100644 --- a/src/common/schemas/specifications/payment-channel-fund.json +++ b/src/common/schemas/specifications/payment-channel-fund.json @@ -16,7 +16,8 @@ "type": "string", "format": "date-time", "description": "New expiration for this channel. (This does not change the cancelAfter expiration, if the channel has one.) Cannot move the expiration sooner than settleDelay seconds from time of the request." - } + }, + "memos": {"$ref": "memos"} }, "required": ["amount", "channel"], "additionalProperties": false diff --git a/src/ledger/parse/account-delete.ts b/src/ledger/parse/account-delete.ts index 6f45d6bb..380fe675 100644 --- a/src/ledger/parse/account-delete.ts +++ b/src/ledger/parse/account-delete.ts @@ -1,6 +1,7 @@ import * as assert from 'assert' import {removeUndefined} from '../../common' import {classicAddressToXAddress} from 'ripple-address-codec' +import {parseMemos} from './utils' export type FormattedAccountDelete = { // account (address) of an account to receive any leftover XRP after deleting the sending account. @@ -21,6 +22,7 @@ function parseAccountDelete(tx: any): FormattedAccountDelete { assert.ok(tx.TransactionType === 'AccountDelete') return removeUndefined({ + memos: parseMemos(tx), destination: tx.Destination, destinationTag: tx.DestinationTag, destinationXAddress: classicAddressToXAddress( diff --git a/src/ledger/parse/cancellation.ts b/src/ledger/parse/cancellation.ts index 4ca537bb..3fbff8f8 100644 --- a/src/ledger/parse/cancellation.ts +++ b/src/ledger/parse/cancellation.ts @@ -1,8 +1,10 @@ import * as assert from 'assert' +import {parseMemos} from './utils' function parseOrderCancellation(tx: any): object { assert.ok(tx.TransactionType === 'OfferCancel') return { + memos: parseMemos(tx), orderSequence: tx.OfferSequence } } diff --git a/src/ledger/parse/check-cancel.ts b/src/ledger/parse/check-cancel.ts index 97a1d058..aa523f6d 100644 --- a/src/ledger/parse/check-cancel.ts +++ b/src/ledger/parse/check-cancel.ts @@ -1,5 +1,6 @@ import * as assert from 'assert' import {removeUndefined} from '../../common' +import {parseMemos} from './utils' export type FormattedCheckCancel = { // ID of the Check ledger object to cancel. @@ -10,6 +11,7 @@ function parseCheckCancel(tx: any): FormattedCheckCancel { assert.ok(tx.TransactionType === 'CheckCancel') return removeUndefined({ + memos: parseMemos(tx), checkID: tx.CheckID }) } diff --git a/src/ledger/parse/check-cash.ts b/src/ledger/parse/check-cash.ts index 9dc31e74..53c9542f 100644 --- a/src/ledger/parse/check-cash.ts +++ b/src/ledger/parse/check-cash.ts @@ -2,6 +2,7 @@ import * as assert from 'assert' import {removeUndefined} from '../../common' import parseAmount from './amount' import {Amount} from '../../common/types/objects' +import {parseMemos} from './utils' export type FormattedCheckCash = { // ID of the Check ledger object to cash. @@ -25,6 +26,7 @@ function parseCheckCash(tx: any): FormattedCheckCash { assert.ok(tx.TransactionType === 'CheckCash') return removeUndefined({ + memos: parseMemos(tx), checkID: tx.CheckID, amount: tx.Amount && parseAmount(tx.Amount), deliverMin: tx.DeliverMin && parseAmount(tx.DeliverMin) diff --git a/src/ledger/parse/check-create.ts b/src/ledger/parse/check-create.ts index 8c502e90..79ad6a8b 100644 --- a/src/ledger/parse/check-create.ts +++ b/src/ledger/parse/check-create.ts @@ -3,6 +3,7 @@ import {parseTimestamp} from './utils' import {removeUndefined} from '../../common' import parseAmount from './amount' import {Amount} from '../../common/types/objects' +import {parseMemos} from './utils' export type FormattedCheckCreate = { // account that can cash the check. @@ -26,6 +27,7 @@ function parseCheckCreate(tx: any): FormattedCheckCreate { assert.ok(tx.TransactionType === 'CheckCreate') return removeUndefined({ + memos: parseMemos(tx), destination: tx.Destination, sendMax: parseAmount(tx.SendMax), destinationTag: tx.DestinationTag, diff --git a/src/ledger/parse/deposit-preauth.ts b/src/ledger/parse/deposit-preauth.ts index 6517691d..71094245 100644 --- a/src/ledger/parse/deposit-preauth.ts +++ b/src/ledger/parse/deposit-preauth.ts @@ -1,5 +1,6 @@ import * as assert from 'assert' import {removeUndefined} from '../../common' +import {parseMemos} from './utils' export type FormattedDepositPreauth = { // account (address) of the sender to preauthorize @@ -13,6 +14,7 @@ function parseDepositPreauth(tx: any): FormattedDepositPreauth { assert.ok(tx.TransactionType === 'DepositPreauth') return removeUndefined({ + memos: parseMemos(tx), authorize: tx.Authorize, unauthorize: tx.Unauthorize }) diff --git a/src/ledger/parse/fee-update.ts b/src/ledger/parse/fee-update.ts index 600b002b..fdba6168 100644 --- a/src/ledger/parse/fee-update.ts +++ b/src/ledger/parse/fee-update.ts @@ -1,9 +1,11 @@ import BigNumber from 'bignumber.js' import {dropsToXrp} from '../../common' +import {parseMemos} from './utils' function parseFeeUpdate(tx: any) { const baseFeeDrops = new BigNumber(tx.BaseFee, 16).toString() return { + memos: parseMemos(tx), baseFeeXRP: dropsToXrp(baseFeeDrops), referenceFeeUnits: tx.ReferenceFeeUnits, reserveBaseXRP: dropsToXrp(tx.ReserveBase), diff --git a/src/ledger/parse/order.ts b/src/ledger/parse/order.ts index 527a3f53..1d77c9b8 100644 --- a/src/ledger/parse/order.ts +++ b/src/ledger/parse/order.ts @@ -1,5 +1,6 @@ import * as assert from 'assert' import {parseTimestamp} from './utils' +import {parseMemos} from './utils' import parseAmount from './amount' import {removeUndefined, txFlags} from '../../common' import { @@ -19,6 +20,7 @@ function parseOrder(tx: OfferCreateTransaction): FormattedOrderSpecification { const totalPrice = direction === 'buy' ? takerGetsAmount : takerPaysAmount return removeUndefined({ + memos: parseMemos(tx), direction: direction, quantity: quantity, totalPrice: totalPrice, diff --git a/src/ledger/parse/payment-channel-claim.ts b/src/ledger/parse/payment-channel-claim.ts index bede3dd9..aa15042d 100644 --- a/src/ledger/parse/payment-channel-claim.ts +++ b/src/ledger/parse/payment-channel-claim.ts @@ -1,12 +1,14 @@ import * as assert from 'assert' import {removeUndefined, txFlags} from '../../common' import parseAmount from './amount' +import {parseMemos} from './utils' const claimFlags = txFlags.PaymentChannelClaim function parsePaymentChannelClaim(tx: any): object { assert.ok(tx.TransactionType === 'PaymentChannelClaim') return removeUndefined({ + memos: parseMemos(tx), channel: tx.Channel, balance: tx.Balance && parseAmount(tx.Balance).value, amount: tx.Amount && parseAmount(tx.Amount).value, diff --git a/src/ledger/parse/payment-channel-create.ts b/src/ledger/parse/payment-channel-create.ts index f0943e28..1ca7892f 100644 --- a/src/ledger/parse/payment-channel-create.ts +++ b/src/ledger/parse/payment-channel-create.ts @@ -1,5 +1,5 @@ import * as assert from 'assert' -import {parseTimestamp} from './utils' +import {parseTimestamp,parseMemos} from './utils' import {removeUndefined} from '../../common' import parseAmount from './amount' @@ -7,6 +7,7 @@ function parsePaymentChannelCreate(tx: any): object { assert.ok(tx.TransactionType === 'PaymentChannelCreate') return removeUndefined({ + memos: parseMemos(tx), amount: parseAmount(tx.Amount).value, destination: tx.Destination, settleDelay: tx.SettleDelay, diff --git a/src/ledger/parse/payment-channel-fund.ts b/src/ledger/parse/payment-channel-fund.ts index 2503978b..0028e329 100644 --- a/src/ledger/parse/payment-channel-fund.ts +++ b/src/ledger/parse/payment-channel-fund.ts @@ -1,5 +1,5 @@ import * as assert from 'assert' -import {parseTimestamp} from './utils' +import {parseTimestamp,parseMemos} from './utils' import {removeUndefined} from '../../common' import parseAmount from './amount' @@ -7,6 +7,7 @@ function parsePaymentChannelFund(tx: any): object { assert.ok(tx.TransactionType === 'PaymentChannelFund') return removeUndefined({ + memos: parseMemos(tx), channel: tx.Channel, amount: parseAmount(tx.Amount).value, expiration: tx.Expiration && parseTimestamp(tx.Expiration) diff --git a/src/ledger/parse/payment-channel.ts b/src/ledger/parse/payment-channel.ts index 3b83b784..79a761b2 100644 --- a/src/ledger/parse/payment-channel.ts +++ b/src/ledger/parse/payment-channel.ts @@ -1,4 +1,4 @@ -import {parseTimestamp} from './utils' +import {parseTimestamp, parseMemos} from './utils' import {removeUndefined, dropsToXrp} from '../../common' import {PayChannelLedgerEntry} from '../../common/types/objects' @@ -21,6 +21,7 @@ export function parsePaymentChannel( data: PayChannelLedgerEntry ): FormattedPaymentChannel { return removeUndefined({ + memos: parseMemos(data), account: data.Account, amount: dropsToXrp(data.Amount), balance: dropsToXrp(data.Balance), diff --git a/src/ledger/parse/ticket-create.ts b/src/ledger/parse/ticket-create.ts index 04c59196..388acb9d 100644 --- a/src/ledger/parse/ticket-create.ts +++ b/src/ledger/parse/ticket-create.ts @@ -1,9 +1,11 @@ import * as assert from 'assert' import {removeUndefined} from '../../common' +import {parseMemos} from './utils' function parseTicketCreate(tx: any): object { assert.ok(tx.TransactionType === 'TicketCreate') return removeUndefined({ + memos: parseMemos(tx), ticketCount: tx.TicketCount }) } diff --git a/test/api/getTransaction/index.ts b/test/api/getTransaction/index.ts index e7a8037b..1805358b 100644 --- a/test/api/getTransaction/index.ts +++ b/test/api/getTransaction/index.ts @@ -69,6 +69,13 @@ export default { assertResultMatch(response, RESPONSE_FIXTURES.order, 'getTransaction') }, + 'order with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_OFFER_CREATE_TRANSACTION_HASH + closeLedger(api.connection) + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.orderWithMemo, 'getTransaction') + }, + 'sell order': async (api, address) => { const hash = '458101D51051230B1D56E9ACAFAA34451BF65FA000F95DF6F0FF5B3A62D83FC2' @@ -100,6 +107,17 @@ export default { ) }, + 'order cancellation with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_ORDER_CANCELLATION_TRANSACTION_HASH + closeLedger(api.connection) + const response = await api.getTransaction(hash) + assertResultMatch( + response, + RESPONSE_FIXTURES.orderCancellationWithMemo, + 'getTransaction' + ) + }, + 'trustline set': async (api, address) => { const hash = '635A0769BD94710A1F6A76CDE65A3BC661B20B798807D1BBBDADCEA26420538D' @@ -258,6 +276,12 @@ export default { assertResultMatch(response, RESPONSE_FIXTURES.checkCreate, 'getTransaction') }, + 'CheckCreate with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_CHECK_CREATE_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.checkCreateWithMemo, 'getTransaction') + }, + 'CheckCancel': async (api, address) => { const hash = 'B4105D1B2D83819647E4692B7C5843D674283F669524BD50C9614182E3A12CD4' @@ -265,6 +289,12 @@ export default { assertResultMatch(response, RESPONSE_FIXTURES.checkCancel, 'getTransaction') }, + 'CheckCancel with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_CHECK_CANCEL_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.checkCancelWithMemo, 'getTransaction') + }, + 'CheckCash': async (api, address) => { const hash = '8321208465F70BA52C28BCC4F646BAF3B012BA13B57576C0336F42D77E3E0749' @@ -272,6 +302,12 @@ export default { assertResultMatch(response, RESPONSE_FIXTURES.checkCash, 'getTransaction') }, + 'CheckCash with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_CHECK_CASH_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.checkCashWithMemo, 'getTransaction') + }, + // Escrows 'EscrowCreation': async (api, address) => { const hash = @@ -332,6 +368,16 @@ export default { ) }, + 'PaymentChannelCreate with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_PAYMENT_CHANNEL_CREATE_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch( + response, + RESPONSE_FIXTURES.paymentChannelCreateWithMemo, + 'getTransaction' + ) + }, + 'PaymentChannelFund': async (api, address) => { const hash = 'CD053D8867007A6A4ACB7A432605FE476D088DCB515AFFC886CF2B4EB6D2AE8B' @@ -343,6 +389,16 @@ export default { ) }, + 'PaymentChannelFund with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_PAYMENT_CHANNEL_FUND_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch( + response, + RESPONSE_FIXTURES.paymentChannelFundWithMemo, + 'getTransaction' + ) + }, + 'PaymentChannelClaim': async (api, address) => { const hash = '81B9ECAE7195EB6E8034AEDF44D8415A7A803E14513FDBB34FA984AB37D59563' @@ -354,6 +410,16 @@ export default { ) }, + 'PaymentChannelClaim with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_PAYMENT_CHANNEL_CLAIM_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch( + response, + RESPONSE_FIXTURES.paymentChannelClaimWithMemo, + 'getTransaction' + ) + }, + 'AccountDelete': async (api, address) => { const hash = 'EC2AB14028DC84DE525470AB4DAAA46358B50A8662C63804BFF38244731C0CB9' @@ -365,6 +431,16 @@ export default { ) }, + 'AccountDelete with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_ACCOUNT_DELETE_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch( + response, + RESPONSE_FIXTURES.accountDeleteWithMemo, + 'getTransaction' + ) + }, + 'no Meta': async (api, address) => { const hash = 'AFB3ADF22F3C605E23FAEFAA185F3BD763C4692CAC490D9819D117CD33BFAA1B' @@ -396,5 +472,37 @@ export default { 'C6A40F56127436DCD830B1B35FF939FD05B5747D30D6542572B7A835239817AF' const response = await api.getTransaction(hash) assertResultMatch(response, RESPONSE_FIXTURES.feeUpdate) + }, + + 'feeUpdate with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_FEE_UPDATE_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.feeUpdateWithMemo) + }, + + 'order with one memo': async (api, address) => { + const hash = + '995570FE1E40F42DF56BFC80503BA9E3C1229619C61A1C279A76BC0805036D74' + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.withMemo) + }, + + 'order with more than one memo': async (api, address) => { + const hash = + '995570FE1E40F42DF56BFC80503BA9E3C1229619C61A1C279A76BC0805036D73' + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.withMemos) + }, + + 'ticketCreate with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_TICKET_CREATE_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.ticketCreateWithMemo) + }, + + 'depositPreauth with memo': async (api, address) => { + const hash = hashes.WITH_MEMOS_DEPOSIT_PREAUTH_TRANSACTION_HASH + const response = await api.getTransaction(hash) + assertResultMatch(response, RESPONSE_FIXTURES.depositPreauthWithMemo) } } diff --git a/test/api/getTransactions/index.ts b/test/api/getTransactions/index.ts index 4f4b9178..0156c2a6 100644 --- a/test/api/getTransactions/index.ts +++ b/test/api/getTransactions/index.ts @@ -155,6 +155,7 @@ export default { const response = await api.getTransactions(addresses.OTHER_ACCOUNT) assertResultMatch(response, RESPONSE_FIXTURES.one, 'getTransactions') } + } // This test relies on the binary (hex string) format, but computed fields like `date` diff --git a/test/fixtures/addresses.json b/test/fixtures/addresses.json index 585be161..9947b7cb 100644 --- a/test/fixtures/addresses.json +++ b/test/fixtures/addresses.json @@ -9,4 +9,4 @@ "NOTFOUND": "rajTAg3hon5Lcu1RxQQPxTgHvqfhc1EaUS", "SECRET": "shsWGZcmZz6YsWWmcnpfr6fLTdtFV", "SOURCE_LOW_FUNDS": "rhVgDEfS1r1fLyRUZCpab4TdowZcAJwHy2" -} \ No newline at end of file +} diff --git a/test/fixtures/hashes.json b/test/fixtures/hashes.json index 4183968b..5bc55ab0 100644 --- a/test/fixtures/hashes.json +++ b/test/fixtures/hashes.json @@ -6,5 +6,33 @@ "INVALID_TRANSACTION_HASH": "XF4AB442A6D4CBB935D66E1DA7309A5FC71C7143ED4049053EC14E3875B0CF9BF", "ORDER_HASH": - "71AE74B03DE3B9A06C559AD4D173A362D96B7D2A5AA35F56B9EF21543D627F34" + "71AE74B03DE3B9A06C559AD4D173A362D96B7D2A5AA35F56B9EF21543D627F34", + "WITH_MEMO_TRANSACTION_HASH": + "995570FE1E40F42DF56BFC80503BA9E3C1229619C61A1C279A76BC0805036D74", + "WITH_MEMOS_TRANSACTION_HASH": + "995570FE1E40F42DF56BFC80503BA9E3C1229619C61A1C279A76BC0805036D73", + "WITH_MEMOS_ACCOUNT_DELETE_TRANSACTION_HASH": + "BB1F552C57880F636FE8A88C041DEBAE96B428074CB4AB7DF489181F512B9FC3", + "WITH_MEMOS_ORDER_CANCELLATION_TRANSACTION_HASH": + "447D52F132DB6B5EFB828D67E4D746B5A580FC37A61077A17920BFFFC86D05D1", + "WITH_MEMOS_CHECK_CREATE_TRANSACTION_HASH": + "605A2E2C8E48AECAF5C56085D1AEAA0348DC838CE122C9188F94EB19DA05C2F1", + "WITH_MEMOS_CHECK_CANCEL_TRANSACTION_HASH": + "B4105D1B2D83819647E4692B7C5843D674283F669524BD50C9614182E3A12CD1", + "WITH_MEMOS_CHECK_CASH_TRANSACTION_HASH": + "8321208465F70BA52C28BCC4F646BAF3B012BA13B57576C0336F42D77E3E0741", + "WITH_MEMOS_PAYMENT_CHANNEL_CLAIM_TRANSACTION_HASH": + "81B9ECAE7195EB6E8034AEDF44D8415A7A803E14513FDBB34FA984AB37D59561", + "WITH_MEMOS_PAYMENT_CHANNEL_CREATE_TRANSACTION_HASH": + "0E9CA3AB1053FC0C1CBAA75F636FE1EC92F118C7056BBEF5D63E4C116458A161", + "WITH_MEMOS_PAYMENT_CHANNEL_FUND_TRANSACTION_HASH": + "CD053D8867007A6A4ACB7A432605FE476D088DCB515AFFC886CF2B4EB6D2AE81", + "WITH_MEMOS_DEPOSIT_PREAUTH_TRANSACTION_HASH": + "3BA61A2621C09A119A12EA9271AE5FA165B6E39657E02BFD3C5B21E28F72B883", + "WITH_MEMOS_FEE_UPDATE_TRANSACTION_HASH": + "C6A40F56127436DCD830B1B35FF939FD05B5747D30D6542572B7A835239817A1", + "WITH_MEMOS_TICKET_CREATE_TRANSACTION_HASH": + "1797BD0898F54F0732D2FFFF715A75CC1C50D1883A875A7B9BFD0F6936461359", + "WITH_MEMOS_OFFER_CREATE_TRANSACTION_HASH": + "5D9B0B246255815B63983C188B4C23325B3544F605CDBE3004769EE9E990D2F1" } diff --git a/test/fixtures/responses/get-ledger-with-partial-payment.json b/test/fixtures/responses/get-ledger-with-partial-payment.json index ce7d2f7d..ed50b419 100644 --- a/test/fixtures/responses/get-ledger-with-partial-payment.json +++ b/test/fixtures/responses/get-ledger-with-partial-payment.json @@ -69,7 +69,13 @@ "currency": "JPY", "value": "302728.16600853", "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN" - } + }, + "memos": [ + { + "type": "offer_comment", + "data": "S_rf_jpy_usd_tokyo_bit_gf#q_ripple" + } + ] }, "outcome": { "result": "tesSUCCESS", @@ -333,7 +339,13 @@ "currency": "JPY", "value": "254121.4048342", "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN" - } + }, + "memos": [ + { + "type": "offer_comment", + "data": "S_rf_jpy_usd_tokyo_bit_maxim#q_ripple" + } + ] }, "outcome": { "result": "tesSUCCESS", diff --git a/test/fixtures/responses/get-transaction-account-delete-with-memo.json b/test/fixtures/responses/get-transaction-account-delete-with-memo.json new file mode 100644 index 00000000..23621ede --- /dev/null +++ b/test/fixtures/responses/get-transaction-account-delete-with-memo.json @@ -0,0 +1,39 @@ +{ + "type": "accountDelete", + "address": "rPMMnbyptUziwr4eWAUQ3UHycaiNKZTJWd", + "sequence": 16427655, + "id": "BB1F552C57880F636FE8A88C041DEBAE96B428074CB4AB7DF489181F512B9FC3", + "specification": { + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ], + "destination": "rErhTv3pwYAgsERLfhtWeE33wAHtDRuUwK", + "destinationXAddress": "XVEwxw6GgRruNDrp8d4bTkqjBt3S3fcrNdjdAS8j7BZxp2e" + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2019-12-17T09:16:51.000Z", + "fee": "5", + "balanceChanges": { + "rErhTv3pwYAgsERLfhtWeE33wAHtDRuUwK": [ + { + "currency": "XRP", + "value": "994.979976" + } + ], + "rPMMnbyptUziwr4eWAUQ3UHycaiNKZTJWd": [ + { + "currency": "XRP", + "value": "-999.979976" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 16430632, + "indexInLedger": 0 + } +} diff --git a/test/fixtures/responses/get-transaction-check-cancel-with-memo.json b/test/fixtures/responses/get-transaction-check-cancel-with-memo.json new file mode 100644 index 00000000..27140da7 --- /dev/null +++ b/test/fixtures/responses/get-transaction-check-cancel-with-memo.json @@ -0,0 +1,32 @@ +{ + "type": "checkCancel", + "address": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "sequence": 6, + "id": "B4105D1B2D83819647E4692B7C5843D674283F669524BD50C9614182E3A12CD4", + "specification": { + "checkID": "6EE1727598693635183A3D967342A46C739FC06F973CA6A3277A92E8D997E7A8", + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2018-02-23T22:45:41.000Z", + "fee": "0.000012", + "balanceChanges": { + "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE": [ + { + "currency": "XRP", + "value": "-0.000012" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 6967970, + "indexInLedger": 4 + } +} diff --git a/test/fixtures/responses/get-transaction-check-cash-with-memo.json b/test/fixtures/responses/get-transaction-check-cash-with-memo.json new file mode 100644 index 00000000..5500e181 --- /dev/null +++ b/test/fixtures/responses/get-transaction-check-cash-with-memo.json @@ -0,0 +1,42 @@ +{ + "type": "checkCash", + "address": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "sequence": 3, + "id": "8321208465F70BA52C28BCC4F646BAF3B012BA13B57576C0336F42D77E3E0749", + "specification": { + "checkID": "4F6DDA7972A5E8C8F2AA3D2A475E56475FA573C65B935E26EABDA5F06A982C70", + "amount": { + "currency": "XRP", + "value": "2.5" + }, + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2018-02-23T22:26:52.000Z", + "fee": "0.000012", + "balanceChanges": { + "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr": [ + { + "currency": "XRP", + "value": "2.499988" + } + ], + "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE": [ + { + "currency": "XRP", + "value": "-2.5" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 6967596, + "indexInLedger": 0 + } +} diff --git a/test/fixtures/responses/get-transaction-check-create-with-memo.json b/test/fixtures/responses/get-transaction-check-create-with-memo.json new file mode 100644 index 00000000..74239aea --- /dev/null +++ b/test/fixtures/responses/get-transaction-check-create-with-memo.json @@ -0,0 +1,39 @@ +{ + "type": "checkCreate", + "address": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "sequence": 3, + "id": "605A2E2C8E48AECAF5C56085D1AEAA0348DC838CE122C9188F94EB19DA05C2FE", + "specification": { + "destination": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "sendMax": { + "currency": "XRP", + "value": "3" + }, + "destinationTag": 1235, + "expiration": "2018-02-25T21:22:47.000Z", + "invoiceID": "DEADBEEF2FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B", + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2018-02-23T22:20:01.000Z", + "fee": "0.000012", + "balanceChanges": { + "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE": [ + { + "currency": "XRP", + "value": "-0.000012" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 6967458, + "indexInLedger": 1 + } +} diff --git a/test/fixtures/responses/get-transaction-deposit-preauth-with-memo.json b/test/fixtures/responses/get-transaction-deposit-preauth-with-memo.json new file mode 100644 index 00000000..3da40e8f --- /dev/null +++ b/test/fixtures/responses/get-transaction-deposit-preauth-with-memo.json @@ -0,0 +1,32 @@ +{ + "type": "depositPreauth", + "address": "rH8AzLerezBnkuM7reZfrQ513nRvKjDrnx", + "sequence": 16433982, + "id": "3BA61A2621C09A119A12EA9271AE5FA165B6E39657E02BFD3C5B21E28F72B883", + "specification": { + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ], + "authorize": "rErhTv3pwYAgsERLfhtWeE33wAHtDRuUwK" + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2018-02-23T22:20:01.000Z", + "fee": "0.000012", + "balanceChanges": { + "rH8AzLerezBnkuM7reZfrQ513nRvKjDrnx": [ + { + "currency": "XRP", + "value": "-0.000012" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 16433986, + "indexInLedger": 0 + } +} diff --git a/test/fixtures/responses/get-transaction-fee-update-with-memo.json b/test/fixtures/responses/get-transaction-fee-update-with-memo.json new file mode 100644 index 00000000..5f4d8f91 --- /dev/null +++ b/test/fixtures/responses/get-transaction-fee-update-with-memo.json @@ -0,0 +1,28 @@ +{ + "type": "feeUpdate", + "address": "rrrrrrrrrrrrrrrrrrrrrhoLvTp", + "sequence": 0, + "id": "C6A40F56127436DCD830B1B35FF939FD05B5747D30D6542572B7A835239817A1", + "specification": { + "baseFeeXRP": "0.00001", + "referenceFeeUnits": 10, + "reserveBaseXRP": "50", + "reserveIncrementXRP": "12.5", + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2014-08-08T16:57:50.000Z", + "fee": "0", + "balanceChanges": {}, + "orderbookChanges": {}, + "ledgerVersion": 3717633, + "indexInLedger": 3 + } +} diff --git a/test/fixtures/responses/get-transaction-order-cancellation-with-memo.json b/test/fixtures/responses/get-transaction-order-cancellation-with-memo.json new file mode 100644 index 00000000..b12954b2 --- /dev/null +++ b/test/fixtures/responses/get-transaction-order-cancellation-with-memo.json @@ -0,0 +1,50 @@ +{ + "type": "orderCancellation", + "address": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b", + "id": "447D52F132DB6B5EFB828D67E4D746B5A580FC37A61077A17920BFFFC86D05D1", + "sequence": 466, + "specification": { + "orderSequence": 465, + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2014-09-24T21:21:50.000Z", + "fee": "0.012", + "balanceChanges": { + "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b": [ + { + "currency": "XRP", + "value": "-0.012" + } + ] + }, + "orderbookChanges": { + "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b": [ + { + "direction": "buy", + "quantity": { + "currency": "USD", + "counterparty": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "237" + }, + "totalPrice": { + "currency": "XRP", + "value": "0.0002" + }, + "makerExchangeRate": "1185000", + "sequence": 465, + "status": "cancelled" + } + ] + }, + "ledgerVersion": 14661789, + "indexInLedger": 4 + } +} diff --git a/test/fixtures/responses/get-transaction-order-with-memo.json b/test/fixtures/responses/get-transaction-order-with-memo.json new file mode 100644 index 00000000..b32f12d4 --- /dev/null +++ b/test/fixtures/responses/get-transaction-order-with-memo.json @@ -0,0 +1,59 @@ +{ + "type": "order", + "address": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b", + "id": "5D9B0B246255815B63983C188B4C23325B3544F605CDBE3004769EE9E990D2F1", + "sequence": 465, + "specification": { + "direction": "buy", + "quantity": { + "currency": "USD", + "value": "237", + "counterparty": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q" + }, + "totalPrice": { + "currency": "XRP", + "value": "0.0002" + }, + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2014-09-24T21:21:50.000Z", + "fee": "0.012", + "balanceChanges": { + "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b": [ + { + "currency": "XRP", + "value": "-0.012" + } + ] + }, + "orderbookChanges": { + "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b": [ + { + "direction": "buy", + "quantity": { + "currency": "USD", + "counterparty": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "237" + }, + "totalPrice": { + "currency": "XRP", + "value": "0.0002" + }, + "makerExchangeRate": "1185000", + "sequence": 465, + "status": "created" + } + ] + }, + "ledgerVersion": 14661788, + "indexInLedger": 2 + } +} diff --git a/test/fixtures/responses/get-transaction-payment-channel-claim-with-memo.json b/test/fixtures/responses/get-transaction-payment-channel-claim-with-memo.json new file mode 100644 index 00000000..a97f539e --- /dev/null +++ b/test/fixtures/responses/get-transaction-payment-channel-claim-with-memo.json @@ -0,0 +1,45 @@ +{ + "type": "paymentChannelClaim", + "address": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "sequence": 99, + "id": "81B9ECAE7195EB6E8034AEDF44D8415A7A803E14513FDBB34FA984AB37D59561", + "specification": { + "channel": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "balance": "0.801", + "publicKey": "EDE059A23CBE00BDD465910EBDA67C86BAD046FA52E1BBBB27159E31980BAFEFB9", + "signature": "5567FB8A27D8BF0C556D3D31D034476FC04F43846A6613EB4B1B64C396C833600BE251CE3104CF02DA0085B473E02BA0BA21F794FB1DC95DAD702F3EA761CA02", + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2017-03-09T14:09:51.000Z", + "fee": "0.000012", + "balanceChanges": { + "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa": [ + { + "currency": "XRP", + "value": "0.800988" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 786310, + "indexInLedger": 0, + "channelChanges": { + "status": "modified", + "channelId": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "source": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "destination": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "channelBalanceChangeDrops": "801000", + "channelAmountDrops": "1000000", + "channelBalanceDrops": "801000", + "previousTxnId": "0E9CA3AB1053FC0C1CBAA75F636FE1EC92F118C7056BBEF5D63E4C116458A16D" + } + } +} diff --git a/test/fixtures/responses/get-transaction-payment-channel-create-with-memo.json b/test/fixtures/responses/get-transaction-payment-channel-create-with-memo.json new file mode 100644 index 00000000..4d85a5c0 --- /dev/null +++ b/test/fixtures/responses/get-transaction-payment-channel-create-with-memo.json @@ -0,0 +1,44 @@ +{ + "type": "paymentChannelCreate", + "address": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "sequence": 113, + "id": "0E9CA3AB1053FC0C1CBAA75F636FE1EC92F118C7056BBEF5D63E4C116458A161", + "specification": { + "amount": "1", + "destination": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "sourceTag": 3444675312, + "publicKey": "EDE059A23CBE00BDD465910EBDA67C86BAD046FA52E1BBBB27159E31980BAFEFB9", + "settleDelay": 90000, + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2017-03-09T14:09:50.000Z", + "fee": "0.000012", + "balanceChanges": { + "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK": [ + { + "currency": "XRP", + "value": "-1.000012" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 786309, + "indexInLedger": 0, + "channelChanges": { + "status": "created", + "channelId": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "source": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "destination": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "channelAmountDrops": "1000000", + "channelBalanceDrops": "0" + } + } +} diff --git a/test/fixtures/responses/get-transaction-payment-channel-fund-with-memo.json b/test/fixtures/responses/get-transaction-payment-channel-fund-with-memo.json new file mode 100644 index 00000000..41d3fd9f --- /dev/null +++ b/test/fixtures/responses/get-transaction-payment-channel-fund-with-memo.json @@ -0,0 +1,43 @@ +{ + "type": "paymentChannelFund", + "address": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "sequence": 114, + "id": "CD053D8867007A6A4ACB7A432605FE476D088DCB515AFFC886CF2B4EB6D2AE81", + "specification": { + "channel": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "amount": "1", + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ] + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2017-03-09T14:09:51.000Z", + "fee": "0.000012", + "balanceChanges": { + "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK": [ + { + "currency": "XRP", + "value": "-1.000012" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 786310, + "indexInLedger": 1, + "channelChanges": { + "status": "modified", + "channelId": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "source": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "destination": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "channelAmountChangeDrops": "1000000", + "channelAmountDrops": "2000000", + "channelBalanceDrops": "801000", + "previousTxnId": "81B9ECAE7195EB6E8034AEDF44D8415A7A803E14513FDBB34FA984AB37D59563" + } + } +} diff --git a/test/fixtures/responses/get-transaction-ticket-create-with-memo.json b/test/fixtures/responses/get-transaction-ticket-create-with-memo.json new file mode 100644 index 00000000..ddac0256 --- /dev/null +++ b/test/fixtures/responses/get-transaction-ticket-create-with-memo.json @@ -0,0 +1,32 @@ +{ + "type": "ticketCreate", + "address": "rwkQ24BPfW7gT4PGm9Pq884v4N9S2Mhcc1", + "sequence": 6860086, + "id": "1797BD0898F54F0732D2FFFF715A75CC1C50D1883A875A7B9BFD0F6936461359", + "specification": { + "memos": [ + { + "type": "test", + "format": "text/plain", + "data": "texted data" + } + ], + "ticketCount": 1 + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2018-02-23T22:20:01.000Z", + "fee": "0.000012", + "balanceChanges": { + "rwkQ24BPfW7gT4PGm9Pq884v4N9S2Mhcc1": [ + { + "currency": "XRP", + "value": "-0.000012" + } + ] + }, + "orderbookChanges": {}, + "ledgerVersion": 6860132, + "indexInLedger": 0 + } +} diff --git a/test/fixtures/responses/get-transaction-with-memo.json b/test/fixtures/responses/get-transaction-with-memo.json new file mode 100644 index 00000000..8dcf2242 --- /dev/null +++ b/test/fixtures/responses/get-transaction-with-memo.json @@ -0,0 +1,74 @@ +{ + "type": "order", + "address": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "sequence": 61349002, + "id": "995570FE1E40F42DF56BFC80503BA9E3C1229619C61A1C279A76BC0805036D74", + "specification": { + "memos": [ + { + "type": "687474703a2f2f6578616d706c652e636f6d2f6d656d6f2f67656e65726963", + "data": "72656e74" + } + ], + "direction": "buy", + "quantity": { + "currency": "NRD", + "value": "0.1", + "counterparty": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R" + }, + "totalPrice": { + "currency": "XRP", + "value": "1" + } + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2015-07-29T12:33:30.000Z", + "fee": "0", + "balanceChanges": { + "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R": [ + { + "currency": "XRP", + "value": "0.01" + }, + { + "counterparty": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "currency": "NRD", + "value": "-0.1" + } + ], + "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH": [ + { + "counterparty": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "currency": "NRD", + "value": "0.1" + }, + { + "currency": "XRP", + "value": "-0.010012" + } + ] + }, + "orderbookChanges": { + "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R": [ + { + "direction": "sell", + "quantity": { + "currency": "NRD", + "counterparty": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "0.1" + }, + "totalPrice": { + "currency": "XRP", + "value": "0.01" + }, + "sequence": 61350140, + "status": "partially-filled", + "makerExchangeRate": "0.1" + } + ] + }, + "ledgerVersion": 3717633, + "indexInLedger": 3 + } +} diff --git a/test/fixtures/responses/get-transaction-with-memos.json b/test/fixtures/responses/get-transaction-with-memos.json new file mode 100644 index 00000000..fe974906 --- /dev/null +++ b/test/fixtures/responses/get-transaction-with-memos.json @@ -0,0 +1,78 @@ +{ + "type": "order", + "address": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "sequence": 61349002, + "id": "995570FE1E40F42DF56BFC80503BA9E3C1229619C61A1C279A76BC0805036D73", + "specification": { + "memos": [ + { + "type": "687474703a2f2f6578616d706c652e636f6d2f6d656d6f2f67656e65726963", + "data": "72656e74" + }, + { + "type": "687474703a2f2f6578616d706c652e636f6d2f6d656d6f2f67656e65726963", + "data": "72656e74" + } + ], + "direction": "buy", + "quantity": { + "currency": "NRD", + "value": "0.1", + "counterparty": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R" + }, + "totalPrice": { + "currency": "XRP", + "value": "1" + } + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2015-07-29T12:33:30.000Z", + "fee": "0", + "balanceChanges": { + "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R": [ + { + "currency": "XRP", + "value": "0.01" + }, + { + "counterparty": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "currency": "NRD", + "value": "-0.1" + } + ], + "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH": [ + { + "counterparty": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "currency": "NRD", + "value": "0.1" + }, + { + "currency": "XRP", + "value": "-0.010012" + } + ] + }, + "orderbookChanges": { + "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R": [ + { + "direction": "sell", + "quantity": { + "currency": "NRD", + "counterparty": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "0.1" + }, + "totalPrice": { + "currency": "XRP", + "value": "0.01" + }, + "sequence": 61350140, + "status": "partially-filled", + "makerExchangeRate": "0.1" + } + ] + }, + "ledgerVersion": 3717633, + "indexInLedger": 3 + } +} diff --git a/test/fixtures/responses/get-transactions-with-memos.json b/test/fixtures/responses/get-transactions-with-memos.json new file mode 100644 index 00000000..a6bf14ef --- /dev/null +++ b/test/fixtures/responses/get-transactions-with-memos.json @@ -0,0 +1,190 @@ +[ + { + "type": "payment", + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "sequence": 4, + "id": "99404A34E8170319521223A6C604AF48B9F1E3000C377E6141F9A1BF60B0B865", + "specification": { + "memos": [ + { + "type": "client", + "format": "rt1.5.2" + } + ], + "source": { + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "maxAmount": { + "currency": "XRP", + "value": "1.112209" + } + }, + "destination": { + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "paths": "[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]]" + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2019-04-01T07:39:01.000Z", + "fee": "0.00001", + "deliveredAmount": { + "currency": "USD", + "value": "0.001", + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "balanceChanges": { + "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo": [ + { + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", + "currency": "USD", + "value": "-0.001" + }, + { + "counterparty": "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr", + "currency": "USD", + "value": "0.001002" + } + ], + "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM": [ + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "0.001" + } + ], + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "currency": "XRP", + "value": "-1.101208" + } + ], + "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr": [ + { + "currency": "XRP", + "value": "1.101198" + }, + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "-0.001002" + } + ] + }, + "orderbookChanges": { + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "direction": "buy", + "quantity": { + "currency": "XRP", + "value": "1.101198" + }, + "totalPrice": { + "currency": "USD", + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "value": "0.001002" + }, + "makerExchangeRate": "1099", + "sequence": 58, + "status": "partially-filled" + } + ] + }, + "ledgerVersion": 348859, + "indexInLedger": 0 + } + }, + { + "type": "payment", + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "id": "99404A34E8170319521223A6C604AF48B9F1E3000C377E6141F9A1BF60B0B865", + "sequence": 4, + "specification": { + "memos": [ + { + "type": "client", + "format": "rt1.5.2" + } + ], + "source": { + "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "maxAmount": { + "currency": "XRP", + "value": "1.112209" + } + }, + "destination": { + "address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "paths": "[[{\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"},{\"account\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"issuer\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"currency\":\"USD\"}]]" + }, + "outcome": { + "result": "tesSUCCESS", + "timestamp": "2019-04-01T07:39:01.000Z", + "fee": "0.00001", + "deliveredAmount": { + "currency": "USD", + "value": "0.001", + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM" + }, + "balanceChanges": { + "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo": [ + { + "counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM", + "currency": "USD", + "value": "-0.001" + }, + { + "counterparty": "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr", + "currency": "USD", + "value": "0.001002" + } + ], + "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM": [ + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "0.001" + } + ], + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "currency": "XRP", + "value": "-1.101208" + } + ], + "r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr": [ + { + "currency": "XRP", + "value": "1.101198" + }, + { + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "currency": "USD", + "value": "-0.001002" + } + ] + }, + "orderbookChanges": { + "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59": [ + { + "direction": "buy", + "quantity": { + "currency": "XRP", + "value": "1.101198" + }, + "totalPrice": { + "currency": "USD", + "counterparty": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo", + "value": "0.001002" + }, + "makerExchangeRate": "1099", + "sequence": 58, + "status": "partially-filled" + } + ] + }, + "ledgerVersion": 348858, + "indexInLedger": 0 + } + } +] diff --git a/test/fixtures/responses/index.js b/test/fixtures/responses/index.js index f5577a27..2a173efc 100644 --- a/test/fixtures/responses/index.js +++ b/test/fixtures/responses/index.js @@ -30,9 +30,11 @@ module.exports = { getSettings: require('./get-settings.json'), getTransaction: { orderCancellation: require('./get-transaction-order-cancellation.json'), + orderCancellationWithMemo: require('./get-transaction-order-cancellation-with-memo.json'), orderWithExpirationCancellation: require('./get-transaction-order-with-expiration-cancellation.json'), order: require('./get-transaction-order.json'), + orderWithMemo: require('./get-transaction-order-with-memo.json'), orderSell: require('./get-transaction-order-sell.json'), noMeta: require('./get-transaction-no-meta.json'), payment: require('./get-transaction-payment.json'), @@ -48,10 +50,18 @@ module.exports = { notValidated: require('./get-transaction-not-validated.json'), checkCreate: require('./get-transaction-check-create.json'), + checkCreateWithMemo: + require('./get-transaction-check-create-with-memo.json'), checkCancel: require('./get-transaction-check-cancel.json'), + checkCancelWithMemo: + require('./get-transaction-check-cancel-with-memo.json'), checkCash: require('./get-transaction-check-cash.json'), + checkCashWithMemo: + require('./get-transaction-check-cash-with-memo.json'), + depositPreauthWithMemo: + require('./get-transaction-deposit-preauth-with-memo.json'), escrowCreation: require('./get-transaction-escrow-creation.json'), escrowCancellation: @@ -62,13 +72,24 @@ module.exports = { require('./get-transaction-escrow-execution-simple.json'), paymentChannelCreate: require('./get-transaction-payment-channel-create.json'), + paymentChannelCreateWithMemo: + require('./get-transaction-payment-channel-create-with-memo.json'), paymentChannelFund: require('./get-transaction-payment-channel-fund.json'), + paymentChannelFundWithMemo: + require('./get-transaction-payment-channel-fund-with-memo.json'), paymentChannelClaim: require('./get-transaction-payment-channel-claim.json'), + paymentChannelClaimWithMemo: + require('./get-transaction-payment-channel-claim-with-memo.json'), amendment: require('./get-transaction-amendment.json'), feeUpdate: require('./get-transaction-fee-update.json'), - accountDelete: require('./get-transaction-account-delete.json') + feeUpdateWithMemo: require('./get-transaction-fee-update-with-memo.json'), + accountDelete: require('./get-transaction-account-delete.json'), + accountDeleteWithMemo: require('./get-transaction-account-delete-with-memo.json'), + ticketCreateWithMemo: require('./get-transaction-ticket-create-with-memo.json'), + withMemo: require('./get-transaction-with-memo.json'), + withMemos: require('./get-transaction-with-memos.json') }, getTransactions: { normal: require('./get-transactions.json'), diff --git a/test/fixtures/rippled/index.js b/test/fixtures/rippled/index.js index f3dd44e3..e2f53a65 100644 --- a/test/fixtures/rippled/index.js +++ b/test/fixtures/rippled/index.js @@ -71,8 +71,10 @@ module.exports = { AccountSetTrackingOff: require('./tx/account-set-tracking-off.json'), RegularKey: require('./tx/set-regular-key.json'), OfferCreate: require('./tx/offer-create.json'), + OfferCreateWithMemo: require('./tx/offer-create-with-memo.json'), OfferCreateSell: require('./tx/offer-create-sell.json'), OfferCancel: require('./tx/offer-cancel.json'), + OfferCancelWithMemo: require('./tx/offer-cancel-with-memo.json'), TrustSet: require('./tx/trust-set.json'), TrustSetFrozenOff: require('./tx/trust-set-frozen-off.json'), TrustSetNoQuality: require('./tx/trust-set-no-quality.json'), @@ -84,8 +86,11 @@ module.exports = { NotValidated: require('./tx/not-validated.json'), OfferWithExpiration: require('./tx/order-with-expiration.json'), CheckCreate: require('./tx/check-create.json'), + CheckCreateWithMemo: require('./tx/check-create-with-memo.json'), CheckCancel: require('./tx/check-cancel.json'), + CheckCancelWithMemo: require('./tx/check-cancel-with-memo.json'), CheckCash: require('./tx/check-cash.json'), + CheckCashWithMemo: require('./tx/check-cash-with-memo.json'), EscrowCreation: require('./tx/escrow-creation.json'), EscrowCancellation: require('./tx/escrow-cancellation.json'), @@ -93,13 +98,22 @@ module.exports = { EscrowExecutionSimple: require('./tx/escrow-execution-simple.json'), PaymentChannelCreate: require('./tx/payment-channel-create.json'), + PaymentChannelCreateWithMemo: require('./tx/payment-channel-create-with-memo.json'), PaymentChannelFund: require('./tx/payment-channel-fund.json'), + PaymentChannelFundWithMemo: require('./tx/payment-channel-fund-with-memo.json'), PaymentChannelClaim: require('./tx/payment-channel-claim.json'), + PaymentChannelClaimWithMemo: require('./tx/payment-channel-claim-with-memo.json'), Unrecognized: require('./tx/unrecognized.json'), NoMeta: require('./tx/no-meta.json'), LedgerZero: require('./tx/ledger-zero.json'), Amendment: require('./tx/amendment.json'), SetFee: require('./tx/set-fee.json'), - AccountDelete: require('./tx/account-delete.json') + SetFeeWithMemo: require('./tx/set-fee-with-memo.json'), + TicketCreateWithMemo: require('./tx/ticket-create-with-memo.json'), + DepositPreauthWithMemo: require('./tx/deposit-preauth-with-memo.json'), + AccountDelete: require('./tx/account-delete.json'), + AccountDeleteWithMemo: require('./tx/account-delete-with-memo.json'), + WithMemo: require('./tx/with-memo.json'), + WithMemos: require('./tx/with-memos.json') } }; diff --git a/test/fixtures/rippled/tx/account-delete-with-memo.json b/test/fixtures/rippled/tx/account-delete-with-memo.json new file mode 100644 index 00000000..c0bb662b --- /dev/null +++ b/test/fixtures/rippled/tx/account-delete-with-memo.json @@ -0,0 +1,74 @@ +{ + "id": 0, + "result": { + "Account": "rPMMnbyptUziwr4eWAUQ3UHycaiNKZTJWd", + "Destination": "rErhTv3pwYAgsERLfhtWeE33wAHtDRuUwK", + "Fee": "5000000", + "Flags": 2147483648, + "LastLedgerSequence": 16430633, + "hash": "BB1F552C57880F636FE8A88C041DEBAE96B428074CB4AB7DF489181F512B9FC3", + "ledger_index": 16430632, + "date": 629889411, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "Sequence": 16427655, + "SigningPubKey": "027E10EC4D59028DEAE00BA4CE54895BDA2BF3D23F96B30A650512145BE7DE8C38", + "TransactionType": "AccountDelete", + "TxnSignature": "3045022100F426442DC86D2CA02B7DA658BDD342F23137BD8B5EF4399C064B59ED7237597F022030B10DBE65BCD91558362E4781F6A0B57AA634DE574CA74ACAD469D2108B75FC", + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rErhTv3pwYAgsERLfhtWeE33wAHtDRuUwK", + "Balance": "2989999952", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 16425892 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "9F847A13E185EC7875B4F3A13657C05C69FB5D27E21138AA41F127BD80DCC1BD", + "PreviousFields": { + "Balance": "1995019976" + }, + "PreviousTxnID": "1A4414207E27EAC54B10B6AA9930C5F1E87154CD7898DDAB281AA05BD4E2D7ED", + "PreviousTxnLgrSeq": 16430363 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rPMMnbyptUziwr4eWAUQ3UHycaiNKZTJWd", + "Balance": "0", + "Flags": 0, + "OwnerCount": 0, + "PreviousTxnID": "1A4414207E27EAC54B10B6AA9930C5F1E87154CD7898DDAB281AA05BD4E2D7ED", + "PreviousTxnLgrSeq": 16430363, + "Sequence": 16427656 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "D1B3E36FB851D050DEE28F2B527BAE6F8D31486DAEA043C202F1551C39A9A5BA", + "PreviousFields": { + "Balance": "999979976", + "Sequence": 16427655 + } + } + } + ], + "DeliveredAmount": "994979976", + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "994979976" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/check-cancel-with-memo.json b/test/fixtures/rippled/tx/check-cancel-with-memo.json new file mode 100644 index 00000000..6506a3f0 --- /dev/null +++ b/test/fixtures/rippled/tx/check-cancel-with-memo.json @@ -0,0 +1,98 @@ +{ + "id": 0, + "result": { + "Account": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "CheckID": "6EE1727598693635183A3D967342A46C739FC06F973CA6A3277A92E8D997E7A8", + "Fee": "12", + "Flags": 2147483648, + "LastLedgerSequence": 6968242, + "Sequence": 6, + "SigningPubKey": "03C1B24925182F5B881D34E07993FAAD90B918EF3D6661963A3E9EE402B6F87659", + "TransactionType": "CheckCancel", + "TxnSignature": "3045022100B3BC49F917E408DB5FFE1570CDE69E28AA4BD99AABAC7043EE71BDC346BF76F902200F8E4E059B1AF33BBD595CEDB86A556C40E40ADFB86F1B4451F447E88DD01A0B", + "date": 572741141, + "hash": "B4105D1B2D83819647E4692B7C5843D674283F669524BD50C9614182E3A12CD4", + "inLedger": 6967970, + "ledger_index": 6967970, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "RootIndex": "46B6FD7D2C937D6A5D2832CAC94F424300B3FE72B5D1D460C20E6FADAD2FF7C7" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "46B6FD7D2C937D6A5D2832CAC94F424300B3FE72B5D1D460C20E6FADAD2FF7C7" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "Destination": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "DestinationNode": "0000000000000000", + "DestinationTag": 1236, + "Expiration": 572908967, + "Flags": 0, + "InvoiceID": "DEADBEEF3FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B", + "OwnerNode": "0000000000000000", + "PreviousTxnID": "FCE773D30272546ADD1ADF1763AE8C69B857C7AD0B4A13B9B524991D5611740E", + "PreviousTxnLgrSeq": 6967917, + "SendMax": "4000000", + "Sequence": 5 + }, + "LedgerEntryType": "Check", + "LedgerIndex": "6EE1727598693635183A3D967342A46C739FC06F973CA6A3277A92E8D997E7A8" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "Balance": "9996499928", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 7 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "8FD7FBA4C35956B4964015D938AD50A939458E8CD13FA24A58F40A07ABE47E52", + "PreviousFields": { + "Balance": "9996499940", + "OwnerCount": 1, + "Sequence": 6 + }, + "PreviousTxnID": "FCE773D30272546ADD1ADF1763AE8C69B857C7AD0B4A13B9B524991D5611740E", + "PreviousTxnLgrSeq": 6967917 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "RootIndex": "A33DF86647D19B7868A6FAD1E65F753837F8CFEF8F1C4F34717FD5CC7E6EA2E3" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "A33DF86647D19B7868A6FAD1E65F753837F8CFEF8F1C4F34717FD5CC7E6EA2E3" + } + } + ], + "TransactionIndex": 4, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/check-cash-with-memo.json b/test/fixtures/rippled/tx/check-cash-with-memo.json new file mode 100644 index 00000000..9d3dc44a --- /dev/null +++ b/test/fixtures/rippled/tx/check-cash-with-memo.json @@ -0,0 +1,117 @@ +{ + "id": 0, + "result": { + "Account": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "Amount": "2500000", + "CheckID": "4F6DDA7972A5E8C8F2AA3D2A475E56475FA573C65B935E26EABDA5F06A982C70", + "Fee": "12", + "Flags": 2147483648, + "LastLedgerSequence": 6967889, + "Sequence": 3, + "SigningPubKey": "02ACB1C22D68E01414D2F527B4666E119F36E5B996D1CE6C8DBDE03769E5B2B95B", + "TransactionType": "CheckCash", + "TxnSignature": "304402205CA374B304F5D595E930489D70D5EDD062142D6D231D55AC0123F2AA02C8F10202206B5B9AA6A8560382053FF628662D42E74BB79B84B4A507719180823A720A261F", + "date": 572740012, + "hash": "8321208465F70BA52C28BCC4F646BAF3B012BA13B57576C0336F42D77E3E0749", + "inLedger": 6967596, + "ledger_index": 6967596, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "Balance": "10003499964", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 4 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "1F5CCAAAAE908C0F449ADB267084DFFD3E4432921E64A020EEBC59D95BD4940A", + "PreviousFields": { + "Balance": "10000999976", + "Sequence": 3 + }, + "PreviousTxnID": "7D1400825FD25D17B0283B71B0CC2ACC921F32D057B66BB7331F1B43483BC3DA", + "PreviousTxnLgrSeq": 6967427 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "RootIndex": "46B6FD7D2C937D6A5D2832CAC94F424300B3FE72B5D1D460C20E6FADAD2FF7C7" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "46B6FD7D2C937D6A5D2832CAC94F424300B3FE72B5D1D460C20E6FADAD2FF7C7" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "Destination": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "DestinationNode": "0000000000000000", + "DestinationTag": 1235, + "Expiration": 572908967, + "Flags": 0, + "InvoiceID": "DEADBEEF2FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B", + "OwnerNode": "0000000000000000", + "PreviousTxnID": "605A2E2C8E48AECAF5C56085D1AEAA0348DC838CE122C9188F94EB19DA05C2FE", + "PreviousTxnLgrSeq": 6967458, + "SendMax": "3000000", + "Sequence": 3 + }, + "LedgerEntryType": "Check", + "LedgerIndex": "4F6DDA7972A5E8C8F2AA3D2A475E56475FA573C65B935E26EABDA5F06A982C70" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "Balance": "9996499952", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "8FD7FBA4C35956B4964015D938AD50A939458E8CD13FA24A58F40A07ABE47E52", + "PreviousFields": { + "Balance": "9998999952", + "OwnerCount": 1 + }, + "PreviousTxnID": "4FE09BCC476230E75A45014CD8F77E91C7FF95C07BB8E55923EB55741911C85D", + "PreviousTxnLgrSeq": 6967586 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "RootIndex": "A33DF86647D19B7868A6FAD1E65F753837F8CFEF8F1C4F34717FD5CC7E6EA2E3" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "A33DF86647D19B7868A6FAD1E65F753837F8CFEF8F1C4F34717FD5CC7E6EA2E3" + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/check-create-with-memo.json b/test/fixtures/rippled/tx/check-create-with-memo.json new file mode 100644 index 00000000..bb03cf65 --- /dev/null +++ b/test/fixtures/rippled/tx/check-create-with-memo.json @@ -0,0 +1,97 @@ +{ + "id": 0, + "result": { + "Account": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "Destination": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "DestinationTag": 1235, + "Expiration": 572908967, + "Fee": "12", + "Flags": 2147483648, + "InvoiceID": "DEADBEEF2FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B", + "LastLedgerSequence": 6967747, + "SendMax": "3000000", + "Sequence": 3, + "SigningPubKey": "03C1B24925182F5B881D34E07993FAAD90B918EF3D6661963A3E9EE402B6F87659", + "TransactionType": "CheckCreate", + "TxnSignature": "3044022058FD0FBB7486D84DBEFE6C10BE0D43C3344E6B175BED19C1FF514C379A4FB344022021DE0087152FCDD6EB7ED14E057BBA94CAF70B920AA79CB82AAD4B82E7AFF760", + "date": 572739601, + "hash": "605A2E2C8E48AECAF5C56085D1AEAA0348DC838CE122C9188F94EB19DA05C2FE", + "inLedger": 6967458, + "ledger_index": 6967458, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "RootIndex": "46B6FD7D2C937D6A5D2832CAC94F424300B3FE72B5D1D460C20E6FADAD2FF7C7" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "46B6FD7D2C937D6A5D2832CAC94F424300B3FE72B5D1D460C20E6FADAD2FF7C7" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Check", + "LedgerIndex": "4F6DDA7972A5E8C8F2AA3D2A475E56475FA573C65B935E26EABDA5F06A982C70", + "NewFields": { + "Account": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "Destination": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "DestinationTag": 1235, + "Expiration": 572908967, + "InvoiceID": "DEADBEEF2FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B", + "SendMax": "3000000", + "Sequence": 3 + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rNpdNFXNMvEcaXDqMypi48gdSABZkYuyQE", + "Balance": "9998999964", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 4 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "8FD7FBA4C35956B4964015D938AD50A939458E8CD13FA24A58F40A07ABE47E52", + "PreviousFields": { + "Balance": "9998999976", + "OwnerCount": 0, + "Sequence": 3 + }, + "PreviousTxnID": "7D1400825FD25D17B0283B71B0CC2ACC921F32D057B66BB7331F1B43483BC3DA", + "PreviousTxnLgrSeq": 6967427 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "raLHvSZXacoGiCoWrdBhVGstZm6GhF7oRr", + "RootIndex": "A33DF86647D19B7868A6FAD1E65F753837F8CFEF8F1C4F34717FD5CC7E6EA2E3" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "A33DF86647D19B7868A6FAD1E65F753837F8CFEF8F1C4F34717FD5CC7E6EA2E3" + } + } + ], + "TransactionIndex": 1, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/deposit-preauth-with-memo.json b/test/fixtures/rippled/tx/deposit-preauth-with-memo.json new file mode 100644 index 00000000..de93c596 --- /dev/null +++ b/test/fixtures/rippled/tx/deposit-preauth-with-memo.json @@ -0,0 +1,75 @@ +{ + "id": 0, + "result": { + "Account": "rH8AzLerezBnkuM7reZfrQ513nRvKjDrnx", + "Authorize": "rErhTv3pwYAgsERLfhtWeE33wAHtDRuUwK", + "Fee": "12", + "Flags": 2147483648, + "LastLedgerSequence": 16433988, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "Sequence": 16433982, + "SigningPubKey": "03283FCB84B7F6FD8850EB7F81BE5434664EE6B42EFF32E5AE76EED4BD87F30D23", + "TransactionType": "DepositPreauth", + "hash": "3BA61A2621C09A119A12EA9271AE5FA165B6E39657E02BFD3C5B21E28F72B883", + "ledger_index": 16433986, + "TxnSignature": "30440220366BB53FAD33244F2B4B4EE662C95792278E18FEB3B8ED89E18F3AC255CF7C8202204B7D3D5D583E896F375BBBD392B505DDCF7AEF6F3782AB545B0F283028FE5B92", + "date": 572739601, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rH8AzLerezBnkuM7reZfrQ513nRvKjDrnx", + "Balance": "999999988", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 16433983 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "5FF7DCF66453BCFEF8595FB929783EBE8A86571FBB4BE2F103A50334A2E9A2A5", + "PreviousFields": { + "Balance": "1000000000", + "OwnerCount": 0, + "Sequence": 16433982 + }, + "PreviousTxnID": "C40F81BF959F817399E0D4C5103204688055D0183F5D530B0CA672A325E7282E", + "PreviousTxnLgrSeq": 16433982 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "984CD3B68FA7716C44072AA8565DB3062AB5C302D518CCF3AC91E3EED06AA0B7", + "NewFields": { + "Owner": "rH8AzLerezBnkuM7reZfrQ513nRvKjDrnx", + "RootIndex": "984CD3B68FA7716C44072AA8565DB3062AB5C302D518CCF3AC91E3EED06AA0B7" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DepositPreauth", + "LedgerIndex": "E9DB9D76B046964BF2070923925AFF430D3B3A7EB174D66399990FD70473AADA", + "NewFields": { + "Account": "rH8AzLerezBnkuM7reZfrQ513nRvKjDrnx", + "Authorize": "rErhTv3pwYAgsERLfhtWeE33wAHtDRuUwK" + } + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/offer-cancel-with-memo.json b/test/fixtures/rippled/tx/offer-cancel-with-memo.json new file mode 100644 index 00000000..26e226f9 --- /dev/null +++ b/test/fixtures/rippled/tx/offer-cancel-with-memo.json @@ -0,0 +1,104 @@ +{ + "id": 0, + "status": "success", + "type": "response", + "result": { + "TransactionType": "OfferCancel", + "Flags": 0, + "Sequence": 466, + "OfferSequence": 465, + "LastLedgerSequence": 14661888, + "Fee": "12000", + "SigningPubKey": "036A749E3B7187E43E8936E3D83A7030989325249E03803F12B7F64BAACABA6025", + "TxnSignature": "3045022100E4148E9809C5CE13BC5583E8CA665614D9FF02D6589D13BA7FBB67CF45EAC0BF02201B84DC18A921260BCEE685908260888BC20D4375DB4A8702F25B346CAD7F3387", + "Account": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b", + "hash": "447D52F132DB6B5EFB828D67E4D746B5A580FC37A61077A17920BFFFC86D05D1", + "ledger_index": 14661789, + "inLedger": 14661789, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "TransactionIndex": 4, + "AffectedNodes": [ + { + "ModifiedNode": { + "LedgerEntryType": "AccountRoot", + "PreviousTxnLgrSeq": 14661788, + "PreviousTxnID": "5D9B0B246255815B63983C188B4C23325B3544F605CDBE3004769EE9E990D2F2", + "LedgerIndex": "4AD70690C6FF8A069F8AE00B09F70E9B732360026E8085050D314432091A59C9", + "PreviousFields": { + "Sequence": 466, + "OwnerCount": 4, + "Balance": "71827095" + }, + "FinalFields": { + "Flags": 0, + "Sequence": 467, + "OwnerCount": 3, + "Balance": "71815095", + "Domain": "726970706C652E636F6D", + "Account": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b" + } + } + }, + { + "ModifiedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "6FCB8B0AF9F22ACF762B7712BF44C6CF172FD2BECD849509604EB7DB3AD2C250", + "FinalFields": { + "Flags": 0, + "RootIndex": "6FCB8B0AF9F22ACF762B7712BF44C6CF172FD2BECD849509604EB7DB3AD2C250", + "Owner": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b" + } + } + }, + { + "DeletedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CF8D13399C6ED20BA82740CFA78E928DC8D498255249BA63550435C0500F1000", + "FinalFields": { + "Flags": 0, + "ExchangeRate": "550435C0500F1000", + "RootIndex": "CF8D13399C6ED20BA82740CFA78E928DC8D498255249BA63550435C0500F1000", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "DD39C650A96EDA48334E70CC4A85B8B2E8502CD3", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000" + } + } + }, + { + "DeletedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "D0BEA7E310CDCEED282911314B0D6D00BB7E3B985EAA275AE2AC2DE3763AAF0C", + "FinalFields": { + "Flags": 0, + "Sequence": 465, + "PreviousTxnLgrSeq": 14661788, + "BookNode": "0000000000000000", + "OwnerNode": "0000000000000000", + "PreviousTxnID": "5D9B0B246255815B63983C188B4C23325B3544F605CDBE3004769EE9E990D2F2", + "BookDirectory": "CF8D13399C6ED20BA82740CFA78E928DC8D498255249BA63550435C0500F1000", + "TakerPays": { + "value": "237", + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q" + }, + "TakerGets": "200", + "Account": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b" + } + } + } + ], + "TransactionResult": "tesSUCCESS" + }, + "validated": true + } +} diff --git a/test/fixtures/rippled/tx/offer-create-with-memo.json b/test/fixtures/rippled/tx/offer-create-with-memo.json new file mode 100644 index 00000000..3da08d4d --- /dev/null +++ b/test/fixtures/rippled/tx/offer-create-with-memo.json @@ -0,0 +1,101 @@ +{ + "id": 0, + "status": "success", + "type": "response", + "result": { + "TransactionType": "OfferCreate", + "Flags": 0, + "Sequence": 465, + "LastLedgerSequence": 14661886, + "TakerPays": { + "value": "237", + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q" + }, + "TakerGets": "200", + "Fee": "12000", + "SigningPubKey": "036A749E3B7187E43E8936E3D83A7030989325249E03803F12B7F64BAACABA6025", + "TxnSignature": "3045022100FA4CBD0A54A38906F8D4C18FBA4DBCE45B98F9C5A33BC9102CB5911E9E20E88F022032C47AC74E60042FF1517C866680A41B396D61146FBA9E60B4CF74E373CA7AD2", + "Account": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b", + "hash": "5D9B0B246255815B63983C188B4C23325B3544F605CDBE3004769EE9E990D2F1", + "ledger_index": 14661788, + "inLedger": 14661788, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "TransactionIndex": 2, + "AffectedNodes": [ + { + "ModifiedNode": { + "LedgerEntryType": "AccountRoot", + "PreviousTxnLgrSeq": 14660978, + "PreviousTxnID": "566D4DE22972C5BAD2506CFFA928B21D2BD33FA52FE16712D17D727681FAA4B1", + "LedgerIndex": "4AD70690C6FF8A069F8AE00B09F70E9B732360026E8085050D314432091A59C9", + "PreviousFields": { + "Sequence": 465, + "OwnerCount": 3, + "Balance": "71839095" + }, + "FinalFields": { + "Flags": 0, + "Sequence": 466, + "OwnerCount": 4, + "Balance": "71827095", + "Domain": "726970706C652E636F6D", + "Account": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b" + } + } + }, + { + "ModifiedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "6FCB8B0AF9F22ACF762B7712BF44C6CF172FD2BECD849509604EB7DB3AD2C250", + "FinalFields": { + "Flags": 0, + "RootIndex": "6FCB8B0AF9F22ACF762B7712BF44C6CF172FD2BECD849509604EB7DB3AD2C250", + "Owner": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CF8D13399C6ED20BA82740CFA78E928DC8D498255249BA63550435C0500F1000", + "NewFields": { + "ExchangeRate": "550435C0500F1000", + "RootIndex": "CF8D13399C6ED20BA82740CFA78E928DC8D498255249BA63550435C0500F1000", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "DD39C650A96EDA48334E70CC4A85B8B2E8502CD3" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "D0BEA7E310CDCEED282911314B0D6D00BB7E3B985EAA275AE2AC2DE3763AAF0C", + "NewFields": { + "Sequence": 465, + "BookDirectory": "CF8D13399C6ED20BA82740CFA78E928DC8D498255249BA63550435C0500F1000", + "TakerPays": { + "value": "237", + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q" + }, + "TakerGets": "200", + "Account": "r9UHu5CWni1qRY7Q4CfFZLGvXo2pGQy96b" + } + } + } + ], + "TransactionResult": "tesSUCCESS" + }, + "validated": true + } +} diff --git a/test/fixtures/rippled/tx/payment-channel-claim-with-memo.json b/test/fixtures/rippled/tx/payment-channel-claim-with-memo.json new file mode 100644 index 00000000..0f438bca --- /dev/null +++ b/test/fixtures/rippled/tx/payment-channel-claim-with-memo.json @@ -0,0 +1,79 @@ +{ + "result": { + "Account": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "Balance": "801000", + "Channel": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "Fee": "12", + "Flags": 2147483648, + "LastLedgerSequence": 786312, + "PublicKey": "EDE059A23CBE00BDD465910EBDA67C86BAD046FA52E1BBBB27159E31980BAFEFB9", + "Sequence": 99, + "Signature": "5567FB8A27D8BF0C556D3D31D034476FC04F43846A6613EB4B1B64C396C833600BE251CE3104CF02DA0085B473E02BA0BA21F794FB1DC95DAD702F3EA761CA02", + "SigningPubKey": "030697E72D738538BBE149CC3E85AA43FE836B5B34810F6370D6BB7D6D4938CEE6", + "TransactionType": "PaymentChannelClaim", + "TxnSignature": "3044022045EF38CCBE52D81D9A4060DD7203D626BC51B4779246FCFB71E4D0300D774DE002201A12A93081CF8539AF5EB4FB33F173729B499B5D5CD5EB66BD028A35F2ECAFEC", + "date": 542383791, + "hash": "81B9ECAE7195EB6E8034AEDF44D8415A7A803E14513FDBB34FA984AB37D59561", + "inLedger": 786310, + "ledger_index": 786310, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "Amount": "1000000", + "Balance": "801000", + "Destination": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "Flags": 0, + "OwnerNode": "0000000000000002", + "PublicKey": "EDE059A23CBE00BDD465910EBDA67C86BAD046FA52E1BBBB27159E31980BAFEFB9", + "SettleDelay": 90000, + "SourceTag": 3444675312 + }, + "LedgerEntryType": "PayChannel", + "LedgerIndex": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "PreviousFields": { + "Balance": "0" + }, + "PreviousTxnID": "0E9CA3AB1053FC0C1CBAA75F636FE1EC92F118C7056BBEF5D63E4C116458A16D", + "PreviousTxnLgrSeq": 786309 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "Balance": "9685416812", + "Flags": 0, + "OwnerCount": 81, + "Sequence": 100 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "659611ECC02612E5352D194628C2133D4983C4815B564F75722DA9327B6434D2", + "PreviousFields": { + "Balance": "9684615824", + "Sequence": 99 + }, + "PreviousTxnID": "9502119B8457ADF72DC137EB44DE897D7CD8583CE1C9541CA9A4FD27B4149FBD", + "PreviousTxnLgrSeq": 786309 + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/payment-channel-create-with-memo.json b/test/fixtures/rippled/tx/payment-channel-create-with-memo.json new file mode 100644 index 00000000..492dca18 --- /dev/null +++ b/test/fixtures/rippled/tx/payment-channel-create-with-memo.json @@ -0,0 +1,95 @@ +{ + "id": 0, + "result": { + "Account": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "Amount": "1000000", + "Destination": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "Fee": "12", + "Flags": 2147483648, + "LastLedgerSequence": 786310, + "PublicKey": "EDE059A23CBE00BDD465910EBDA67C86BAD046FA52E1BBBB27159E31980BAFEFB9", + "Sequence": 113, + "SettleDelay": 90000, + "SigningPubKey": "0243D321B6585B7F6EB5B6AEA6B98C5EAD6FE09C09F79722640029538F03F083E5", + "SourceTag": 3444675312, + "TransactionType": "PaymentChannelCreate", + "TxnSignature": "3045022100ECA04F35A18F74E24029060B51AC2AEEECCEB8663A3029DD2966E5F99CB8606F0220581CB2B7C5D8A32717991396B9FD77734CA47CF02654938F06509450B4772052", + "date": 542383790, + "hash": "0E9CA3AB1053FC0C1CBAA75F636FE1EC92F118C7056BBEF5D63E4C116458A161", + "inLedger": 786309, + "ledger_index": 786309, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "PayChannel", + "LedgerIndex": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "NewFields": { + "Account": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "Amount": "1000000", + "Destination": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "OwnerNode": "0000000000000002", + "PublicKey": "EDE059A23CBE00BDD465910EBDA67C86BAD046FA52E1BBBB27159E31980BAFEFB9", + "SettleDelay": 90000, + "SourceTag": 3444675312 + } + } + }, + { + "ModifiedNode": { + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "659611ECC02612E5352D194628C2133D4983C4815B564F75722DA9327B6434D2", + "PreviousTxnID": "450C1D132C21F3CED037F3442075AD0339B5A02EA8BC21D4DD6A13ED2C3A3DD6", + "PreviousTxnLgrSeq": 786294 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "Balance": "9583993644", + "Flags": 0, + "OwnerCount": 91, + "Sequence": 114 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C3C855510E420246A61813C11A999F1246AD3C11E1020AB097BE81877CEA159C", + "PreviousFields": { + "Balance": "9584993656", + "OwnerCount": 90, + "Sequence": 113 + }, + "PreviousTxnID": "450C1D132C21F3CED037F3442075AD0339B5A02EA8BC21D4DD6A13ED2C3A3DD6", + "PreviousTxnLgrSeq": 786294 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "0000000000000001", + "Owner": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "RootIndex": "E0E23E1C6AB66761C95738D50927A2B5C0EC62E78E58A591EF285219F9492F13" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "DFF52A9A7C30C3785111879DF606B254CB6E9FFA2271BFFA3406EE2A65929D67" + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/payment-channel-fund-with-memo.json b/test/fixtures/rippled/tx/payment-channel-fund-with-memo.json new file mode 100644 index 00000000..69a046ca --- /dev/null +++ b/test/fixtures/rippled/tx/payment-channel-fund-with-memo.json @@ -0,0 +1,78 @@ +{ + "id": 0, + "result": { + "Account": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "Amount": "1000000", + "Channel": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "Fee": "12", + "Flags": 2147483648, + "LastLedgerSequence": 786312, + "Sequence": 114, + "SigningPubKey": "0243D321B6585B7F6EB5B6AEA6B98C5EAD6FE09C09F79722640029538F03F083E5", + "TransactionType": "PaymentChannelFund", + "TxnSignature": "304402203F4D2DD537C4EF4CDC2C525190698715A2188733681DB6205C9A6FCBEA3C89E202202526B40DCC025B5D12CD82789D4E37FB16918FFA94CF91113CFD9ADCF9D185A1", + "date": 542383791, + "hash": "CD053D8867007A6A4ACB7A432605FE476D088DCB515AFFC886CF2B4EB6D2AE81", + "inLedger": 786310, + "ledger_index": 786310, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "Amount": "2000000", + "Balance": "801000", + "Destination": "rBmNDZ7vbTCwakKXsX3pDAwDdQuxM7yBRa", + "Flags": 0, + "OwnerNode": "0000000000000002", + "PublicKey": "EDE059A23CBE00BDD465910EBDA67C86BAD046FA52E1BBBB27159E31980BAFEFB9", + "SettleDelay": 90000, + "SourceTag": 3444675312 + }, + "LedgerEntryType": "PayChannel", + "LedgerIndex": "43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1", + "PreviousFields": { + "Amount": "1000000" + }, + "PreviousTxnID": "81B9ECAE7195EB6E8034AEDF44D8415A7A803E14513FDBB34FA984AB37D59563", + "PreviousTxnLgrSeq": 786310 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfAuMkVuZQnQhvdMcUKg4ndBb9SPDhzNmK", + "Balance": "9582993632", + "Flags": 0, + "OwnerCount": 91, + "Sequence": 115 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C3C855510E420246A61813C11A999F1246AD3C11E1020AB097BE81877CEA159C", + "PreviousFields": { + "Balance": "9583993644", + "Sequence": 114 + }, + "PreviousTxnID": "9502119B8457ADF72DC137EB44DE897D7CD8583CE1C9541CA9A4FD27B4149FBD", + "PreviousTxnLgrSeq": 786309 + } + } + ], + "TransactionIndex": 1, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/set-fee-with-memo.json b/test/fixtures/rippled/tx/set-fee-with-memo.json new file mode 100644 index 00000000..7006092d --- /dev/null +++ b/test/fixtures/rippled/tx/set-fee-with-memo.json @@ -0,0 +1,52 @@ +{ + "id": 0, + "status": "success", + "type": "response", + "result": { + "hash": "C6A40F56127436DCD830B1B35FF939FD05B5747D30D6542572B7A835239817A1", + "ledger_index": 3717633, + "date": 460832270, + "TransactionType": "SetFee", + "Sequence": 0, + "ReferenceFeeUnits": 10, + "ReserveBase": 50000000, + "ReserveIncrement": 12500000, + "BaseFee": "000000000000000A", + "Fee": "0", + "SigningPubKey": "", + "Account": "rrrrrrrrrrrrrrrrrrrrrhoLvTp", + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "meta": { + "TransactionIndex": 3, + "AffectedNodes": [ + { + "ModifiedNode": { + "LedgerEntryType": "FeeSettings", + "LedgerIndex": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A651", + "PreviousFields": { + "ReserveBase": 20000000, + "ReserveIncrement": 5000000 + }, + "FinalFields": { + "Flags": 0, + "ReferenceFeeUnits": 10, + "ReserveBase": 50000000, + "ReserveIncrement": 12500000, + "BaseFee": "000000000000000A" + } + } + } + ], + "TransactionResult": "tesSUCCESS" + }, + "validated": true + } +} diff --git a/test/fixtures/rippled/tx/ticket-create-with-memo.json b/test/fixtures/rippled/tx/ticket-create-with-memo.json new file mode 100644 index 00000000..33c1ca45 --- /dev/null +++ b/test/fixtures/rippled/tx/ticket-create-with-memo.json @@ -0,0 +1,77 @@ +{ + "id": 0, + "result": { + "Account": "rwkQ24BPfW7gT4PGm9Pq884v4N9S2Mhcc1", + "Fee": "12", + "Flags": 2147483648, + "LastLedgerSequence": 6860133, + "Memos": [ + { + "Memo": { + "MemoData": "7465787465642064617461", + "MemoFormat": "746578742F706C61696E", + "MemoType": "74657374" + } + } + ], + "Sequence": 6860086, + "SigningPubKey": "02BF620646D5AEA75213B9915BDDC50E9FA3E6630E15553DD65DBE4B33E33CA3BB", + "TicketCount": 1, + "TransactionType": "TicketCreate", + "TxnSignature": "3045022100B70E10B66AE05B8883ED166FB81AF1EB4A6DBE237BD5F6974E4FFD280A41545402203D777235A2FAC39F41777514EDAFEB5009AABA0732F5C2E4E48559DC00B045C8", + "date": 572739601, + "inLedger": 6967458, + "hash": "1797BD0898F54F0732D2FFFF715A75CC1C50D1883A875A7B9BFD0F6936461359", + "ledger_index": 6860132, + "meta": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "2FDB506DDFDC7FB15CAE870B5806434DF83F13ECE99685BB8D0AB8ABA808B90E", + "NewFields": { + "Owner": "rwkQ24BPfW7gT4PGm9Pq884v4N9S2Mhcc1", + "RootIndex": "2FDB506DDFDC7FB15CAE870B5806434DF83F13ECE99685BB8D0AB8ABA808B90E" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rwkQ24BPfW7gT4PGm9Pq884v4N9S2Mhcc1", + "Balance": "999999988", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 6860088, + "TicketCount": 1 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7448819A64EAA365344AD9C6545CC3D9A3CC7AB811DD630B5606BB6C2249061A", + "PreviousFields": { + "Balance": "1000000000", + "OwnerCount": 0, + "Sequence": 6860086 + }, + "PreviousTxnID": "3A70FE10C862DD07E0E4D11C117F7C8255C2E387C56F6908232FDD317723D6D0", + "PreviousTxnLgrSeq": 6860086 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Ticket", + "LedgerIndex": "A7E510B4F2CE47A973FD577DD4F46CB733391F5957514B51084DA025BBB6D47A", + "NewFields": { + "Account": "rwkQ24BPfW7gT4PGm9Pq884v4N9S2Mhcc1", + "TicketSequence": 6860087 + } + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + }, + "status": "success", + "type": "response" +} diff --git a/test/fixtures/rippled/tx/with-memo.json b/test/fixtures/rippled/tx/with-memo.json new file mode 100644 index 00000000..803280df --- /dev/null +++ b/test/fixtures/rippled/tx/with-memo.json @@ -0,0 +1,142 @@ +{ + "id": 0, + "status": "success", + "type": "response", + "result": { + "Account": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "Fee": "0", + "Flags": 2147483648, + "LastLedgerSequence": 61369885, + "Memos": [ + { + "Memo": { + "MemoData": "3732363536653734", + "MemoType": "3638373437343730336132663266363537383631366437303663363532653633366636643266366436353664366632663637363536653635373236393633" + } + } + ], + "Sequence": 61349002, + "SigningPubKey": "0328B3B4516379D13340C12D303EB89EB27301B6EB59F37BE23046845E00880BFE", + "TakerGets": "1000000", + "TakerPays": { + "currency": "NRD", + "issuer": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "0.1" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402206F1CF60223113DE36479736EE0AB9165734F98D6A2DB4B0B2BFCFC02ACAABE1902202E52A62BEE554E5988F79CEE1EEF83D8B66374B9EC539328A132207D927BDDFC", + "date": 491488410, + "hash": "995570FE1E40F42DF56BFC80503BA9E3C1229619C61A1C279A76BC0805036D74", + "inLedger": 3717633, + "ledger_index": 3717633, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "Balance": "53527227", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 61350142 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "17D5C0493F006ECB3748EE5BC72D0FDFB4747DE23B57C3735E281B2DDCBEEEFF", + "PreviousFields": { + "Balance": "53517227" + }, + "PreviousTxnID": "BA34BA8650E5BD681B6BD28A5E366084FDCA2919FD734E9BAF5FE636465EB246", + "PreviousTxnLgrSeq": 61369855 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "NRD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.40001" + }, + "Flags": 3211264, + "HighLimit": { + "currency": "NRD", + "issuer": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "0" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "NRD", + "issuer": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "value": "0" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "29A9FBE62D9080A572B2D48DBCC5BEE8657F9ACBAFDE2ADC44C34C67F6321717", + "PreviousFields": { + "Balance": { + "currency": "NRD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.30001" + } + }, + "PreviousTxnID": "BA34BA8650E5BD681B6BD28A5E366084FDCA2919FD734E9BAF5FE636465EB246", + "PreviousTxnLgrSeq": 61369855 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "BookDirectory": "11DD28D0009D3C92445F21E79CAD5E9AD0B5FDB9000B3D4B5A038D7EA4C68000", + "BookNode": "0000000000000000", + "Flags": 131072, + "OwnerNode": "0000000000000000", + "Sequence": 61350140, + "TakerGets": { + "currency": "NRD", + "issuer": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "99999.6" + }, + "TakerPays": "9999960000" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "48B893DA593D08FCDE5B1307D3798C505A2F6DB1494F59BCDF25232E72E26BB8", + "PreviousFields": { + "TakerGets": { + "currency": "NRD", + "issuer": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "99999.7" + }, + "TakerPays": "9999970000" + }, + "PreviousTxnID": "BA34BA8650E5BD681B6BD28A5E366084FDCA2919FD734E9BAF5FE636465EB246", + "PreviousTxnLgrSeq": 61369855 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "Balance": "25709939", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 61349003 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C3EBF1D11573A550EF5660C9A3AF00B1BC7EE7D9F9CDE3351539DDEC1A43F2A1", + "PreviousFields": { + "Balance": "25719951", + "Sequence": 61349002 + }, + "PreviousTxnID": "BA34BA8650E5BD681B6BD28A5E366084FDCA2919FD734E9BAF5FE636465EB246", + "PreviousTxnLgrSeq": 61369855 + } + } + ], + "TransactionIndex": 3, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + } +} diff --git a/test/fixtures/rippled/tx/with-memos.json b/test/fixtures/rippled/tx/with-memos.json new file mode 100644 index 00000000..f9377283 --- /dev/null +++ b/test/fixtures/rippled/tx/with-memos.json @@ -0,0 +1,148 @@ +{ + "id": 0, + "status": "success", + "type": "response", + "result": { + "Account": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "Fee": "0", + "Flags": 2147483648, + "LastLedgerSequence": 61369885, + "Memos": [ + { + "Memo": { + "MemoData": "3732363536653734", + "MemoType": "3638373437343730336132663266363537383631366437303663363532653633366636643266366436353664366632663637363536653635373236393633" + } + }, + { + "Memo": { + "MemoData": "3732363536653734", + "MemoType": "3638373437343730336132663266363537383631366437303663363532653633366636643266366436353664366632663637363536653635373236393633" + } + } + ], + "Sequence": 61349002, + "SigningPubKey": "0328B3B4516379D13340C12D303EB89EB27301B6EB59F37BE23046845E00880BFE", + "TakerGets": "1000000", + "TakerPays": { + "currency": "NRD", + "issuer": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "0.1" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402206F1CF60223113DE36479736EE0AB9165734F98D6A2DB4B0B2BFCFC02ACAABE1902202E52A62BEE554E5988F79CEE1EEF83D8B66374B9EC539328A132207D927BDDFC", + "date": 491488410, + "hash": "995570FE1E40F42DF56BFC80503BA9E3C1229619C61A1C279A76BC0805036D73", + "inLedger": 3717633, + "ledger_index": 3717633, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "Balance": "53527227", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 61350142 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "17D5C0493F006ECB3748EE5BC72D0FDFB4747DE23B57C3735E281B2DDCBEEEFF", + "PreviousFields": { + "Balance": "53517227" + }, + "PreviousTxnID": "BA34BA8650E5BD681B6BD28A5E366084FDCA2919FD734E9BAF5FE636465EB246", + "PreviousTxnLgrSeq": 61369855 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "NRD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.40001" + }, + "Flags": 3211264, + "HighLimit": { + "currency": "NRD", + "issuer": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "0" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "NRD", + "issuer": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "value": "0" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "29A9FBE62D9080A572B2D48DBCC5BEE8657F9ACBAFDE2ADC44C34C67F6321717", + "PreviousFields": { + "Balance": { + "currency": "NRD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.30001" + } + }, + "PreviousTxnID": "BA34BA8650E5BD681B6BD28A5E366084FDCA2919FD734E9BAF5FE636465EB246", + "PreviousTxnLgrSeq": 61369855 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "BookDirectory": "11DD28D0009D3C92445F21E79CAD5E9AD0B5FDB9000B3D4B5A038D7EA4C68000", + "BookNode": "0000000000000000", + "Flags": 131072, + "OwnerNode": "0000000000000000", + "Sequence": 61350140, + "TakerGets": { + "currency": "NRD", + "issuer": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "99999.6" + }, + "TakerPays": "9999960000" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "48B893DA593D08FCDE5B1307D3798C505A2F6DB1494F59BCDF25232E72E26BB8", + "PreviousFields": { + "TakerGets": { + "currency": "NRD", + "issuer": "rGaZKAxMDhsSHvB51toY3YxGoPLhaX6Y5R", + "value": "99999.7" + }, + "TakerPays": "9999970000" + }, + "PreviousTxnID": "BA34BA8650E5BD681B6BD28A5E366084FDCA2919FD734E9BAF5FE636465EB246", + "PreviousTxnLgrSeq": 61369855 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfrCsX1gzVLvXzmgDxTYUWp96Ri6m61qtH", + "Balance": "25709939", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 61349003 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C3EBF1D11573A550EF5660C9A3AF00B1BC7EE7D9F9CDE3351539DDEC1A43F2A1", + "PreviousFields": { + "Balance": "25719951", + "Sequence": 61349002 + }, + "PreviousTxnID": "BA34BA8650E5BD681B6BD28A5E366084FDCA2919FD734E9BAF5FE636465EB246", + "PreviousTxnLgrSeq": 61369855 + } + } + ], + "TransactionIndex": 3, + "TransactionResult": "tesSUCCESS" + }, + "validated": true + } +} diff --git a/test/mock-rippled.ts b/test/mock-rippled.ts index 4b4edc72..fde12e51 100644 --- a/test/mock-rippled.ts +++ b/test/mock-rippled.ts @@ -439,6 +439,10 @@ export function createMockRippled(port) { '10A6FB4A66EE80BED46AAE4815D7DC43B97E944984CCD5B93BCF3F8538CABC51' ) { conn.send(createResponse(request, fixtures.tx.OfferCreate)) + } else if ( + request.transaction === hashes.WITH_MEMOS_OFFER_CREATE_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.OfferCreateWithMemo)) } else if ( request.transaction === '458101D51051230B1D56E9ACAFAA34451BF65FA000F95DF6F0FF5B3A62D83FC2' @@ -449,6 +453,10 @@ export function createMockRippled(port) { '809335DD3B0B333865096217AA2F55A4DF168E0198080B3A090D12D88880FF0E' ) { conn.send(createResponse(request, fixtures.tx.OfferCancel)) + } else if ( + request.transaction === hashes.WITH_MEMOS_ORDER_CANCELLATION_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.OfferCancelWithMemo)) } else if ( request.transaction === '635A0769BD94710A1F6A76CDE65A3BC661B20B798807D1BBBDADCEA26420538D' @@ -491,29 +499,52 @@ export function createMockRippled(port) { conn.send(createResponse(request, fixtures.tx.NotValidated)) } else if (request.transaction === hashes.NOTFOUND_TRANSACTION_HASH) { conn.send(createResponse(request, fixtures.tx.NotFound)) + } else if (request.transaction === hashes.WITH_MEMOS_ACCOUNT_DELETE_TRANSACTION_HASH) { + conn.send(createResponse(request, fixtures.tx.AccountDeleteWithMemo)) } else if ( request.transaction === '097B9491CC76B64831F1FEA82EAA93BCD728106D90B65A072C933888E946C40B' ) { conn.send(createResponse(request, fixtures.tx.OfferWithExpiration)) + } else if ( + request.transaction === hashes.WITH_MEMO_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.WithMemo)) + } else if ( + request.transaction === hashes.WITH_MEMOS_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.WithMemos)) } + // Checks else if ( request.transaction === '605A2E2C8E48AECAF5C56085D1AEAA0348DC838CE122C9188F94EB19DA05C2FE' ) { conn.send(createResponse(request, fixtures.tx.CheckCreate)) + } else if ( + request.transaction === hashes.WITH_MEMOS_CHECK_CREATE_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.CheckCreateWithMemo)) } else if ( request.transaction === 'B4105D1B2D83819647E4692B7C5843D674283F669524BD50C9614182E3A12CD4' ) { conn.send(createResponse(request, fixtures.tx.CheckCancel)) + } else if ( + request.transaction === hashes.WITH_MEMOS_CHECK_CANCEL_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.CheckCancelWithMemo)) } else if ( request.transaction === '8321208465F70BA52C28BCC4F646BAF3B012BA13B57576C0336F42D77E3E0749' ) { conn.send(createResponse(request, fixtures.tx.CheckCash)) + } else if ( + request.transaction === hashes.WITH_MEMOS_CHECK_CASH_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.CheckCashWithMemo)) } // Escrows @@ -545,16 +576,28 @@ export function createMockRippled(port) { '0E9CA3AB1053FC0C1CBAA75F636FE1EC92F118C7056BBEF5D63E4C116458A16D' ) { conn.send(createResponse(request, fixtures.tx.PaymentChannelCreate)) + } else if ( + request.transaction === hashes.WITH_MEMOS_PAYMENT_CHANNEL_CREATE_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.PaymentChannelCreateWithMemo)) } else if ( request.transaction === 'CD053D8867007A6A4ACB7A432605FE476D088DCB515AFFC886CF2B4EB6D2AE8B' ) { conn.send(createResponse(request, fixtures.tx.PaymentChannelFund)) + } else if ( + request.transaction === hashes.WITH_MEMOS_PAYMENT_CHANNEL_FUND_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.PaymentChannelFundWithMemo)) } else if ( request.transaction === '81B9ECAE7195EB6E8034AEDF44D8415A7A803E14513FDBB34FA984AB37D59563' ) { conn.send(createResponse(request, fixtures.tx.PaymentChannelClaim)) + } else if ( + request.transaction === hashes.WITH_MEMOS_PAYMENT_CHANNEL_CLAIM_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.PaymentChannelClaimWithMemo)) } else if ( request.transaction === 'EC2AB14028DC84DE525470AB4DAAA46358B50A8662C63804BFF38244731C0CB9' @@ -585,6 +628,18 @@ export function createMockRippled(port) { 'C6A40F56127436DCD830B1B35FF939FD05B5747D30D6542572B7A835239817AF' ) { conn.send(createResponse(request, fixtures.tx.SetFee)) + } else if ( + request.transaction === hashes.WITH_MEMOS_FEE_UPDATE_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.SetFeeWithMemo)) + } else if ( + request.transaction === hashes.WITH_MEMOS_TICKET_CREATE_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.TicketCreateWithMemo)) + } else if ( + request.transaction === hashes.WITH_MEMOS_DEPOSIT_PREAUTH_TRANSACTION_HASH + ) { + conn.send(createResponse(request, fixtures.tx.DepositPreauthWithMemo)) } else { assert(false, 'Unrecognized transaction hash: ' + request.transaction) }