refactor: move fixtures closer to tests (part 2) (#1561)

* move echo

* move fee

* move subscribe/unsubscribe

* move ledger_current

* move ledger_data

* move submit/submit_multisigned

* remove account_tx/account_offers/gateway_balances

* move account_info

* remove ledger_entry

* remove tx

* remove account_lines

* remove ripple_path_find

* remove ledger

* remove book_offers

* move ping

* remove global_config

* move test_command

* additional mock-rippled cleanup

* add explanatory comment to mock.addResponse
This commit is contained in:
Mayukha Vadari
2021-08-26 14:02:48 -04:00
parent f9fe5936b1
commit 09ef8595e7
31 changed files with 657 additions and 752 deletions

View File

@@ -25,6 +25,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = instructionsWithMaxLedgerVersionOffset
const txJSON = {
TransactionType: 'DepositPreauth',
@@ -46,6 +49,9 @@ export default <TestSuite>{
'does not overwrite Fee in Instructions': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
fee: '0.000014' // CAUTION: This `fee` is specified in XRP, not drops.
@@ -73,6 +79,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
fee: '0.000016'
@@ -96,6 +105,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
fee: '0.000018'
@@ -119,6 +131,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
Fee: '0.000022' // Intentionally capitalized in this test, but the correct field would be `fee`
@@ -141,6 +156,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = instructionsWithMaxLedgerVersionOffset
const txJSON = {
TransactionType: 'DepositPreauth',
@@ -157,6 +175,9 @@ export default <TestSuite>{
'does not overwrite Sequence in txJSON': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -181,6 +202,9 @@ export default <TestSuite>{
'does not overwrite Sequence in Instructions': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012',
@@ -209,6 +233,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012',
@@ -238,6 +265,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012',
@@ -262,6 +292,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012',
@@ -283,6 +316,9 @@ export default <TestSuite>{
'does not overwrite LastLedgerSequence in txJSON': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {}
const txJSON = {
TransactionType: 'DepositPreauth',
@@ -309,6 +345,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
maxLedgerVersion: 8890000
}
@@ -335,6 +374,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxLedgerVersionOffset: 124
@@ -362,6 +404,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
maxLedgerVersion: 8900000
}
@@ -385,6 +430,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxLedgerVersionOffset: 123
@@ -409,6 +457,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxLedgerVersion: 8900000,
@@ -433,6 +484,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxLedgerVersion: 8900000,
@@ -458,6 +512,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
MaxLedgerVersion: 8900000 // Intentionally capitalized in this test, but the correct field would be `maxLedgerVersion`
@@ -480,6 +537,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = instructionsWithMaxLedgerVersionOffset
const txJSON = {
TransactionType: 'DepositPreauth',
@@ -500,6 +560,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = instructionsWithMaxLedgerVersionOffset
const txJSON = {
TransactionType: 'DepositPreauth',
@@ -520,6 +583,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = instructionsWithMaxLedgerVersionOffset
const txJSON = {
TransactionType: 'DepositPreauth',
@@ -544,6 +610,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012',
@@ -563,6 +632,9 @@ export default <TestSuite>{
'rejects Promise when Account is missing': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -581,6 +653,9 @@ export default <TestSuite>{
'rejects Promise when Account is not a string': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -600,6 +675,9 @@ export default <TestSuite>{
'rejects Promise when Account is invalid': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -637,6 +715,9 @@ export default <TestSuite>{
'rejects Promise when TransactionType is missing': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -660,6 +741,9 @@ export default <TestSuite>{
// at Function.from (ripple-binary-codec/distrib/npm/enums/index.js:43:15)
'prepares tx when TransactionType is invalid': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -687,6 +771,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -726,6 +813,9 @@ export default <TestSuite>{
// 'C181D470684311658852713DA81F8201062535C8DE2FF853F7DD9981BB85312F' } })]
'prepares tx when a required field is missing': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -749,6 +839,9 @@ export default <TestSuite>{
'DepositPreauth - Authorize': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -775,6 +868,9 @@ export default <TestSuite>{
'DepositPreauth - Unauthorize': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -803,6 +899,9 @@ export default <TestSuite>{
'AccountDelete': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '5.0' // 5 XRP fee for AccountDelete
@@ -832,6 +931,9 @@ export default <TestSuite>{
// prepareTransaction - Payment
'Payment - normal': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -860,6 +962,9 @@ export default <TestSuite>{
'min amount xrp': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -893,6 +998,9 @@ export default <TestSuite>{
'min amount xrp2xrp': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const txJSON = {
TransactionType: 'Payment',
Account: address,
@@ -955,6 +1063,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
client._feeCushion = 1000000
const txJSON = {
@@ -994,6 +1105,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
client._feeCushion = 1000000
const txJSON = {
@@ -1038,6 +1152,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
client._feeCushion = 1000000
client._maxFeeXRP = '3'
const localInstructions = {
@@ -1079,6 +1196,9 @@ export default <TestSuite>{
// prepareTransaction - Payment
'fee is capped to maxFee': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
client._feeCushion = 1000000
client._maxFeeXRP = '5'
const localInstructions = {
@@ -1147,6 +1267,9 @@ export default <TestSuite>{
'xaddress-issuer': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -1175,6 +1298,9 @@ export default <TestSuite>{
'PaymentChannelCreate': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -1205,6 +1331,9 @@ export default <TestSuite>{
'PaymentChannelCreate full': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const txJSON = {
Account: address,
TransactionType: 'PaymentChannelCreate',
@@ -1228,6 +1357,9 @@ export default <TestSuite>{
'PaymentChannelFund': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -1249,6 +1381,9 @@ export default <TestSuite>{
'PaymentChannelFund full': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const txJSON = {
Account: address,
TransactionType: 'PaymentChannelFund',
@@ -1268,6 +1403,9 @@ export default <TestSuite>{
'PaymentChannelClaim': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -1291,6 +1429,9 @@ export default <TestSuite>{
'PaymentChannelClaim with renew': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -1321,6 +1462,9 @@ export default <TestSuite>{
'PaymentChannelClaim with close': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012'
@@ -1355,6 +1499,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
ticketSequence: 23,
sequence: 23
@@ -1374,6 +1521,9 @@ export default <TestSuite>{
'sets sequence to 0 if a ticketSequence is passed': async (client, address, mockRippled) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012',
@@ -1407,6 +1557,9 @@ export default <TestSuite>{
mockRippled
) => {
mockRippled.addResponse({command: 'server_info'}, rippled.server_info.normal)
mockRippled.addResponse({command: 'fee'}, rippled.fee)
mockRippled.addResponse({command: 'ledger_current'}, rippled.ledger_current)
mockRippled.addResponse({command: 'account_info'}, rippled.account_info.normal)
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012',