mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Rename to StdSignDoc
This commit is contained in:
parent
33d55e6923
commit
3e7ab8ac52
@ -21,7 +21,12 @@ function sortJson(json: any): any {
|
||||
return result;
|
||||
}
|
||||
|
||||
interface SignJson {
|
||||
/**
|
||||
* The document to be signed
|
||||
*
|
||||
* @see https://docs.cosmos.network/master/modules/auth/03_types.html#stdsigndoc
|
||||
*/
|
||||
interface StdSignDoc {
|
||||
readonly account_number: string;
|
||||
readonly chain_id: string;
|
||||
readonly fee: StdFee;
|
||||
@ -38,7 +43,7 @@ export function makeSignBytes(
|
||||
accountNumber: number,
|
||||
sequence: number,
|
||||
): Uint8Array {
|
||||
const signJson: SignJson = {
|
||||
const signDoc: StdSignDoc = {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
account_number: accountNumber.toString(),
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
@ -48,6 +53,6 @@ export function makeSignBytes(
|
||||
msgs: msgs,
|
||||
sequence: sequence.toString(),
|
||||
};
|
||||
const signMsg = sortJson(signJson);
|
||||
return toUtf8(JSON.stringify(signMsg));
|
||||
const sortedSignDoc = sortJson(signDoc);
|
||||
return toUtf8(JSON.stringify(sortedSignDoc));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user