mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
* lint broadcastClient * lint client * fix most of connection * remove unused files * lint mockRippled * lint mockRippledTest * lint runClientTests * lint setupClient * lint setupClientWeb * lint shamap * lint testUtils * resolve tsc issues * Fix tests * lint rest of connection * respond to comments
31 lines
998 B
TypeScript
31 lines
998 B
TypeScript
import { assert } from 'chai'
|
|
import binary from 'ripple-binary-codec'
|
|
|
|
import requests from '../fixtures/requests'
|
|
import responses from '../fixtures/responses'
|
|
import { setupClient, teardownClient } from '../setupClient'
|
|
import { assertResultMatch } from '../testUtils'
|
|
|
|
const { combine: REQUEST_FIXTURES } = requests
|
|
const { combine: RESPONSE_FIXTURES } = responses
|
|
|
|
describe('client.combine', function () {
|
|
beforeEach(setupClient)
|
|
afterEach(teardownClient)
|
|
|
|
it('combine', async function () {
|
|
const combined = this.client.combine(REQUEST_FIXTURES.setDomain)
|
|
assertResultMatch(combined, RESPONSE_FIXTURES.single, 'sign')
|
|
})
|
|
|
|
it('combine - different transactions', async function () {
|
|
const request = [REQUEST_FIXTURES.setDomain[0]]
|
|
const tx = binary.decode(REQUEST_FIXTURES.setDomain[0])
|
|
tx.Flags = 0
|
|
request.push(binary.encode(tx))
|
|
assert.throws(() => {
|
|
this.client.combine(request)
|
|
}, /txJSON is not the same for all signedTransactions/)
|
|
})
|
|
})
|