diff --git a/yarn-project/end-to-end/src/e2e_avm_simulator.test.ts b/yarn-project/end-to-end/src/e2e_avm_simulator.test.ts index 449a14eaf1b..fe71b683719 100644 --- a/yarn-project/end-to-end/src/e2e_avm_simulator.test.ts +++ b/yarn-project/end-to-end/src/e2e_avm_simulator.test.ts @@ -155,11 +155,6 @@ describe('e2e_avm_simulator', () => { }); describe('Nested calls', () => { - it('Top-level call to non-existent contract reverts', async () => { - // The nested call reverts (returns failure), but the caller doesn't HAVE to rethrow. - const tx = await avmContract.methods.nested_call_to_nothing_recovers().send().wait(); - expect(tx.status).toEqual(TxStatus.SUCCESS); - }); it('Nested call to non-existent contract reverts & rethrows by default', async () => { // The nested call reverts and by default caller rethrows await expect(avmContract.methods.nested_call_to_nothing().send().wait()).rejects.toThrow(/No bytecode/); diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts index ccde3cdf980..46161491706 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts @@ -277,7 +277,7 @@ describe('e2e_deploy_contract contract class registration', () => { }); describe('error scenarios in deployment', () => { - it('app logic call to an undeployed contract reverts, but can be included is not dropped', async () => { + it('app logic call to an undeployed contract reverts, but can be included', async () => { const whom = wallet.getAddress(); const outgoingViewer = whom; const instance = await t.registerContract(wallet, StatefulTestContract, { initArgs: [whom, outgoingViewer, 42] }); diff --git a/yarn-project/simulator/src/avm/avm_simulator.test.ts b/yarn-project/simulator/src/avm/avm_simulator.test.ts index 38345c3df36..00366a84374 100644 --- a/yarn-project/simulator/src/avm/avm_simulator.test.ts +++ b/yarn-project/simulator/src/avm/avm_simulator.test.ts @@ -191,7 +191,7 @@ describe('AVM simulator: transpiled Noir contracts', () => { expect(results.reverted).toBe(false); }); - it('execution of a non-existent contract immediately reverts', async () => { + it('execution of a non-existent contract immediately reverts and consumes all allocated gas', async () => { const context = initContext(); const results = await new AvmSimulator(context).execute(); diff --git a/yarn-project/simulator/src/avm/opcodes/instruction.ts b/yarn-project/simulator/src/avm/opcodes/instruction.ts index 2b7a0e8f551..c7ae85a5d84 100644 --- a/yarn-project/simulator/src/avm/opcodes/instruction.ts +++ b/yarn-project/simulator/src/avm/opcodes/instruction.ts @@ -94,7 +94,7 @@ export abstract class Instruction { * Computes gas cost for the instruction based on its base cost and memory operations. * @returns Gas cost. */ - public gasCost(dynMultiplier: number = 0): Gas { + protected gasCost(dynMultiplier: number = 0): Gas { const baseGasCost = getBaseGasCost(this.opcode); const dynGasCost = mulGas(getDynamicGasCost(this.opcode), dynMultiplier); return sumGas(baseGasCost, dynGasCost);