mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-28 08:05:51 +00:00
convert the rest of the helper files to ts
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
'use strict';
|
||||
const {RippleAPIBroadcast} = require('../../src');
|
||||
import {RippleAPIBroadcast} from '../../src';
|
||||
|
||||
function main() {
|
||||
const servers = ['wss://s1.ripple.com', 'wss://s2.ripple.com'];
|
||||
@@ -1,5 +1,4 @@
|
||||
'use strict';
|
||||
const Connection = require('../../src/common/connection');
|
||||
import Connection from '../../src/common/connection';
|
||||
|
||||
const request1 = {
|
||||
command: 'server_info'
|
||||
@@ -1,15 +1,12 @@
|
||||
/* eslint-disable max-nested-callbacks */
|
||||
/* eslint-disable max-params */
|
||||
'use strict';
|
||||
const _ = require('lodash');
|
||||
const assert = require('assert');
|
||||
const errors = require('../../src/common/errors');
|
||||
const wallet = require('./wallet');
|
||||
const requests = require('../fixtures/requests');
|
||||
const RippleAPI = require('ripple-api').RippleAPI;
|
||||
const {isValidAddress} = require('ripple-address-codec');
|
||||
const {isValidSecret} = require('../../src/common');
|
||||
const {payTo, ledgerAccept} = require('./utils');
|
||||
import _ from 'lodash';
|
||||
import assert from 'assert';
|
||||
import wallet from './wallet';
|
||||
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';
|
||||
|
||||
|
||||
// how long before each test case times out
|
||||
@@ -71,7 +68,7 @@ function testTransaction(testcase, type, lastClosedLedgerVersion, prepared,
|
||||
});
|
||||
}
|
||||
|
||||
function setup(server = 'wss://s1.ripple.com') {
|
||||
function setup(this: any, server = 'wss://s1.ripple.com') {
|
||||
this.api = new RippleAPI({server});
|
||||
console.log('CONNECTING...');
|
||||
return this.api.connect().then(() => {
|
||||
@@ -167,11 +164,11 @@ function setupAccounts(testcase) {
|
||||
return promise;
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
function teardown(this: any) {
|
||||
return this.api.disconnect();
|
||||
}
|
||||
|
||||
function suiteSetup() {
|
||||
function suiteSetup(this: any) {
|
||||
this.transactions = [];
|
||||
|
||||
return setup.bind(this)(serverUrl)
|
||||
Reference in New Issue
Block a user