mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
* Add test for PaymentChannelCreate * Add PaymentChannelFund test * Add PaymentChannelClaim test
33 lines
963 B
TypeScript
33 lines
963 B
TypeScript
import _ from 'lodash'
|
|
|
|
import { PaymentChannelCreate } from 'xrpl-local'
|
|
|
|
import serverUrl from '../serverUrl'
|
|
import { setupClient, suiteClientSetup, teardownClient } from '../setup'
|
|
import { generateFundedWallet, testTransaction } from '../utils'
|
|
|
|
// how long before each test case times out
|
|
const TIMEOUT = 20000
|
|
|
|
describe('PaymentChannelCreate', function () {
|
|
this.timeout(TIMEOUT)
|
|
|
|
before(suiteClientSetup)
|
|
beforeEach(_.partial(setupClient, serverUrl))
|
|
afterEach(teardownClient)
|
|
|
|
it('base', async function () {
|
|
const wallet2 = await generateFundedWallet(this.client)
|
|
const paymentChannelCreate: PaymentChannelCreate = {
|
|
TransactionType: 'PaymentChannelCreate',
|
|
Account: this.wallet.getClassicAddress(),
|
|
Amount: '100',
|
|
Destination: wallet2.getClassicAddress(),
|
|
SettleDelay: 86400,
|
|
PublicKey: this.wallet.publicKey,
|
|
}
|
|
|
|
await testTransaction(this.client, paymentChannelCreate, this.wallet)
|
|
})
|
|
})
|