mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +00:00
Rename RippleAPI client to Client (#1520)
* rename RippleAPI -> XrplClient * more renames * move API stuff to client folder * rename all api -> client * fix tests * make tests run * fix integ tests * fix urls * fix merge issues * XrplClient -> Client * fix merge issues * rename xrpl-client npm symlink to xrpl-local
This commit is contained in:
@@ -2,17 +2,17 @@ import net from 'net'
|
||||
import _ from 'lodash'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import {RippleAPI} from 'ripple-api'
|
||||
import {Client} from 'xrpl-local'
|
||||
import assert from 'assert-diff'
|
||||
const {schemaValidator} = RippleAPI._PRIVATE
|
||||
const {schemaValidator} = Client._PRIVATE
|
||||
|
||||
/**
|
||||
* The test function. It takes a RippleAPI object and then some other data to
|
||||
* The test function. It takes a Client object and then some other data to
|
||||
* test (currently: an address). May be called multiple times with different
|
||||
* arguments, to test different types of data.
|
||||
*/
|
||||
export type TestFn = (
|
||||
api: RippleAPI,
|
||||
client: Client,
|
||||
address: string
|
||||
) => void | PromiseLike<void>
|
||||
|
||||
@@ -112,17 +112,17 @@ export function getFreePort() {
|
||||
})
|
||||
}
|
||||
|
||||
export function getAllPublicMethods(api: RippleAPI) {
|
||||
export function getAllPublicMethods(client: Client) {
|
||||
return Array.from(
|
||||
new Set([
|
||||
...Object.getOwnPropertyNames(api),
|
||||
...Object.getOwnPropertyNames(RippleAPI.prototype)
|
||||
...Object.getOwnPropertyNames(client),
|
||||
...Object.getOwnPropertyNames(Client.prototype)
|
||||
])
|
||||
).filter((key) => !key.startsWith('_'))
|
||||
}
|
||||
|
||||
export function loadTestSuites(): LoadedTestSuite[] {
|
||||
const allTests = fs.readdirSync(path.join(__dirname, 'api'), {
|
||||
const allTests = fs.readdirSync(path.join(__dirname, 'client'), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
return allTests
|
||||
@@ -130,7 +130,7 @@ export function loadTestSuites(): LoadedTestSuite[] {
|
||||
if (methodName.startsWith('.DS_Store')) {
|
||||
return null
|
||||
}
|
||||
const testSuite = require(`./api/${methodName}`)
|
||||
const testSuite = require(`./client/${methodName}`)
|
||||
return {
|
||||
name: methodName,
|
||||
config: testSuite.config || {},
|
||||
|
||||
Reference in New Issue
Block a user