From 75729eafeeb3a9b4b56f5f84592dd8f86a1a2269 Mon Sep 17 00:00:00 2001 From: SrikanthSoparla Date: Tue, 17 Dec 2024 14:53:28 +0530 Subject: [PATCH] claim all fixes. --- src/containers/Home/ClaimDialog/index.js | 5 ++--- src/containers/NavBar/index.js | 8 ++++---- .../Stake/DelegateDialog/TokensTextField.js | 2 +- src/helper.js | 16 +++++++--------- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/containers/Home/ClaimDialog/index.js b/src/containers/Home/ClaimDialog/index.js index 72c928d..6fa3627 100644 --- a/src/containers/Home/ClaimDialog/index.js +++ b/src/containers/Home/ClaimDialog/index.js @@ -11,13 +11,12 @@ import { import { connect } from 'react-redux'; import '../../Stake/DelegateDialog/index.css'; import ValidatorsSelectField from './ValidatorsSelectField'; -import { claimTransaction, cosmoStationSign, signTxAndBroadcast } from '../../../helper'; +import { claimTransaction } from '../../../helper'; import { showMessage } from '../../../actions/snackbar'; import { fetchRewards, fetchVestingBalance, getBalance } from '../../../actions/accounts'; import { config } from '../../../config'; import variables from '../../../utils/variables'; import CircularProgress from '../../../components/CircularProgress'; -import { gas } from '../../../defaultGasValues'; import BigNumber from 'bignumber.js'; const ClaimDialog = (props) => { @@ -37,7 +36,7 @@ const ClaimDialog = (props) => { chainId: config.CHAIN_ID, publicKey: props.details && props.details.publicKey, }; - + const msg = []; if (props.rewards && props.rewards.length) { props.rewards.map((item) => { diff --git a/src/containers/NavBar/index.js b/src/containers/NavBar/index.js index 8df6f34..d79737f 100644 --- a/src/containers/NavBar/index.js +++ b/src/containers/NavBar/index.js @@ -91,13 +91,13 @@ class NavBar extends Component { // if (this.props.home && (val.status !== 'PROPOSAL_STATUS_VOTING_PERIOD')) { // return null; // } - + // array.push(val.proposal_id); // } // if (val.status === 2 || val.status === 'PROPOSAL_STATUS_VOTING_PERIOD') { // this.props.fetchProposalTally(val.id); // } - + // return null; // }); // this.getProposalDetails(array && array.reverse()); @@ -114,13 +114,13 @@ class NavBar extends Component { if (this.props.home && (val.status !== 'PROPOSAL_STATUS_VOTING_PERIOD')) { return null; } - + array.push(val.proposal_id); } if (val.status === 2 || val.status === 'PROPOSAL_STATUS_VOTING_PERIOD') { this.props.fetchProposalTally(val.id); } - + return null; }); this.getProposalDetails(array && array.reverse()); diff --git a/src/containers/Stake/DelegateDialog/TokensTextField.js b/src/containers/Stake/DelegateDialog/TokensTextField.js index 4632ee9..03f5f95 100644 --- a/src/containers/Stake/DelegateDialog/TokensTextField.js +++ b/src/containers/Stake/DelegateDialog/TokensTextField.js @@ -49,7 +49,7 @@ const TokensTextField = (props) => { stakedTokens = 0; filterList.map((value) => { stakedTokens = stakedTokens + Number(value.minDenomAmount); - }) + }); stakedTokens = stakedTokens && Number(stakedTokens) / 10 ** config.COIN_DECIMALS; } } diff --git a/src/helper.js b/src/helper.js index 0857ea0..2fb22c7 100644 --- a/src/helper.js +++ b/src/helper.js @@ -622,15 +622,13 @@ export const claimTransaction = (Tx, txs, type, cb) => { const newTxs = []; const wrapperTxValue = new WrapperTxMsgValue(wrapperProps); if (Tx && Tx.length > 1) { - Tx.map((newTx) => { - (async () => { - const bondMsgValue = new ClaimRewardsMsgValue({ - source: newTx.source, - validator: newTx.validator, - }); - const encoded = await tx.buildClaimRewards(wrapperTxValue, bondMsgValue); - newTxs.push(encoded); - })(); + Tx.map(async (newTx) => { + const bondMsgValue = new ClaimRewardsMsgValue({ + source: newTx.source, + validator: newTx.validator, + }); + const encoded = await tx.buildClaimRewards(wrapperTxValue, bondMsgValue); + newTxs.push(encoded); }); } else { const bondMsgValue = new ClaimRewardsMsgValue({