show error on type mismatch for constructor args

pull/3895/head
Aniket-Engg 1 year ago committed by Aniket
parent eebf498cd0
commit 60ae9751b7
  1. 9
      libs/remix-ui/run-tab/src/lib/actions/deploy.ts

@ -191,8 +191,13 @@ export const createInstance = async (
const confirmationCb = getConfirmationCb(plugin, dispatch, mainnetPrompt) const confirmationCb = getConfirmationCb(plugin, dispatch, mainnetPrompt)
const currentParams = !isProxyDeployment && !isContractUpgrade ? args : '' const currentParams = !isProxyDeployment && !isContractUpgrade ? args : ''
const overSize = await selectedContract.isOverSizeLimit(currentParams) let overSize
if (overSize.overSizeEip170 || overSize.overSizeEip3860) { try {
overSize = await selectedContract.isOverSizeLimit(currentParams)
} catch (error) {
return statusCb(`creation of ${selectedContract.name} errored: ${error.message ? error.message : error}`)
}
if (overSize && (overSize.overSizeEip170 || overSize.overSizeEip3860)) {
return dispatch(displayNotification('Contract code size over limit', isOverSizePrompt(overSize), 'Force Send', 'Cancel', () => { return dispatch(displayNotification('Contract code size over limit', isOverSizePrompt(overSize), 'Force Send', 'Cancel', () => {
deployContract(plugin, selectedContract, currentParams, contractMetadata, compilerContracts, { deployContract(plugin, selectedContract, currentParams, contractMetadata, compilerContracts, {
continueCb: (error, continueTxExecution, cancelCb) => { continueCb: (error, continueTxExecution, cancelCb) => {

Loading…
Cancel
Save