From 83e1a98740d22ed41e497a42b44e1e53f7c2984a Mon Sep 17 00:00:00 2001 From: wa-aal <93649819+wa-aal@users.noreply.github.com> Date: Fri, 11 Mar 2022 09:53:05 +0100 Subject: [PATCH] Cosmos JS (#1800) * be more conform between optimistic and final operation * use old code logic * fix senders/recipients regression * fix duplicate data * fix duplicate data (again) * append block height * fix specific empty amount case in reward transaction * temporary debug operation broadcasted * use toOperationRaw method * return patchedOperation Co-authored-by: Alexandre Alouit --- src/families/cosmos/api/Cosmos.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/families/cosmos/api/Cosmos.ts b/src/families/cosmos/api/Cosmos.ts index c515b08ed7..7eb3073633 100644 --- a/src/families/cosmos/api/Cosmos.ts +++ b/src/families/cosmos/api/Cosmos.ts @@ -3,6 +3,8 @@ import BigNumber from "bignumber.js"; import network from "../../../network"; import { Operation } from "../../../types"; import { patchOperationWithHash } from "../../../operation"; +import { log } from "@ledgerhq/logs"; +import { toOperationRaw } from "../../../account"; const defaultEndpoint = getEnv( "API_COSMOS_BLOCKCHAIN_EXPLORER_API_ENDPOINT" @@ -281,8 +283,12 @@ export const broadcast = async ({ ); } - return patchOperationWithHash( + const patchedOperation = patchOperationWithHash( { ...operation, blockHeight: data.tx_response.height }, data.tx_response.txhash ); + + log("info", "debug operation: ", toOperationRaw(patchedOperation)); + + return patchedOperation; };