proto-signing: Allow customizable sign mode in makeAuthBytes

This commit is contained in:
willclarktech 2020-10-21 18:02:52 +02:00
parent c677990550
commit c1cf37380e
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
2 changed files with 3 additions and 1 deletions

View File

@ -14,13 +14,14 @@ export function makeAuthInfoBytes(
feeAmount: readonly cosmos.base.v1beta1.Coin[],
gasLimit: number,
sequence: number,
signMode = cosmos.tx.signing.v1beta1.SignMode.SIGN_MODE_DIRECT,
): Uint8Array {
const authInfo = {
signerInfos: pubkeys.map(
(pubkey): cosmos.tx.v1beta1.ISignerInfo => ({
publicKey: pubkey,
modeInfo: {
single: { mode: cosmos.tx.signing.v1beta1.SignMode.SIGN_MODE_DIRECT },
single: { mode: signMode },
},
sequence: sequence ? Long.fromNumber(sequence) : undefined,
}),

View File

@ -7,6 +7,7 @@ export declare function makeAuthInfoBytes(
feeAmount: readonly cosmos.base.v1beta1.Coin[],
gasLimit: number,
sequence: number,
signMode?: cosmos.tx.signing.v1beta1.SignMode,
): Uint8Array;
export declare function makeSignDoc(
bodyBytes: Uint8Array,