Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Cosmos JS #1801

Merged
21 commits merged into from Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f155a8c
be more conform between optimistic and final operation
alexalouit Mar 8, 2022
24fa16d
use old code logic
alexalouit Mar 9, 2022
9c4dee1
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 9, 2022
3b0a03c
fix senders/recipients regression
alexalouit Mar 9, 2022
d68156c
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 9, 2022
69d62dd
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 9, 2022
86f5367
fix duplicate data
alexalouit Mar 9, 2022
85dddb6
fix duplicate data (again)
alexalouit Mar 9, 2022
c92c461
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 9, 2022
2480c1a
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 9, 2022
565e8be
append block height
alexalouit Mar 9, 2022
4211fb5
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 10, 2022
489cdd8
fix specific empty amount case in reward transaction
alexalouit Mar 10, 2022
5a6b0c6
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 10, 2022
b93e846
temporary debug operation broadcasted
alexalouit Mar 10, 2022
6379b0a
use toOperationRaw method
alexalouit Mar 11, 2022
f05abf7
return patchedOperation
alexalouit Mar 11, 2022
8bda82c
restore broadcast operation
alexalouit Mar 11, 2022
607f359
Update js-synchronisation.ts
alexalouit Mar 11, 2022
eb7198f
remove block height support
alexalouit Mar 11, 2022
ecf61d5
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/families/cosmos/api/Cosmos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ 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"
Expand Down Expand Up @@ -283,12 +281,5 @@ export const broadcast = async ({
);
}

const patchedOperation = patchOperationWithHash(
{ ...operation, blockHeight: data.tx_response.height },
data.tx_response.txhash
);

log("info", "debug operation: ", toOperationRaw(patchedOperation));

return patchedOperation;
return patchOperationWithHash(operation, data.tx_response.txhash);
};
10 changes: 5 additions & 5 deletions src/families/cosmos/js-synchronisation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Account, Operation } from "../../types";
import { Account, Operation, OperationType } from "../../types";
import { BigNumber } from "bignumber.js";
import { makeSync, GetAccountShape, mergeOps } from "../../bridge/jsHelpers";
import { encodeAccountId } from "../../account";
Expand All @@ -20,13 +20,13 @@ const txToOps = (info: any, id: string, txs: any): Operation[] => {
const op: Operation = {
id: "",
hash: tx.txhash,
type: "" as any,
type: "" as OperationType,
value: new BigNumber(0),
fee: fees,
blockHash: null,
blockHeight: tx.height,
senders: [] as any,
recipients: [] as any,
blockHeight: null,
senders: [] as string[],
recipients: [] as string[],
accountId: id,
date: new Date(tx.timestamp),
extra: {
Expand Down