Files
xahau.js/test/client/combine.ts
Mayukha Vadari 949cc031ee Lints top-level test files (#1594)
* 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
2021-10-04 14:10:12 -04:00

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/)
})
})