mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
refactor: remove client.combine (#1632)
* remove combine * remove tests * fix tests
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
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/u)
|
||||
})
|
||||
})
|
||||
@@ -66,10 +66,10 @@ describe('integration tests', function () {
|
||||
const accountSetTx = await client.autofill(accountSet, 2)
|
||||
const signed1 = sign(signerWallet1, accountSetTx, true)
|
||||
const signed2 = sign(signerWallet2, accountSetTx, true)
|
||||
const combined = multisign([signed1, signed2])
|
||||
const submitResponse = await client.submitSignedTransaction(combined)
|
||||
const multisignedTx = multisign([signed1, signed2])
|
||||
const submitResponse = await client.submitSignedTransaction(multisignedTx)
|
||||
await ledgerAccept(client)
|
||||
assert.strictEqual(submitResponse.result.engine_result, 'tesSUCCESS')
|
||||
await verifySubmittedTransaction(this.client, combined)
|
||||
await verifySubmittedTransaction(this.client, multisignedTx)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user