test: SignerListSet transaction integration tests (#1621)

* add tests

* clean up helper functions

* fix account funding

* remove unneeded method

* use new wallets for each test

* automatically fund wallets

* fix TODO
This commit is contained in:
Mayukha Vadari
2021-09-17 10:35:17 -04:00
parent e53df109b0
commit 05e1d4d3c5
7 changed files with 97 additions and 112 deletions

View File

@@ -1,7 +1,7 @@
import { generateXAddress, Client } from 'xrpl-local'
import { generateXAddress, Client, Wallet } from 'xrpl-local'
import serverUrl from './serverUrl'
import { ledgerAccept } from './utils'
import { fundAccount, ledgerAccept } from './utils'
export async function teardownClient(this: Mocha.Context): Promise<void> {
this.client.disconnect()
@@ -29,8 +29,15 @@ 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(resolve).catch(reject)
this.client
.connect()
.then(async () => {
await fundAccount(this.client, this.wallet)
resolve()
})
.catch(reject)
})
}