mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
add test case for get transaction of types
suspendedPaymentExecution, suspendedPaymentCancellation, suspendedPaymentCreation
This commit is contained in:
38
npm-shrinkwrap.json
generated
38
npm-shrinkwrap.json
generated
@@ -95,9 +95,19 @@
|
||||
}
|
||||
},
|
||||
"ripple-binary-codec": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/ripple-binary-codec/-/ripple-binary-codec-0.0.6.tgz",
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/ripple-binary-codec/-/ripple-binary-codec-0.0.7.tgz",
|
||||
"dependencies": {
|
||||
"babel-runtime": {
|
||||
"version": "5.8.34",
|
||||
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-5.8.34.tgz",
|
||||
"dependencies": {
|
||||
"core-js": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.6.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"bn.js": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-3.3.0.tgz"
|
||||
@@ -127,6 +137,30 @@
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
|
||||
},
|
||||
"lodash": {
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
|
||||
},
|
||||
"ripple-address-codec": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-2.0.1.tgz",
|
||||
"dependencies": {
|
||||
"hash.js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz"
|
||||
},
|
||||
"x-address-codec": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/x-address-codec/-/x-address-codec-0.7.2.tgz",
|
||||
"dependencies": {
|
||||
"base-x": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/base-x/-/base-x-1.0.1.tgz"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"https-proxy-agent": "^1.0.0",
|
||||
"lodash": "^3.1.0",
|
||||
"ripple-address-codec": "^2.0.1",
|
||||
"ripple-binary-codec": "^0.0.6",
|
||||
"ripple-binary-codec": "^0.0.7",
|
||||
"ripple-hashes": "^0.0.1",
|
||||
"ripple-keypairs": "^0.10.0",
|
||||
"ripple-lib-transactionparser": "^0.6.0",
|
||||
|
||||
@@ -56,6 +56,24 @@
|
||||
"type": {"enum": ["settings"]},
|
||||
"specification": {"$ref": "getSettings"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"type": {"enum": ["suspendedPaymentCreation"]},
|
||||
"specification": {"$ref": "suspendedPaymentCreation"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"type": {"enum": ["suspendedPaymentCancellation"]},
|
||||
"specification": {"$ref": "suspendedPaymentCancellation"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"type": {"enum": ["suspendedPaymentExecution"]},
|
||||
"specification": {"$ref": "suspendedPaymentExecution"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -21,11 +21,12 @@
|
||||
},
|
||||
"digest": {
|
||||
"$ref": "hash256",
|
||||
"description": "The original `digest` from the suspended payment creation transaction."
|
||||
"description": "The original `digest` from the suspended payment creation transaction. This is sha256 hash of `proof` string."
|
||||
},
|
||||
"proof": {
|
||||
"type": "string",
|
||||
"description": "A value that produces the digest when hashed."
|
||||
"description": "A value that produces the digest when hashed. It must be 32 charaters long and contain only 8-bit characters.",
|
||||
"pattern": "^[\\x00-\\xFF]{32}$"
|
||||
}
|
||||
},
|
||||
"required": ["owner", "suspensionSequence"],
|
||||
|
||||
@@ -8,7 +8,13 @@ type Outcome = {
|
||||
ledgerVersion: number,
|
||||
indexInLedger: number,
|
||||
fee: string,
|
||||
balanceChanges: Object,
|
||||
balanceChanges: {
|
||||
[key: string]: [{
|
||||
currency: string,
|
||||
counterparty?: string,
|
||||
value: string
|
||||
}]
|
||||
},
|
||||
orderbookChanges: Object,
|
||||
timestamp?: string
|
||||
}
|
||||
|
||||
@@ -25,7 +25,9 @@ function isImmediateRejection(engineResult: string): boolean {
|
||||
|
||||
function formatResponse(response) {
|
||||
if (isImmediateRejection(response.engine_result)) {
|
||||
throw new utils.common.errors.RippledError('Submit failed');
|
||||
const error = new utils.common.errors.RippledError('Submit failed');
|
||||
error.data = response;
|
||||
throw error;
|
||||
}
|
||||
return {
|
||||
resultCode: response.engine_result,
|
||||
|
||||
@@ -188,6 +188,13 @@ describe('RippleAPI', function() {
|
||||
schemaValidator.schemaValidate('sign', result);
|
||||
});
|
||||
|
||||
it('sign - SuspendedPaymentExecution', function() {
|
||||
const secret = 'snoPBrXtMeMyMHUVTgbuqAfg1SUTb';
|
||||
const result = this.api.sign(requests.signSuspended.txJSON, secret);
|
||||
assert.deepEqual(result, responses.signSuspended);
|
||||
schemaValidator.schemaValidate('sign', result);
|
||||
});
|
||||
|
||||
it('submit', function() {
|
||||
return this.api.submit(responses.sign.signedTransaction).then(
|
||||
_.partial(checkResult, responses.submit, 'submit'));
|
||||
@@ -438,6 +445,34 @@ describe('RippleAPI', function() {
|
||||
assert(error instanceof this.api.errors.UnexpectedError);
|
||||
});
|
||||
});
|
||||
|
||||
it('getTransaction - SuspendedPaymentCreation', function() {
|
||||
const hash =
|
||||
'144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1';
|
||||
return this.api.getTransaction(hash).then(
|
||||
_.partial(checkResult,
|
||||
responses.getTransaction.suspendedPaymentCreation,
|
||||
'getTransaction'));
|
||||
});
|
||||
|
||||
it('getTransaction - SuspendedPaymentCancellation', function() {
|
||||
const hash =
|
||||
'F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22';
|
||||
return this.api.getTransaction(hash).then(
|
||||
_.partial(checkResult,
|
||||
responses.getTransaction.suspendedPaymentCancellation,
|
||||
'getTransaction'));
|
||||
});
|
||||
|
||||
it('getTransaction - SuspendedPaymentExecution', function() {
|
||||
const hash =
|
||||
'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B';
|
||||
return this.api.getTransaction(hash).then(
|
||||
_.partial(checkResult,
|
||||
responses.getTransaction.suspendedPaymentExecution,
|
||||
'getTransaction'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('getTransactions', function() {
|
||||
|
||||
1
test/fixtures/requests/index.js
vendored
1
test/fixtures/requests/index.js
vendored
@@ -22,6 +22,7 @@ module.exports = {
|
||||
complex: require('./prepare-trustline')
|
||||
},
|
||||
sign: require('./sign'),
|
||||
signSuspended: require('./sign-suspended.json'),
|
||||
getPaths: {
|
||||
normal: require('./getpaths/normal'),
|
||||
UsdToUsd: require('./getpaths/usd2usd'),
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"suspensionSequence": 1234,
|
||||
"method": 1,
|
||||
"digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
|
||||
"proof": "whatever"
|
||||
"digest": "712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D",
|
||||
"proof": "this must have 32 characters...."
|
||||
}
|
||||
|
||||
8
test/fixtures/requests/sign-suspended.json
vendored
Normal file
8
test/fixtures/requests/sign-suspended.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"txJSON": "{\"TransactionType\":\"SuspendedPaymentFinish\",\"Account\":\"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\"Owner\":\"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\"OfferSequence\":2,\"Method\":1,\"Digest\":\"712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D\",\"Proof\":\"74686973206D757374206861766520333220636861726163746572732E2E2E2E\",\"Flags\":2147483648,\"LastLedgerSequence\":102,\"Fee\":\"12\",\"Sequence\":1}",
|
||||
"instructions": {
|
||||
"fee": "0.000012",
|
||||
"sequence": 1,
|
||||
"maxLedgerVersion": 102
|
||||
}
|
||||
}
|
||||
26
test/fixtures/responses/get-transaction-suspended-payment-cancellation.json
vendored
Normal file
26
test/fixtures/responses/get-transaction-suspended-payment-cancellation.json
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"type": "suspendedPaymentCancellation",
|
||||
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"sequence": 9,
|
||||
"id": "F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22",
|
||||
"specification": {
|
||||
"owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"suspensionSequence": 7
|
||||
},
|
||||
"outcome": {
|
||||
"result": "tesSUCCESS",
|
||||
"timestamp": "2015-11-16T04:50:20.000Z",
|
||||
"fee": "0.000012",
|
||||
"balanceChanges": {
|
||||
"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh": [
|
||||
{
|
||||
"currency": "XRP",
|
||||
"value": "-0.00001"
|
||||
}
|
||||
]
|
||||
},
|
||||
"orderbookChanges": {},
|
||||
"ledgerVersion": 14,
|
||||
"indexInLedger": 0
|
||||
}
|
||||
}
|
||||
50
test/fixtures/responses/get-transaction-suspended-payment-create.json
vendored
Normal file
50
test/fixtures/responses/get-transaction-suspended-payment-create.json
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"type": "suspendedPaymentCreation",
|
||||
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"sequence": 10,
|
||||
"id": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1",
|
||||
"specification": {
|
||||
"source": {
|
||||
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"maxAmount": {
|
||||
"currency": "XRP",
|
||||
"value": "0.000002"
|
||||
},
|
||||
"tag": 1
|
||||
},
|
||||
"destination": {
|
||||
"address": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
|
||||
"amount": {
|
||||
"currency": "XRP",
|
||||
"value": "0.000002"
|
||||
},
|
||||
"tag": 2
|
||||
},
|
||||
"memos": [
|
||||
{
|
||||
"type": "x2",
|
||||
"format": "text/plain",
|
||||
"data": "mema data"
|
||||
}
|
||||
],
|
||||
"digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
|
||||
"allowCancelAfter": "2015-11-16T06:53:42.000Z",
|
||||
"allowExecuteAfter": "2015-11-16T06:47:42.000Z"
|
||||
},
|
||||
"outcome": {
|
||||
"result": "tesSUCCESS",
|
||||
"timestamp": "2015-11-16T06:43:00.000Z",
|
||||
"fee": "0.000012",
|
||||
"balanceChanges": {
|
||||
"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh": [
|
||||
{
|
||||
"currency": "XRP",
|
||||
"value": "-0.000014"
|
||||
}
|
||||
]
|
||||
},
|
||||
"orderbookChanges": {},
|
||||
"ledgerVersion": 15,
|
||||
"indexInLedger": 0
|
||||
}
|
||||
}
|
||||
35
test/fixtures/responses/get-transaction-suspended-payment-execution.json
vendored
Normal file
35
test/fixtures/responses/get-transaction-suspended-payment-execution.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"type": "suspendedPaymentExecution",
|
||||
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"sequence": 6,
|
||||
"id": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B",
|
||||
"specification": {
|
||||
"owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"suspensionSequence": 5,
|
||||
"method": 1,
|
||||
"digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1",
|
||||
"proof": "whateverthis bemusthave 32 chars"
|
||||
},
|
||||
"outcome": {
|
||||
"result": "tesSUCCESS",
|
||||
"timestamp": "2015-11-17T01:47:40.000Z",
|
||||
"fee": "0.000012",
|
||||
"balanceChanges": {
|
||||
"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh": [
|
||||
{
|
||||
"currency": "XRP",
|
||||
"value": "-0.000012"
|
||||
}
|
||||
],
|
||||
"rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw": [
|
||||
{
|
||||
"currency": "XRP",
|
||||
"value": "10.000043"
|
||||
}
|
||||
]
|
||||
},
|
||||
"orderbookChanges": {},
|
||||
"ledgerVersion": 14,
|
||||
"indexInLedger": 0
|
||||
}
|
||||
}
|
||||
9
test/fixtures/responses/index.js
vendored
9
test/fixtures/responses/index.js
vendored
@@ -28,7 +28,13 @@ module.exports = {
|
||||
setRegularKey: require('./get-transaction-settings-set-regular-key.json'),
|
||||
trustlineFrozenOff: require('./get-transaction-trust-set-frozen-off.json'),
|
||||
trustlineNoQuality: require('./get-transaction-trust-no-quality.json'),
|
||||
notValidated: require('./get-transaction-not-validated.json')
|
||||
notValidated: require('./get-transaction-not-validated.json'),
|
||||
suspendedPaymentCreation:
|
||||
require('./get-transaction-suspended-payment-create.json'),
|
||||
suspendedPaymentCancellation:
|
||||
require('./get-transaction-suspended-payment-cancellation.json'),
|
||||
suspendedPaymentExecution:
|
||||
require('./get-transaction-suspended-payment-execution.json')
|
||||
},
|
||||
getTransactions: require('./get-transactions.json'),
|
||||
getTrustlines: require('./get-trustlines.json'),
|
||||
@@ -69,6 +75,7 @@ module.exports = {
|
||||
complex: require('./prepare-trustline.json')
|
||||
},
|
||||
sign: require('./sign.json'),
|
||||
signSuspended: require('./sign-suspended.json'),
|
||||
submit: require('./submit.json'),
|
||||
ledgerClosed: require('./ledger-closed.json')
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"SuspendedPaymentFinish\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Method\":1,\"Digest\":\"8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4\",\"Proof\":\"7768617465766572\",\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
|
||||
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"SuspendedPaymentFinish\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Method\":1,\"Digest\":\"712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D\",\"Proof\":\"74686973206D757374206861766520333220636861726163746572732E2E2E2E\",\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
|
||||
"instructions": {
|
||||
"fee": "0.000012",
|
||||
"sequence": 23,
|
||||
|
||||
4
test/fixtures/responses/sign-suspended.json
vendored
Normal file
4
test/fixtures/responses/sign-suspended.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"signedTransaction": "12000222800000002400000001201900000002201B000000665015712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D68400000000000000C73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220690785C69BCF4CDA2DD5E82D2F9A9C7BDCBAB68A1E927DC03C0C32900938AC1702202A25E42E9920DB2F46E378F6F6598828D441E99F7D828010AD91674A5E7C0AED70112074686973206D757374206861766520333220636861726163746572732E2E2E2E8114B5F762798A53D543A014CAF8B297CFF8F2F937E88214B5F762798A53D543A014CAF8B297CFF8F2F937E8021001",
|
||||
"id": "B0ADFCC7925588AB2C224A7693222B3397158EA9206FBD614763FB6D00C1F6C1"
|
||||
}
|
||||
6
test/fixtures/rippled/index.js
vendored
6
test/fixtures/rippled/index.js
vendored
@@ -44,6 +44,10 @@ module.exports = {
|
||||
NoLedgerFound: require('./tx/no-ledger-found.json'),
|
||||
LedgerWithoutTime: require('./tx/ledger-without-time.json'),
|
||||
NotValidated: require('./tx/not-validated.json'),
|
||||
OfferWithExpiration: require('./tx/order-with-expiration.json')
|
||||
OfferWithExpiration: require('./tx/order-with-expiration.json'),
|
||||
SuspendedPaymentCreation: require('./tx/suspended-payment-creation.json'),
|
||||
SuspendedPaymentCancellation:
|
||||
require('./tx/suspended-payment-cancellation.json'),
|
||||
SuspendedPaymentExecution: require('./tx/suspended-payment-execution.json')
|
||||
}
|
||||
};
|
||||
|
||||
85
test/fixtures/rippled/tx/suspended-payment-cancellation.json
vendored
Normal file
85
test/fixtures/rippled/tx/suspended-payment-cancellation.json
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"id": 0,
|
||||
"result": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"LastLedgerSequence": 113,
|
||||
"OfferSequence": 7,
|
||||
"Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Sequence": 9,
|
||||
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
|
||||
"TransactionType": "SuspendedPaymentCancel",
|
||||
"TxnSignature": "304502210095453956DB908E99386D12F266F48C225CD48F076773F577A4EF676F265B7A18022041E45BB638E64D92EC7FB9B99BEDE1A0B28C245804999656BDBE6043D97BB4A1",
|
||||
"date": 500964620,
|
||||
"hash": "F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22",
|
||||
"inLedger": 14,
|
||||
"ledger_index": 14,
|
||||
"meta": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Balance": "99999997964999890",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 2,
|
||||
"Sequence": 10
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "2B6AC232AA4C4BE41BF49D2459FA4A0347E1B543A4C92FCEE0821C0201E2E9A8",
|
||||
"PreviousFields": {
|
||||
"Balance": "99999997964999900",
|
||||
"OwnerCount": 3,
|
||||
"Sequence": 9
|
||||
},
|
||||
"PreviousTxnID": "A6B61F6AA58C8BD27636CE75767E09459E2FBDB128D35FD6990ED18CBFEE553C",
|
||||
"PreviousTxnLgrSeq": 13
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "8B24E55376A65D68542C17F3BF446231AC7062CB43BED28817570128A1849819",
|
||||
"PreviousTxnID": "C29DFFC139459A2825699DDFA37F8205154827B80B1AAEAEA13B32FAB1C81B46",
|
||||
"PreviousTxnLgrSeq": 12
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Amount": "2",
|
||||
"CancelAfter": 500964204,
|
||||
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
|
||||
"DestinationTag": 2,
|
||||
"Flags": 0,
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "C29DFFC139459A2825699DDFA37F8205154827B80B1AAEAEA13B32FAB1C81B46",
|
||||
"PreviousTxnLgrSeq": 12,
|
||||
"SourceTag": 1
|
||||
},
|
||||
"LedgerEntryType": "SuspendedPayment",
|
||||
"LedgerIndex": "B366B476EFE3A621C96835A36BFDF83C2A5B0008F0EF4A83D751380F53EFCE71"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"RootIndex": "D8120FC732737A2CF2E9968FDF3797A43B457F2A81AA06D2653171A1EA635204"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "D8120FC732737A2CF2E9968FDF3797A43B457F2A81AA06D2653171A1EA635204"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 0,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"validated": true
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
97
test/fixtures/rippled/tx/suspended-payment-creation.json
vendored
Normal file
97
test/fixtures/rippled/tx/suspended-payment-creation.json
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"id": 0,
|
||||
"result": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Amount": "2",
|
||||
"CancelAfter": 500972022,
|
||||
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
|
||||
"DestinationTag": 2,
|
||||
"Digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
|
||||
"Fee": "12",
|
||||
"FinishAfter": 500971662,
|
||||
"Flags": 2147483648,
|
||||
"LastLedgerSequence": 114,
|
||||
"Memos": [
|
||||
{
|
||||
"Memo": {
|
||||
"MemoData": "6D656D612064617461",
|
||||
"MemoFormat": "746578742F706C61696E",
|
||||
"MemoType": "7832"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Sequence": 10,
|
||||
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
|
||||
"SourceTag": 1,
|
||||
"TransactionType": "SuspendedPaymentCreate",
|
||||
"TxnSignature": "3045022100EA1C5433AFA3F0BAAAF7C4146B032B86A0212EB4E2A3551DE9717651A538AE260220228C9E9FC857EC8143F01C2F959A8F134B285B67D8261B49E57BFF8DF76D2255",
|
||||
"date": 500971380,
|
||||
"hash": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1",
|
||||
"inLedger": 15,
|
||||
"ledger_index": 15,
|
||||
"meta": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"CreatedNode": {
|
||||
"LedgerEntryType": "SuspendedPayment",
|
||||
"LedgerIndex": "0D7629A23BC20F25C48D9423E2485582255A74B76A25F26EDB46766982E4C2C4",
|
||||
"NewFields": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Amount": "2",
|
||||
"CancelAfter": 500972022,
|
||||
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
|
||||
"DestinationTag": 2,
|
||||
"Digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
|
||||
"FinishAfter": 500971662,
|
||||
"SourceTag": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Balance": "99999997964999876",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 3,
|
||||
"Sequence": 11
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "2B6AC232AA4C4BE41BF49D2459FA4A0347E1B543A4C92FCEE0821C0201E2E9A8",
|
||||
"PreviousFields": {
|
||||
"Balance": "99999997964999890",
|
||||
"OwnerCount": 2,
|
||||
"Sequence": 10
|
||||
},
|
||||
"PreviousTxnID": "F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22",
|
||||
"PreviousTxnLgrSeq": 14
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "8B24E55376A65D68542C17F3BF446231AC7062CB43BED28817570128A1849819",
|
||||
"PreviousTxnID": "F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22",
|
||||
"PreviousTxnLgrSeq": 14
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"RootIndex": "D8120FC732737A2CF2E9968FDF3797A43B457F2A81AA06D2653171A1EA635204"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "D8120FC732737A2CF2E9968FDF3797A43B457F2A81AA06D2653171A1EA635204"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 0,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"validated": true
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
100
test/fixtures/rippled/tx/suspended-payment-execution.json
vendored
Normal file
100
test/fixtures/rippled/tx/suspended-payment-execution.json
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"id": 0,
|
||||
"result": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1",
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"LastLedgerSequence": 113,
|
||||
"Method": 1,
|
||||
"OfferSequence": 5,
|
||||
"Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Proof": "7768617465766572746869732062656D75737468617665203332206368617273",
|
||||
"Sequence": 6,
|
||||
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
|
||||
"TransactionType": "SuspendedPaymentFinish",
|
||||
"TxnSignature": "304402204E981802BA2F4C3677E69B26387CC157284D31886CF95B73A8AB3E717FE6A6490220519CD84CA01BA5D7A49809B041929F12D56F32E76FAE73F0FAFF7B5E7B8B110B",
|
||||
"date": 501040060,
|
||||
"hash": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B",
|
||||
"inLedger": 14,
|
||||
"ledger_index": 14,
|
||||
"meta": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Balance": "99999999239999842",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 0,
|
||||
"Sequence": 7
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "2B6AC232AA4C4BE41BF49D2459FA4A0347E1B543A4C92FCEE0821C0201E2E9A8",
|
||||
"PreviousFields": {
|
||||
"Balance": "99999999239999854",
|
||||
"OwnerCount": 1,
|
||||
"Sequence": 6
|
||||
},
|
||||
"PreviousTxnID": "22E0E87BAD4832CFD2B49409D488E5F92DD38424FD1781602277585914120C1E",
|
||||
"PreviousTxnLgrSeq": 12
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
|
||||
"Balance": "760000086",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 0,
|
||||
"Sequence": 1
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "8B24E55376A65D68542C17F3BF446231AC7062CB43BED28817570128A1849819",
|
||||
"PreviousFields": {
|
||||
"Balance": "750000043"
|
||||
},
|
||||
"PreviousTxnID": "22E0E87BAD4832CFD2B49409D488E5F92DD38424FD1781602277585914120C1E",
|
||||
"PreviousTxnLgrSeq": 12
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"Amount": "10000043",
|
||||
"CancelAfter": 501079458,
|
||||
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
|
||||
"DestinationTag": 2,
|
||||
"Digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1",
|
||||
"FinishAfter": 501039918,
|
||||
"Flags": 0,
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "22E0E87BAD4832CFD2B49409D488E5F92DD38424FD1781602277585914120C1E",
|
||||
"PreviousTxnLgrSeq": 12,
|
||||
"SourceTag": 1
|
||||
},
|
||||
"LedgerEntryType": "SuspendedPayment",
|
||||
"LedgerIndex": "AA7D93BDB975252718205C98792BF8940E3FC6E6972213F451AB5D602E8AD971"
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
"RootIndex": "D8120FC732737A2CF2E9968FDF3797A43B457F2A81AA06D2653171A1EA635204"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "D8120FC732737A2CF2E9968FDF3797A43B457F2A81AA06D2653171A1EA635204"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 0,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"validated": true
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
@@ -201,6 +201,16 @@ module.exports = function(port) {
|
||||
} else if (request.transaction ===
|
||||
'097B9491CC76B64831F1FEA82EAA93BCD728106D90B65A072C933888E946C40B') {
|
||||
conn.send(createResponse(request, fixtures.tx.OfferWithExpiration));
|
||||
} else if (request.transaction ===
|
||||
'144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1') {
|
||||
conn.send(createResponse(request, fixtures.tx.SuspendedPaymentCreation));
|
||||
} else if (request.transaction ===
|
||||
'F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22') {
|
||||
conn.send(createResponse(request,
|
||||
fixtures.tx.SuspendedPaymentCancellation));
|
||||
} else if (request.transaction ===
|
||||
'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B') {
|
||||
conn.send(createResponse(request, fixtures.tx.SuspendedPaymentExecution));
|
||||
} else {
|
||||
assert(false, 'Unrecognized transaction hash: ' + request.transaction);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user