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

Cosmos JS #1803

Merged
merged 25 commits into from Mar 11, 2022
Merged
Changes from all commits
Commits
Show all changes
25 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
44cd92f
Revert "remove block height support"
alexalouit Mar 11, 2022
7a7f6fa
More strict type
alexalouit Mar 11, 2022
8c2dcab
Merge remote-tracking branch 'upstream/cosmos-js' into cosmos-js
alexalouit Mar 11, 2022
78097b8
reverse order of validators
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
13 changes: 7 additions & 6 deletions src/families/cosmos/js-synchronisation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { encodeAccountId } from "../../account";
import { getAccountInfo } from "./api/Cosmos";
import { pubkeyToAddress, decodeBech32Pubkey } from "@cosmjs/amino";
import { encodeOperationId } from "../../operation";
import { CosmosDelegationInfo } from "./types";

const txToOps = (info: any, id: string, txs: any): Operation[] => {
const { address, currency } = info;
Expand All @@ -24,13 +25,13 @@ const txToOps = (info: any, id: string, txs: any): Operation[] => {
value: new BigNumber(0),
fee: fees,
blockHash: null,
blockHeight: null,
blockHeight: tx.height,
senders: [] as string[],
recipients: [] as string[],
accountId: id,
date: new Date(tx.timestamp),
extra: {
validators: [] as any,
validators: [] as CosmosDelegationInfo[],
},
};

Expand Down Expand Up @@ -72,8 +73,8 @@ const txToOps = (info: any, id: string, txs: any): Operation[] => {
op.type = "REWARD";
op.value = new BigNumber(fees);
op.extra.validators.push({
amount: attributes.amount.replace(currency.units[1].code, ""),
address: attributes.validator,
amount: attributes.amount.replace(currency.units[1].code, ""),
});
}
break;
Expand All @@ -86,8 +87,8 @@ const txToOps = (info: any, id: string, txs: any): Operation[] => {
op.type = "DELEGATE";
op.value = new BigNumber(fees);
op.extra.validators.push({
amount: attributes.amount.replace(currency.units[1].code, ""),
address: attributes.validator,
amount: attributes.amount.replace(currency.units[1].code, ""),
});
}
break;
Expand All @@ -102,8 +103,8 @@ const txToOps = (info: any, id: string, txs: any): Operation[] => {
op.type = "REDELEGATE";
op.value = new BigNumber(fees);
op.extra.validators.push({
amount: attributes.amount.replace(currency.units[1].code, ""),
address: attributes.destination_validator,
amount: attributes.amount.replace(currency.units[1].code, ""),
});
op.extra.cosmosSourceValidator = attributes.source_validator;
}
Expand All @@ -118,8 +119,8 @@ const txToOps = (info: any, id: string, txs: any): Operation[] => {
op.type = "UNDELEGATE";
op.value = new BigNumber(fees);
op.extra.validators.push({
amount: attributes.amount.replace(currency.units[1].code, ""),
address: attributes.validator,
amount: attributes.amount.replace(currency.units[1].code, ""),
});
}
break;
Expand Down