From 4737c978df992944db8cb6c1ed6cb2e05c53e4ad Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Tue, 17 Jan 2023 12:09:06 +0200 Subject: [PATCH 1/2] CUDOS-2088 / Fix inject withdraw reward type --- src/components/msg/mutate/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/msg/mutate/index.tsx b/src/components/msg/mutate/index.tsx index f2a6cb6235..5c38819aa2 100644 --- a/src/components/msg/mutate/index.tsx +++ b/src/components/msg/mutate/index.tsx @@ -28,7 +28,7 @@ const insertMissingWithdrawRewardsMsgWhenDelegating = (transaction: any) => { for (let i = 0; i < messages.length; i += 1) { const model = getMessageModelByType(messages[i]?.['@type']); - if (model === MODELS.MsgDelegate) { + if (model === MODELS.MsgRedelegate) { const coinReceivedEvent = getEventAtIndex(transaction, i, 'coin_received'); const coinSpentEvent = getEventAtIndex(transaction, i, 'coin_spent'); @@ -66,12 +66,12 @@ const getEventAtIndex = (transaction: any, index: number, eventType: string) => } }; -const buildWithdrawRewardsMessage = (delegateMsg: any, coinReceivedEvent: any, +const buildWithdrawRewardsMessage = (redelegateMsg: any, coinReceivedEvent: any, coinSpentEvent: any) => { const withdrawMsg = { '@type': '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', - delegator_address: delegateMsg.delegator_address, - validator_address: delegateMsg.validator_address, + delegator_address: redelegateMsg.delegator_address, + validator_address: redelegateMsg.validator_src_address, }; const events = []; @@ -126,7 +126,7 @@ const buildWithdrawRewardsMessage = (delegateMsg: any, coinReceivedEvent: any, key: 'amount', value: coinReceivedEvent.attributes[1].value, }, { - key: 'validator', value: delegateMsg.validator_address, + key: 'validator', value: redelegateMsg.validator_src_address, }, ])); From 9643c61bb7130ae67ccd90be830541d04d4871c7 Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Tue, 17 Jan 2023 12:22:16 +0200 Subject: [PATCH 2/2] update next.config.js to enable client-side debug --- next.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/next.config.js b/next.config.js index 6857806c1b..d3ee1b9466 100644 --- a/next.config.js +++ b/next.config.js @@ -2,6 +2,7 @@ const nextTranslate = require('next-translate'); module.exports = nextTranslate({ poweredByHeader: false, + productionBrowserSourceMaps: true, webpack: (config) => { config.module.rules.push({ test: /\.svg$/,