diff --git a/src/contract/aci.ts b/src/contract/aci.ts index 6fb04ea53c..147852e429 100644 --- a/src/contract/aci.ts +++ b/src/contract/aci.ts @@ -448,7 +448,7 @@ export default async function getContractInstance({ if (fn == null) throw new MissingFunctionNameError(); if (fn === 'init' && opt.callStatic === false) throw new InvalidMethodInvocationError('"init" can be called only via dryRun'); - if (contractId == null && fn !== 'init') throw new InvalidMethodInvocationError('You need to deploy contract before calling!'); + if (contractId == null && fn !== 'init') throw new MissingContractAddressError('Can\'t call contract without address'); if (fn !== 'init' && opt.amount > 0 && fnACI.payable === false) throw new NotPayableFunctionError(opt.amount, fn); let callerId; diff --git a/test/integration/contract-aci.ts b/test/integration/contract-aci.ts index 6820de041f..3eeb95751d 100644 --- a/test/integration/contract-aci.ts +++ b/test/integration/contract-aci.ts @@ -22,7 +22,6 @@ import { decode, BytecodeMismatchError, InvalidAensNameError, - InvalidMethodInvocationError, MissingContractAddressError, MissingContractDefError, NotPayableFunctionError, @@ -186,7 +185,7 @@ describe('Contract instance', () => { }); it('fails on calling without deployment', () => expect(testContract.methods.intFn(2)) - .to.be.rejectedWith(InvalidMethodInvocationError, 'You need to deploy contract before calling!')); + .to.be.rejectedWith(MissingContractAddressError, 'Can\'t call contract without address')); it('deploys', async () => { const deployInfo = await testContract.deploy(['test', 1, 'hahahaha'], {