mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
fix: set ledger_index to validated (#1675)
* fix: adds ledger_index: validated
This commit is contained in:
committed by
Mayukha Vadari
parent
02fd0ce323
commit
c3e68cc83f
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -35,7 +35,6 @@ describe('PaymentChannelFund', function () {
|
||||
this.wallet,
|
||||
paymentChannelCreate,
|
||||
)
|
||||
|
||||
await testTransaction(this.client, paymentChannelCreate, this.wallet)
|
||||
|
||||
const paymentChannelFund: PaymentChannelFund = {
|
||||
|
||||
@@ -83,6 +83,9 @@ export async function testTransaction(
|
||||
transaction: Transaction,
|
||||
wallet: Wallet,
|
||||
): Promise<void> {
|
||||
// Accept any un-validated changes.
|
||||
await ledgerAccept(client)
|
||||
|
||||
// sign/submit the transaction
|
||||
const response = await client.submitTransaction(wallet, transaction)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user