Skip to content

Nym node - Fix claim delegator rewards #5090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
1 change: 0 additions & 1 deletion explorer/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export const isLessThan = (a: number, b: number) => a < b;
*/

export const isBalanceEnough = (fee: string, tx: string = '0', balance: string = '0') => {
console.log('balance', balance, fee, tx);
try {
return Big(balance).gte(Big(fee).plus(Big(tx)));
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { simulateClaimOperatorReward, simulateVestingClaimOperatorReward } from
import { AppContext } from 'src/context';
import { BalanceWarning } from 'src/components/FeeWarning';
import { Box } from '@mui/material';
import { TBondedMixnode } from 'src/requests/mixnodeDetails';
import { TBondedNymNode } from 'src/requests/nymNodeDetails';

export const RedeemRewardsModal = ({
node,
onConfirm,
onError,
onClose,
}: {
node: TBondedMixnode;
node: TBondedNymNode;
onConfirm: (fee?: FeeDetails) => Promise<void>;
onError: (err: string) => void;
onClose: () => void;
Expand All @@ -28,11 +28,6 @@ export const RedeemRewardsModal = ({
if (feeError) onError(feeError);
}, [feeError]);

useEffect(() => {
if (node.proxy) getFee(simulateVestingClaimOperatorReward, {});
else getFee(simulateClaimOperatorReward, {});
}, []);

const handleOnOK = async () => onConfirm(fee);

return (
Expand Down
2 changes: 1 addition & 1 deletion nym-wallet/src/pages/bonding/Bonding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export const Bonding = () => {
/>
)}

{showModal === 'redeem' && bondedNode && isMixnode(bondedNode) && (
{showModal === 'redeem' && bondedNode && isNymNode(bondedNode) && (
<RedeemRewardsModal
node={bondedNode}
onClose={() => setShowModal(undefined)}
Expand Down
2 changes: 1 addition & 1 deletion nym-wallet/src/requests/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
NodeConfigUpdate,
GatewayConfigUpdate,
} from '@nymproject/types';
import { TBondGatewayArgs, TBondGatewaySignatureArgs, TNodeConfigUpdateArgs } from '../types';
import { TBondGatewayArgs, TBondGatewaySignatureArgs } from '../types';
import { invokeWrapper } from './wrapper';

export const bondGateway = async (args: TBondGatewayArgs) =>
Expand Down
2 changes: 1 addition & 1 deletion nym-wallet/src/requests/rewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const claimOperatorReward = async (fee?: Fee) =>

export const claimDelegatorRewards = async (mixId: number, fee?: FeeDetails) =>
invokeWrapper<TransactionExecuteResult[]>('claim_locked_and_unlocked_delegator_reward', {
mixId,
nodeId: mixId,
fee: fee?.fee,
});

Expand Down
Loading