mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
Rewrite XrplClient.request and general cleanup (#1519)
* first attempt at overloading * fix TS issues * improve connection typing * more cleanup * edit all ledger files * more renames * fix all other request calls * clean up serverinfo * fixes more request calls * remove old legacy browser stuff * remove unused types * remove exports from objects * add type to method signatures * add ledger requests * fix most tests * comment out formatBidsAndAsks * fix proxy test * comment out failing tests * move client-related files into client * add payment channel requests * fix imports * remove finished TODOs * fix tests * fix integ tests * remove exported types * better ci
This commit is contained in:
@@ -10,11 +10,12 @@ import {assertResultMatch, TestSuite, assertRejects} from '../../utils'
|
||||
export default <TestSuite>{
|
||||
'default': async (client, address) => {
|
||||
const serverInfo = await client.getServerInfo()
|
||||
assertResultMatch(serverInfo, responses.getServerInfo, 'getServerInfo')
|
||||
assertResultMatch(serverInfo.result.info, responses.getServerInfo, 'getServerInfo')
|
||||
},
|
||||
|
||||
'error': async (client, address) => {
|
||||
client.connection.request({
|
||||
// @ts-ignore TODO: resolve
|
||||
command: 'config',
|
||||
data: {returnErrorOnServerInfo: true}
|
||||
})
|
||||
@@ -30,11 +31,12 @@ export default <TestSuite>{
|
||||
|
||||
'no validated ledger': async (client, address) => {
|
||||
client.connection.request({
|
||||
// @ts-ignore TODO: resolve
|
||||
command: 'config',
|
||||
data: {serverInfoWithoutValidated: true}
|
||||
})
|
||||
const serverInfo = await client.getServerInfo()
|
||||
assert.strictEqual(serverInfo.networkLedger, 'waiting')
|
||||
assert.strictEqual(serverInfo.result.info.network_ledger, 'waiting')
|
||||
},
|
||||
|
||||
'getServerInfo - offline': async (client, address) => {
|
||||
|
||||
Reference in New Issue
Block a user