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:
Mayukha Vadari
2021-08-17 11:16:42 -07:00
parent 6d08b9e12c
commit 73109295b4
131 changed files with 1688 additions and 1693 deletions

View File

@@ -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 || {},