mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-09 11:46:42 +00:00
Change multisign to return an encoded transaction (#1615)
This commit is contained in:
committed by
Mayukha Vadari
parent
fe919315d4
commit
4f1e1d653c
@@ -3,6 +3,7 @@ import { flatMap } from 'lodash'
|
||||
import { decodeAccountID } from 'ripple-address-codec'
|
||||
import {
|
||||
decode,
|
||||
encode,
|
||||
encodeForSigning,
|
||||
encodeForSigningClaim,
|
||||
} from 'ripple-binary-codec'
|
||||
@@ -42,7 +43,7 @@ function sign(wallet: Wallet, tx: Transaction, forMultisign = false): string {
|
||||
* - The SigningPubKey field is not the empty string in any given transaction
|
||||
* - Any transaction is missing a Signers field.
|
||||
*/
|
||||
function multisign(transactions: Array<Transaction | string>): Transaction {
|
||||
function multisign(transactions: Array<Transaction | string>): string {
|
||||
if (transactions.length === 0) {
|
||||
throw new ValidationError('There were 0 transactions to multisign')
|
||||
}
|
||||
@@ -76,7 +77,7 @@ function multisign(transactions: Array<Transaction | string>): Transaction {
|
||||
|
||||
validateTransactionEquivalence(decodedTransactions)
|
||||
|
||||
return getTransactionWithAllSigners(decodedTransactions)
|
||||
return encode(getTransactionWithAllSigners(decodedTransactions))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -121,7 +121,7 @@ const multisignTxToCombine2: Transaction = {
|
||||
TransactionType: 'TrustSet',
|
||||
}
|
||||
|
||||
const expectedMultisign: Transaction = {
|
||||
const expectedMultisign: string = encode({
|
||||
Account: 'rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC',
|
||||
Fee: '30000',
|
||||
Flags: 262144,
|
||||
@@ -153,7 +153,7 @@ const expectedMultisign: Transaction = {
|
||||
],
|
||||
SigningPubKey: '',
|
||||
TransactionType: 'TrustSet',
|
||||
}
|
||||
})
|
||||
|
||||
describe('Signer', function () {
|
||||
it('sign', function () {
|
||||
|
||||
Reference in New Issue
Block a user