Skip to content

Commit

Permalink
chore: renamed function
Browse files Browse the repository at this point in the history
  • Loading branch information
kunstmusik committed Dec 19, 2024
1 parent 8942390 commit e273bde
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/forms/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const validateTransactionId = (
};
};

export const validateIOAmount = (
export const validateARIOAmount = (
propertyName: string,
ticker: string,
min: number,
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/OperatorStakingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Button, { ButtonType } from '../Button';
import LabelValueRow from '../LabelValueRow';
import Tooltip from '../Tooltip';
import ErrorMessageIcon from '../forms/ErrorMessageIcon';
import { validateIOAmount as validateARIOAmount } from '../forms/validation';
import { validateARIOAmount as validateARIOAmount } from '../forms/validation';
import { InfoIcon } from '../icons';
import BaseModal from './BaseModal';
import ReviewStakeModal from './ReviewStakeModal';
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/RedelegateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import GatewaySelector from '../GatewaySelector';
import LabelValueRow from '../LabelValueRow';
import Tooltip from '../Tooltip';
import ErrorMessageIcon from '../forms/ErrorMessageIcon';
import { validateIOAmount } from '../forms/validation';
import { validateARIOAmount } from '../forms/validation';
import BaseModal from './BaseModal';
import ReviewRedelegateModal from './ReviewRedelegateModal';
import { REDELEGATION_FEE_TOOLTIP_TEXT } from '@src/constants';
Expand Down Expand Up @@ -96,7 +96,7 @@ const RedelegateModal = ({

const validators = useMemo(
() => ({
redelegationAmount: validateIOAmount(
redelegationAmount: validateARIOAmount(
'Redelegation Amount',
ticker,
minRequiredStakeToAdd,
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/StakingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Button, { ButtonType } from '../Button';
import LabelValueRow from '../LabelValueRow';
import Tooltip from '../Tooltip';
import ErrorMessageIcon from '../forms/ErrorMessageIcon';
import { validateIOAmount, validateWalletAddress } from '../forms/validation';
import { validateARIOAmount, validateWalletAddress } from '../forms/validation';
import { InfoIcon } from '../icons';
import BaseModal from './BaseModal';
import ReviewStakeModal from './ReviewStakeModal';
Expand Down Expand Up @@ -70,7 +70,7 @@ const StakingModal = ({

const validators = {
address: validateWalletAddress('Gateway Owner'),
stakeAmount: validateIOAmount(
stakeAmount: validateARIOAmount(
'Stake Amount',
ticker,
minRequiredStakeToAdd,
Expand Down
6 changes: 3 additions & 3 deletions src/components/modals/StartGatewayModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import FormRow, { RowType } from '../forms/FormRow';
import { FormRowDef, isFormValid } from '../forms/formData';
import {
validateDomainName,
validateIOAmount,
validateARIOAmount,
validateNumberRange,
validateString,
validateTransactionId,
Expand Down Expand Up @@ -92,7 +92,7 @@ const StartGatewayModal = ({ onClose }: { onClose: () => void }) => {
formPropertyName: 'stake',
label: `*Stake (${ticker}):`,
placeholder: `Minimum ${GATEWAY_OPERATOR_STAKE_MINIMUM_ARIO} ${ticker}`,
validateProperty: validateIOAmount('Stake', ticker, GATEWAY_OPERATOR_STAKE_MINIMUM_ARIO),
validateProperty: validateARIOAmount('Stake', ticker, GATEWAY_OPERATOR_STAKE_MINIMUM_ARIO),
},
{
formPropertyName: 'allowDelegatedStaking',
Expand All @@ -105,7 +105,7 @@ const StartGatewayModal = ({ onClose }: { onClose: () => void }) => {
placeholder: allowDelegatedStaking
? `Minimum 10 ${ticker}`
: 'Enable Delegated Staking to set this value.',
validateProperty: validateIOAmount('Minimum Delegated Stake', ticker, 10),
validateProperty: validateARIOAmount('Minimum Delegated Stake', ticker, 10),
},
{
formPropertyName: 'delegatedStakingShareRatio',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Gateway/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '@src/components/forms/formData';
import {
validateDomainName,
validateIOAmount,
validateARIOAmount,
validateNumberRange,
validateString,
validateTransactionId,
Expand Down Expand Up @@ -201,7 +201,7 @@ const Gateway = () => {
placeholder: delegatedStakingEnabled
? `Minimum 10 ${ticker}`
: 'Enable Delegated Staking to set this value.',
validateProperty: validateIOAmount(
validateProperty: validateARIOAmount(
'Minumum Delegated Stake',
ticker,
10,
Expand Down
4 changes: 2 additions & 2 deletions tests/components/forms/validation.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
validateDomainName,
validateIOAmount,
validateARIOAmount,
validateNumberRange,
validateString,
validateTransactionId,
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('Form Validation Functions', () => {
});

describe('validateIOAmount', () => {
const validator = validateIOAmount('tIO Amount', 'tIO', 10, 100);
const validator = validateARIOAmount('tIO Amount', 'tIO', 10, 100);

it('should fail for empty string', () => {
expect(validator('')).toEqual(
Expand Down

0 comments on commit e273bde

Please sign in to comment.