From e273bde452ca7349ed839c694d681d85caf316e5 Mon Sep 17 00:00:00 2001 From: Steven Yi Date: Thu, 19 Dec 2024 14:24:44 -0500 Subject: [PATCH] chore: renamed function --- src/components/forms/validation.ts | 2 +- src/components/modals/OperatorStakingModal.tsx | 2 +- src/components/modals/RedelegateModal.tsx | 4 ++-- src/components/modals/StakingModal.tsx | 4 ++-- src/components/modals/StartGatewayModal.tsx | 6 +++--- src/pages/Gateway/index.tsx | 4 ++-- tests/components/forms/validation.test.ts | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/forms/validation.ts b/src/components/forms/validation.ts index 2e7bf3cf..64697960 100644 --- a/src/components/forms/validation.ts +++ b/src/components/forms/validation.ts @@ -46,7 +46,7 @@ export const validateTransactionId = ( }; }; -export const validateIOAmount = ( +export const validateARIOAmount = ( propertyName: string, ticker: string, min: number, diff --git a/src/components/modals/OperatorStakingModal.tsx b/src/components/modals/OperatorStakingModal.tsx index a115bdbe..48578c75 100644 --- a/src/components/modals/OperatorStakingModal.tsx +++ b/src/components/modals/OperatorStakingModal.tsx @@ -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'; diff --git a/src/components/modals/RedelegateModal.tsx b/src/components/modals/RedelegateModal.tsx index 0dbe69cd..3fcb6f64 100644 --- a/src/components/modals/RedelegateModal.tsx +++ b/src/components/modals/RedelegateModal.tsx @@ -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'; @@ -96,7 +96,7 @@ const RedelegateModal = ({ const validators = useMemo( () => ({ - redelegationAmount: validateIOAmount( + redelegationAmount: validateARIOAmount( 'Redelegation Amount', ticker, minRequiredStakeToAdd, diff --git a/src/components/modals/StakingModal.tsx b/src/components/modals/StakingModal.tsx index 65114466..c11b311d 100644 --- a/src/components/modals/StakingModal.tsx +++ b/src/components/modals/StakingModal.tsx @@ -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'; @@ -70,7 +70,7 @@ const StakingModal = ({ const validators = { address: validateWalletAddress('Gateway Owner'), - stakeAmount: validateIOAmount( + stakeAmount: validateARIOAmount( 'Stake Amount', ticker, minRequiredStakeToAdd, diff --git a/src/components/modals/StartGatewayModal.tsx b/src/components/modals/StartGatewayModal.tsx index 56224b41..503d13c6 100644 --- a/src/components/modals/StartGatewayModal.tsx +++ b/src/components/modals/StartGatewayModal.tsx @@ -9,7 +9,7 @@ import FormRow, { RowType } from '../forms/FormRow'; import { FormRowDef, isFormValid } from '../forms/formData'; import { validateDomainName, - validateIOAmount, + validateARIOAmount, validateNumberRange, validateString, validateTransactionId, @@ -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', @@ -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', diff --git a/src/pages/Gateway/index.tsx b/src/pages/Gateway/index.tsx index f57c8f95..601270db 100644 --- a/src/pages/Gateway/index.tsx +++ b/src/pages/Gateway/index.tsx @@ -14,7 +14,7 @@ import { } from '@src/components/forms/formData'; import { validateDomainName, - validateIOAmount, + validateARIOAmount, validateNumberRange, validateString, validateTransactionId, @@ -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, diff --git a/tests/components/forms/validation.test.ts b/tests/components/forms/validation.test.ts index 17634bf4..cd345865 100644 --- a/tests/components/forms/validation.test.ts +++ b/tests/components/forms/validation.test.ts @@ -1,6 +1,6 @@ import { validateDomainName, - validateIOAmount, + validateARIOAmount, validateNumberRange, validateString, validateTransactionId, @@ -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(