Add macrocoinToMicrocoin to validaiton
This commit is contained in:
parent
678aef8632
commit
ed86c3fdd6
@ -58,6 +58,13 @@ const MsgCreateVestingAccountForm = ({
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
macroCoinToMicroCoin({ denom: chain.displayDenom, amount }, chain.assets);
|
||||
} catch (e: unknown) {
|
||||
setAmountError(e instanceof Error ? e.message : "Could not set decimals");
|
||||
return false;
|
||||
}
|
||||
|
||||
const timeoutDate = new Date(Number(timestampFromDatetimeLocal(endTime, "ms")));
|
||||
if (timeoutDate <= new Date()) {
|
||||
setEndTimeError("End time must be a date in the future");
|
||||
|
||||
@ -46,6 +46,13 @@ const MsgDelegateForm = ({ delegatorAddress, setMsgGetter, deleteMsg }: MsgDeleg
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
macroCoinToMicroCoin({ denom: chain.displayDenom, amount }, chain.assets);
|
||||
} catch (e: unknown) {
|
||||
setAmountError(e instanceof Error ? e.message : "Could not set decimals");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@ -86,6 +86,13 @@ const MsgExecuteContractForm = ({
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
macroCoinToMicroCoin({ denom, amount }, chain.assets);
|
||||
} catch (e: unknown) {
|
||||
setAmountError(e instanceof Error ? e.message : "Could not set decimals");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@ -116,6 +116,13 @@ const MsgInstantiateContract2Form = ({
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
macroCoinToMicroCoin({ denom, amount }, chain.assets);
|
||||
} catch (e: unknown) {
|
||||
setAmountError(e instanceof Error ? e.message : "Could not set decimals");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@ -102,6 +102,13 @@ const MsgInstantiateContractForm = ({
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
macroCoinToMicroCoin({ denom, amount }, chain.assets);
|
||||
} catch (e: unknown) {
|
||||
setAmountError(e instanceof Error ? e.message : "Could not set decimals");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@ -61,6 +61,13 @@ const MsgRedelegateForm = ({
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
macroCoinToMicroCoin({ denom: chain.displayDenom, amount }, chain.assets);
|
||||
} catch (e: unknown) {
|
||||
setAmountError(e instanceof Error ? e.message : "Could not set decimals");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@ -72,6 +72,13 @@ const MsgSendForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgSendFormProps)
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
macroCoinToMicroCoin({ denom, amount }, chain.assets);
|
||||
} catch (e: unknown) {
|
||||
setAmountError(e instanceof Error ? e.message : "Could not set decimals");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@ -50,6 +50,13 @@ const MsgUndelegateForm = ({
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
macroCoinToMicroCoin({ denom: chain.displayDenom, amount }, chain.assets);
|
||||
} catch (e: unknown) {
|
||||
setAmountError(e instanceof Error ? e.message : "Could not set decimals");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user