mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
* build(deps): bump @types/ws from 7.4.7 to 8.2.0 Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.4.7 to 8.2.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws) --- updated-dependencies: - dependency-name: "@types/ws" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * resolve linter error * fix types/ws * fix flaky integration tests - tefPAST_SEQ Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nathan Nichols <natenichols@cox.net>
26 lines
611 B
TypeScript
26 lines
611 B
TypeScript
import { Client, Wallet } from 'xrpl-local'
|
|
|
|
import serverUrl from './serverUrl'
|
|
import { fundAccount } from './utils'
|
|
|
|
export async function teardownClient(this: Mocha.Context): Promise<void> {
|
|
this.client.disconnect()
|
|
}
|
|
|
|
export async function setupClient(
|
|
this: Mocha.Context,
|
|
server = serverUrl,
|
|
): Promise<void> {
|
|
this.wallet = Wallet.generate()
|
|
return new Promise<void>((resolve, reject) => {
|
|
this.client = new Client(server)
|
|
this.client
|
|
.connect()
|
|
.then(async () => {
|
|
await fundAccount(this.client, this.wallet)
|
|
resolve()
|
|
})
|
|
.catch(reject)
|
|
})
|
|
}
|