Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const StakingInfo = ({ isExpanded, flow }: StakingInfoProps) => {

if (!account) return null;

// TODO: this is only for Ethereum
const daysToAddToPoolInitial = getDaysToAddToPoolInitial(validatorsQueue);
const infoRowsData = getInfoRowsData(account, flow, daysToAddToPoolInitial);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export const ConfirmStakeModal = ({
const account = useSelector(selectSelectedAccount);
const validatorsQueue = useSelector(state => selectValidatorsQueueData(state, account?.symbol));

const daysToAddToPoolInitial = getDaysToAddToPoolInitial(validatorsQueue);
const daysToAddToPool = daysToAddToPoolInitial === undefined ? 30 : daysToAddToPoolInitial;
const daysToAddToPool = getDaysToAddToPoolInitial(validatorsQueue);

const isDisabled = !hasAgreed || isLoading;

Expand Down
4 changes: 3 additions & 1 deletion suite-common/staking/src/__fixtures__/ethereumStaking.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ETH_NETWORK_ADDRESSES } from '@everstake/wallet-sdk-ethereum';

import { DAYS_TO_ADD_TO_POOL_DEFAULT } from '@suite-common/wallet-constants';

export const transformTxFixtures = [
{
description:
Expand Down Expand Up @@ -604,7 +606,7 @@ export const getDaysToAddToPoolInitialFixture = [
args: {
validatorsQueue: {}, // validatorAddingDelay and validatorActivationTime are undefined
},
result: undefined,
result: DAYS_TO_ADD_TO_POOL_DEFAULT,
},
{
description: 'should return the number of days to wait',
Expand Down
3 changes: 2 additions & 1 deletion suite-common/staking/src/utils/ethereumStaking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { fromWei, numberToHex, toWei } from 'web3-utils';

import { type NetworkSymbol, getNetworkDisplaySymbol } from '@suite-common/wallet-config';
import {
DAYS_TO_ADD_TO_POOL_DEFAULT,
DEFAULT_PAYMENT,
MIN_ETH_AMOUNT_FOR_STAKING,
STAKE_GAS_LIMIT_RESERVE,
Expand Down Expand Up @@ -592,7 +593,7 @@ export const getDaysToAddToPoolInitial = (validatorsQueue?: ValidatorsQueue) =>
validatorsQueue?.validatorAddingDelay === undefined ||
validatorsQueue?.validatorActivationTime === undefined
) {
return undefined;
return DAYS_TO_ADD_TO_POOL_DEFAULT;
}

const secondsToWait =
Expand Down
2 changes: 2 additions & 0 deletions suite-common/wallet-constants/src/ethereumStakingConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ export const BACKUP_REWARD_PAYOUT_DAYS = 7;

// Used when Everstake unstaking period is not available from the API.
export const UNSTAKING_ETH_PERIOD = 3;

export const DAYS_TO_ADD_TO_POOL_DEFAULT = 30;
Loading