mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
respond to comments
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import assert from 'assert-diff';
|
||||
import BigNumber from 'bignumber.js';
|
||||
import _ from 'lodash';
|
||||
import { RippleAPI } from 'ripple-api';
|
||||
import { RecursiveData } from 'ripple-api/ledger/utils';
|
||||
import {RippleAPI} from 'ripple-api';
|
||||
import {RecursiveData} from 'ripple-api/ledger/utils';
|
||||
import binary from 'ripple-binary-codec';
|
||||
import requests from './fixtures/requests';
|
||||
import responses from './fixtures/responses';
|
||||
|
||||
@@ -5,8 +5,8 @@ import requests from '../fixtures/requests';
|
||||
import {RippleAPI} from 'ripple-api';
|
||||
import {isValidAddress} from 'ripple-address-codec';
|
||||
import {payTo, ledgerAccept} from './utils';
|
||||
import { errors } from 'ripple-api/common';
|
||||
import { isValidSecret } from 'ripple-api/common/utils';
|
||||
import {errors} from 'ripple-api/common';
|
||||
import {isValidSecret} from 'ripple-api/common/utils';
|
||||
|
||||
|
||||
// how long before each test case times out
|
||||
|
||||
@@ -10,7 +10,7 @@ import transactionsResponse from './fixtures/rippled/account-tx';
|
||||
import accountLinesResponse from './fixtures/rippled/account-lines';
|
||||
import accountObjectsResponse from './fixtures/rippled/account-objects';
|
||||
import fullLedger from './fixtures/rippled/ledger-full-38129.json';
|
||||
import { getFreePort } from './utils/net-utils';
|
||||
import {getFreePort} from './utils/net-utils';
|
||||
|
||||
function isUSD(json) {
|
||||
return json === 'USD' || json === '0000000000000000000000005553440000000000';
|
||||
@@ -48,17 +48,12 @@ function createLedgerResponse(request, response) {
|
||||
return JSON.stringify(newResponse);
|
||||
}
|
||||
|
||||
interface CustomWebSocketServer extends WebSocketServer, EventEmitter2 {
|
||||
expectedRequests: any
|
||||
expect: any
|
||||
config: any
|
||||
socket: any
|
||||
onAny: any
|
||||
event: any
|
||||
}
|
||||
// We mock out WebSocketServer in these tests and add a lot of custom
|
||||
// properties not defined on the normal WebSocketServer object.
|
||||
type MockedWebSocketServer = any;
|
||||
|
||||
export function createMockRippled(port) {
|
||||
const mock = new WebSocketServer({ port: port }) as CustomWebSocketServer;
|
||||
const mock = new WebSocketServer({ port: port }) as MockedWebSocketServer;
|
||||
_.assign(mock, EventEmitter2.prototype);
|
||||
|
||||
const close = mock.close;
|
||||
|
||||
Reference in New Issue
Block a user