refactor: move hasNextPage from Client to utils (#1715)

* add hasNextPage

* remove unused util

* add tests

* remove hasNextPage from client
This commit is contained in:
Mayukha Vadari
2021-10-12 16:39:57 -04:00
committed by GitHub
parent 75e56ca927
commit 1a8bbfa43e
6 changed files with 39 additions and 74 deletions

View File

@@ -2,7 +2,7 @@ import { assert } from 'chai'
import { deriveXAddress } from 'xrpl-local'
describe('client.deriveXAddress', function () {
describe('deriveXAddress', function () {
it('returns address for public key', function () {
assert.equal(
deriveXAddress({

17
test/utils/hasNextPage.ts Normal file
View File

@@ -0,0 +1,17 @@
import { assert } from 'chai'
import { hasNextPage } from 'xrpl-local'
import fixtures from '../fixtures/rippled'
describe('hasNextPage', function () {
it('returns true when response has marker', function () {
const firstPage = fixtures.ledger_data.first_page
assert.isTrue(hasNextPage(firstPage))
})
it('returns false when response does not have marker', function () {
const lastPage = fixtures.ledger_data.last_page
assert.isFalse(hasNextPage(lastPage))
})
})