mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
test: Integration tests for Account Transactions (#1673)
* test: Integration tests for Account Transactions
This commit is contained in:
committed by
Mayukha Vadari
parent
8df224232c
commit
a1dce6b1e0
35
test/integration/transactions/accountDelete.ts
Normal file
35
test/integration/transactions/accountDelete.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import _ from 'lodash'
|
||||
|
||||
import { AccountDelete } from 'xrpl-local/models/transactions'
|
||||
|
||||
import serverUrl from '../serverUrl'
|
||||
import { setupClient, suiteClientSetup, teardownClient } from '../setup'
|
||||
import { generateFundedWallet, ledgerAccept, testTransaction } from '../utils'
|
||||
|
||||
// how long before each test case times out
|
||||
const TIMEOUT = 20000
|
||||
|
||||
describe('AccountDelete', function () {
|
||||
this.timeout(TIMEOUT)
|
||||
|
||||
before(suiteClientSetup)
|
||||
beforeEach(_.partial(setupClient, serverUrl))
|
||||
afterEach(teardownClient)
|
||||
|
||||
it('base', async function () {
|
||||
const wallet2 = await generateFundedWallet(this.client)
|
||||
// to the satisfy the condition that account sequence and current ledger_index should be 256 apart.
|
||||
const promises: Array<Promise<void>> = []
|
||||
for (let iter = 0; iter < 256; iter += 1) {
|
||||
promises.push(ledgerAccept(this.client))
|
||||
}
|
||||
|
||||
await Promise.all(promises)
|
||||
const tx: AccountDelete = {
|
||||
TransactionType: 'AccountDelete',
|
||||
Account: this.wallet.getClassicAddress(),
|
||||
Destination: wallet2.getClassicAddress(),
|
||||
}
|
||||
await testTransaction(this.client, tx, this.wallet)
|
||||
})
|
||||
})
|
||||
26
test/integration/transactions/accountSet.ts
Normal file
26
test/integration/transactions/accountSet.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import _ from 'lodash'
|
||||
|
||||
import { AccountSet } from 'xrpl-local/models/transactions'
|
||||
|
||||
import serverUrl from '../serverUrl'
|
||||
import { setupClient, suiteClientSetup, teardownClient } from '../setup'
|
||||
import { testTransaction } from '../utils'
|
||||
|
||||
// how long before each test case times out
|
||||
const TIMEOUT = 20000
|
||||
|
||||
describe('AccountSet', function () {
|
||||
this.timeout(TIMEOUT)
|
||||
|
||||
before(suiteClientSetup)
|
||||
beforeEach(_.partial(setupClient, serverUrl))
|
||||
afterEach(teardownClient)
|
||||
|
||||
it('base', async function () {
|
||||
const tx: AccountSet = {
|
||||
TransactionType: 'AccountSet',
|
||||
Account: this.wallet.getClassicAddress(),
|
||||
}
|
||||
await testTransaction(this.client, tx, this.wallet)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user