Skip to content

Commit

Permalink
claim all fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SrikanthSoparla committed Dec 17, 2024
1 parent 8a85ab9 commit 75729ea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
5 changes: 2 additions & 3 deletions src/containers/Home/ClaimDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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) => {
Expand Down
8 changes: 4 additions & 4 deletions src/containers/NavBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Stake/DelegateDialog/TokensTextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
16 changes: 7 additions & 9 deletions src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 75729ea

Please sign in to comment.