diff --git a/src/sugar/autofill.ts b/src/sugar/autofill.ts index 08c5875d..51fc7129 100644 --- a/src/sugar/autofill.ts +++ b/src/sugar/autofill.ts @@ -127,6 +127,7 @@ async function setNextValidSequenceNumber( const request: AccountInfoRequest = { command: 'account_info', account: tx.Account, + ledger_index: 'validated', } const data = await client.request(request) // eslint-disable-next-line no-param-reassign, require-atomic-updates -- param reassign is safe with no race condition diff --git a/src/sugar/orderbook.ts b/src/sugar/orderbook.ts index 24e50e2b..7dd4d588 100644 --- a/src/sugar/orderbook.ts +++ b/src/sugar/orderbook.ts @@ -54,7 +54,7 @@ async function getOrderbook( command: 'book_offers', taker_pays: takerPays, taker_gets: takerGets, - ledger_index: options.ledger_index, + ledger_index: options.ledger_index ?? 'validated', ledger_hash: options.ledger_hash, limit: options.limit ?? DEFAULT_LIMIT, taker: options.taker, diff --git a/src/wallet/generateFaucetWallet.ts b/src/wallet/generateFaucetWallet.ts index 4f084b30..0636a8a7 100644 --- a/src/wallet/generateFaucetWallet.ts +++ b/src/wallet/generateFaucetWallet.ts @@ -213,6 +213,7 @@ async function getAddressXrpBalance( const balances = await client.request({ command: 'account_info', account: address, + ledger_index: 'validated', }) return balances.result.account_data.Balance diff --git a/test/integration/transactions/paymentChannelClaim.ts b/test/integration/transactions/paymentChannelClaim.ts index db2c8e8c..c8e74191 100644 --- a/test/integration/transactions/paymentChannelClaim.ts +++ b/test/integration/transactions/paymentChannelClaim.ts @@ -13,7 +13,7 @@ import { generateFundedWallet, testTransaction } from '../utils' // how long before each test case times out const TIMEOUT = 20000 -describe('PaymentChannelFund', function () { +describe('PaymentChannelClaim', function () { this.timeout(TIMEOUT) before(suiteClientSetup) diff --git a/test/integration/transactions/paymentChannelFund.ts b/test/integration/transactions/paymentChannelFund.ts index a8628e08..aec1b1f8 100644 --- a/test/integration/transactions/paymentChannelFund.ts +++ b/test/integration/transactions/paymentChannelFund.ts @@ -35,7 +35,6 @@ describe('PaymentChannelFund', function () { this.wallet, paymentChannelCreate, ) - await testTransaction(this.client, paymentChannelCreate, this.wallet) const paymentChannelFund: PaymentChannelFund = { diff --git a/test/integration/utils.ts b/test/integration/utils.ts index f8437800..e611e4ad 100644 --- a/test/integration/utils.ts +++ b/test/integration/utils.ts @@ -83,6 +83,9 @@ export async function testTransaction( transaction: Transaction, wallet: Wallet, ): Promise { + // Accept any un-validated changes. + await ledgerAccept(client) + // sign/submit the transaction const response = await client.submitTransaction(wallet, transaction)