Adds @xrplf prettier config (#1598)

* build: new prettier config
This commit is contained in:
Nathan Nichols
2021-09-03 15:41:20 -07:00
committed by Mayukha Vadari
parent 8c5bc22317
commit e200de3073
263 changed files with 10185 additions and 10133 deletions

View File

@@ -1,48 +1,48 @@
import { Client, BroadcastClient } from "xrpl-local";
import { Client, BroadcastClient } from 'xrpl-local'
import { PortResponse } from "./mockRippled";
import { PortResponse } from './mockRippled'
const port = 34371;
const baseUrl = "ws://testripple.circleci.com:";
const port = 34371
const baseUrl = 'ws://testripple.circleci.com:'
function setup(this: any, port_ = port) {
const tclient = new Client(baseUrl + port_);
async function setup(this: any, port_ = port) {
const tclient = new Client(baseUrl + port_)
return tclient
.connect()
.then(() => {
.then(async () => {
return tclient.connection.request({
command: "test_command",
command: 'test_command',
data: { openOnOtherPort: true },
});
})
})
.then((got) => {
.then(async (got) => {
return new Promise<void>((resolve, reject) => {
this.client = new Client(baseUrl + (got as PortResponse).result.port);
this.client.connect().then(resolve).catch(reject);
});
this.client = new Client(baseUrl + (got as PortResponse).result.port)
this.client.connect().then(resolve).catch(reject)
})
})
.then(async () => {
return tclient.disconnect()
})
.then(() => {
return tclient.disconnect();
});
}
function setupBroadcast(this: any) {
const servers = [port, port + 1].map((port_) => baseUrl + port_);
this.client = new BroadcastClient(servers);
async function setupBroadcast(this: any) {
const servers = [port, port + 1].map((port_) => baseUrl + port_)
this.client = new BroadcastClient(servers)
return new Promise<void>((resolve, reject) => {
this.client.connect().then(resolve).catch(reject);
});
this.client.connect().then(resolve).catch(reject)
})
}
function teardown(this: any) {
if (this.client.isConnected()) {
return this.client.disconnect();
return this.client.disconnect()
}
return undefined;
return undefined
}
export default {
setup,
teardown,
setupBroadcast,
};
}