diff --git a/components/forms/CreateTxForm/MsgForm/MsgMigrateContractForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgMigrateContractForm.tsx index 647db1d..d89f48b 100644 --- a/components/forms/CreateTxForm/MsgForm/MsgMigrateContractForm.tsx +++ b/components/forms/CreateTxForm/MsgForm/MsgMigrateContractForm.tsx @@ -24,29 +24,29 @@ const MsgMigrateContractForm = ({ }: MsgMigrateContractFormProps) => { const { chain } = useChains(); - const [codeId, setCodeId] = useState(""); const [contractAddress, setContractAddress] = useState(""); + const [codeId, setCodeId] = useState(""); const [msgContent, setMsgContent] = useState("{}"); - const [codeIdError, setCodeIdError] = useState(""); const [contractAddressError, setContractAddressError] = useState(""); + const [codeIdError, setCodeIdError] = useState(""); useEffect(() => { setCodeIdError(""); setContractAddressError(""); const isMsgValid = (): boolean => { - if (!codeId || !Number.isSafeInteger(Number(codeId)) || Number(codeId) <= 0) { - setCodeIdError("Code ID must be a positive integer"); - return false; - } - const addressErrorMsg = checkAddress(contractAddress, chain.addressPrefix); if (addressErrorMsg) { setContractAddressError(`Invalid address for network ${chain.chainId}: ${addressErrorMsg}`); return false; } + if (!codeId || !Number.isSafeInteger(Number(codeId)) || Number(codeId) <= 0) { + setCodeIdError("Code ID must be a positive integer"); + return false; + } + return true; }; @@ -85,15 +85,6 @@ const MsgMigrateContractForm = ({ ✕

MsgMigrateContract

-
- setCodeId(target.value)} - error={codeIdError} - /> -
+
+ setCodeId(target.value)} + error={codeIdError} + /> +