mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-02 08:16:56 +00:00
* build(deps): bump @types/ws from 7.4.7 to 8.2.0 Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.4.7 to 8.2.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws) --- updated-dependencies: - dependency-name: "@types/ws" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * resolve linter error * fix types/ws * fix flaky integration tests - tefPAST_SEQ Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nathan Nichols <natenichols@cox.net>
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
import { assert } from 'chai'
|
|
import _ from 'lodash'
|
|
|
|
import { LedgerDataRequest } from 'xrpl-local'
|
|
|
|
import serverUrl from '../serverUrl'
|
|
import { setupClient, teardownClient } from '../setup'
|
|
|
|
// how long before each test case times out
|
|
const TIMEOUT = 20000
|
|
|
|
describe('ledger_data', function () {
|
|
this.timeout(TIMEOUT)
|
|
|
|
beforeEach(_.partial(setupClient, serverUrl))
|
|
afterEach(teardownClient)
|
|
|
|
it('base', async function () {
|
|
const ledgerDataRequest: LedgerDataRequest = {
|
|
command: 'ledger_data',
|
|
ledger_index: 'validated',
|
|
limit: 5,
|
|
binary: true,
|
|
}
|
|
|
|
const ledgerDataResponse = await this.client.request(ledgerDataRequest)
|
|
|
|
const expected = {
|
|
id: 0,
|
|
result: {
|
|
ledger_hash: 'string',
|
|
ledger_index: 0,
|
|
marker: 'string',
|
|
state: [
|
|
{
|
|
data: 'string',
|
|
index: 'string',
|
|
},
|
|
],
|
|
},
|
|
type: 'response',
|
|
}
|
|
|
|
assert.equal(ledgerDataResponse.type, expected.type)
|
|
|
|
assert.typeOf(ledgerDataResponse.result.ledger_hash, 'string')
|
|
assert.typeOf(ledgerDataResponse.result.ledger_index, 'number')
|
|
assert.typeOf(ledgerDataResponse.result.marker, 'string')
|
|
|
|
assert.equal(ledgerDataResponse.result.state.length, 5)
|
|
ledgerDataResponse.result.state.forEach((item) => {
|
|
assert.typeOf(item.data, 'string')
|
|
assert.typeOf(item.index, 'string')
|
|
})
|
|
})
|
|
})
|