From a17b5db11a030dbb623ca588ee899f598c79fa3f Mon Sep 17 00:00:00 2001 From: wa-aal <93649819+wa-aal@users.noreply.github.com> Date: Wed, 9 Mar 2022 16:13:25 +0100 Subject: [PATCH] Cosmos JS (#1793) * be more conform between optimistic and final operation * use old code logic * fix senders/recipients regression Co-authored-by: Alexandre Alouit --- src/families/cosmos/js-signOperation.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/families/cosmos/js-signOperation.ts b/src/families/cosmos/js-signOperation.ts index 0a0fec6449..8df1b524db 100644 --- a/src/families/cosmos/js-signOperation.ts +++ b/src/families/cosmos/js-signOperation.ts @@ -133,6 +133,23 @@ const signOperation = ({ }); } + if (transaction.mode === "send") { + senders.push(account.freshAddress); + recipients.push(transaction.recipient); + } + + if (transaction.mode === "redelegate") { + Object.assign(extra, { + cosmosSourceValidator: transaction.cosmosSourceValidator, + }); + } + + if (transaction.mode !== "send") { + Object.assign(extra, { + validators: transaction.validators, + }); + } + // build optimistic operation const operation: Operation = { id: encodeOperationId(accountId, hash, type),