From db65b0e9d2dbaedf12a1648cb0cbfff906d74f64 Mon Sep 17 00:00:00 2001 From: wa-aal <93649819+wa-aal@users.noreply.github.com> Date: Fri, 18 Feb 2022 16:13:03 +0100 Subject: [PATCH] Cosmos JS (#1716) * increase gas amplifier * fix payload construction handle payload atomic construction * More accurate gas amplifier * increase gas amplifier * use same node for calculation and broadcast * fix amount payload * fix fees/gas calculation * fix signature fix public key when account is derivate * fix fees regression * More accurate pubkey selection * don't use extra.tx_bytes * fix pubkey selection * simplify hex serialization * update transaction: more strict types * many things restruct operation builder simulate now return int prepareTransaction use patch format * accuracy more accuracy int value small refactor * remove useless isPreValidation * fix strange edge effect of ledger live desktop * Update xpub during sync * temporary enable log for bot * LL-9159 cosmos node * Update js-signOperation.ts revert back test trace for bot * fix signature * fix redelegate payload * fix payload send transaction when sendmax * fix optimistic operation type * fix typo * bugfix * fix regression * update optimistic operation fix regression add operation type more consistent fee Co-authored-by: Alexandre Alouit --- src/families/cosmos/js-signOperation.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/families/cosmos/js-signOperation.ts b/src/families/cosmos/js-signOperation.ts index f427f402b3..8180bc1e09 100644 --- a/src/families/cosmos/js-signOperation.ts +++ b/src/families/cosmos/js-signOperation.ts @@ -1,4 +1,4 @@ -import { Account, OperationType, SignOperationEvent } from "../../types"; +import { Account, Operation, OperationType, SignOperationEvent } from "../../types"; import type { Transaction } from "./types"; import { getAccount, getChainId } from "./api/Cosmos"; import { Observable } from "rxjs"; @@ -159,18 +159,18 @@ const signOperation = ({ : "OUT"; // build optimistic operation - const operation = { + const operation: Operation = { id: encodeOperationId(accountId, txHash, type), hash: txHash, type: type, value: transaction.amount, - fee: transaction.fees, + fee: transaction.fees || new BigNumber(0), extra: {}, blockHash: null, blockHeight: null, senders: [account.freshAddress], recipients: [transaction.recipient], - account: accountId, + accountId: accountId, date: new Date(), };