diff --git a/packages/page-staking/src/Actions/Account/BondExtra.tsx b/packages/page-staking/src/Actions/Account/BondExtra.tsx index 1417a05520..3a608c03b0 100644 --- a/packages/page-staking/src/Actions/Account/BondExtra.tsx +++ b/packages/page-staking/src/Actions/Account/BondExtra.tsx @@ -14,7 +14,6 @@ import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { withCalls, withApi, withMulti } from '@polkadot/react-api/hoc'; import translate from '../../translate'; -import detectUnsafe from '../../unsafeChains'; import ValidateAmount from './InputValidateAmount'; interface Props extends I18nProps, ApiProps, CalculateBalanceProps { @@ -72,9 +71,8 @@ class BondExtra extends TxComponent { } private renderContent (): React.ReactNode { - const { stashId, systemChain, t } = this.props; + const { stashId, t } = this.props; const { amountError, maxAdditional, maxBalance } = this.state; - const isUnsafeChain = detectUnsafe(systemChain); return ( @@ -94,7 +92,6 @@ class BondExtra extends TxComponent { maxValue={maxBalance} onChange={this.onChangeValue} onEnter={this.sendTx} - withMax={!isUnsafeChain} /> void; } -const DISTINCT = 'Distinct stash and controller accounts are recommended to ensure fund security.'; - -function ValidateController ({ accountId, controllerId, defaultController, isUnsafeChain, onError }: Props): React.ReactElement | null { +function ValidateController ({ accountId, controllerId, defaultController, onError }: Props): React.ReactElement | null { const { t } = useTranslation(); const { api } = useApi(); const bondedId = useCall(api.query.staking.bonded, [controllerId], { @@ -45,9 +42,7 @@ function ValidateController ({ accountId, controllerId, defaultController, isUns let newError: string | null = null; if (controllerId === accountId) { - newError = isUnsafeChain - ? t(`${DISTINCT} You will be allowed to make the transaction, but take care to not tie up all funds, only use a portion of the available funds during this period.`) - : t(DISTINCT); + newError = t('Distinct stash and controller accounts are recommended to ensure fund security. You will be allowed to make the transaction, but take care to not tie up all funds, only use a portion of the available funds during this period.'); } else if (bondedId) { newError = t('A controller account should not map to another stash. This selected controller is a stash, controlled by {{bondedId}}', { replace: { bondedId } }); } else if (stashId) { diff --git a/packages/page-staking/src/Actions/Account/SetControllerAccount.tsx b/packages/page-staking/src/Actions/Account/SetControllerAccount.tsx index 4b95b2d7c6..2961364a33 100644 --- a/packages/page-staking/src/Actions/Account/SetControllerAccount.tsx +++ b/packages/page-staking/src/Actions/Account/SetControllerAccount.tsx @@ -10,7 +10,6 @@ import { Icon, InputAddress, Modal, TxButton, TxComponent } from '@polkadot/reac import { withApi, withMulti } from '@polkadot/react-api/hoc'; import translate from '../../translate'; -import detectUnsafe from '../../unsafeChains'; import InputValidationController from '../Account/InputValidationController'; interface Props extends ApiProps, I18nProps { @@ -36,10 +35,9 @@ class SetControllerAccount extends TxComponent { } public render (): React.ReactNode { - const { defaultControllerId, isValidating, onClose, stashId, systemChain, t } = this.props; - const { controllerError, controllerId } = this.state; - const isUnsafeChain = detectUnsafe(systemChain); - const canSubmit = isUnsafeChain || (!controllerError && !!controllerId && (defaultControllerId !== controllerId)); + const { defaultControllerId, isValidating, onClose, stashId, t } = this.props; + const { controllerId } = this.state; + const canSubmit = !!controllerId; return ( { className='medium' defaultValue={defaultControllerId} help={t('The controller is the account that will be used to control any nominating or validating actions. Should not match another stash or controller.')} - isError={!isUnsafeChain && !!controllerError} label={t('controller account')} onChange={this.onChangeController} type='account' @@ -76,7 +73,6 @@ class SetControllerAccount extends TxComponent { accountId={stashId} defaultController={defaultControllerId} controllerId={controllerId} - isUnsafeChain={isUnsafeChain} onError={this.onControllerError} /> diff --git a/packages/page-staking/src/Actions/NewStake.tsx b/packages/page-staking/src/Actions/NewStake.tsx index 57219cd5fc..a00577f769 100644 --- a/packages/page-staking/src/Actions/NewStake.tsx +++ b/packages/page-staking/src/Actions/NewStake.tsx @@ -13,7 +13,6 @@ import { Dropdown, InputAddress, InputBalanceBonded, Modal, TxButton, TxComponen import { withApi, withMulti } from '@polkadot/react-api/hoc'; import translate from '../translate'; -import detectUnsafe from '../unsafeChains'; import InputValidateAmount from './Account/InputValidateAmount'; import InputValidationController from './Account/InputValidationController'; import { rewardDestinationOptions } from './constants'; @@ -49,11 +48,10 @@ class NewStake extends TxComponent { } public render (): React.ReactNode { - const { onClose, systemChain, t } = this.props; - const { amountError, bondValue, controllerError, controllerId, destination, extrinsic, stashId } = this.state; + const { onClose, t } = this.props; + const { amountError, bondValue, controllerId, destination, extrinsic, stashId } = this.state; const hasValue = !!bondValue && bondValue.gtn(0); - const isUnsafeChain = detectUnsafe(systemChain); - const canSubmit = (hasValue && (isUnsafeChain || (!controllerError && !!controllerId))); + const canSubmit = hasValue && !!controllerId; return ( { { { onChange={this.onChangeValue} onEnter={this.sendTx} stashId={stashId} - withMax={!isUnsafeChain} />