From 60ae9751b78e34503fd07be04aa9aa3979ca0c1b Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 13 Jul 2023 19:46:34 +0530 Subject: [PATCH] show error on type mismatch for constructor args --- libs/remix-ui/run-tab/src/lib/actions/deploy.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts index 7becdc2fdb..e35d3b74f4 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts +++ b/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 currentParams = !isProxyDeployment && !isContractUpgrade ? args : '' - const overSize = await selectedContract.isOverSizeLimit(currentParams) - if (overSize.overSizeEip170 || overSize.overSizeEip3860) { + let overSize + 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', () => { deployContract(plugin, selectedContract, currentParams, contractMetadata, compilerContracts, { continueCb: (error, continueTxExecution, cancelCb) => {