Skip to content

Commit

Permalink
chore: misc cleanup (#10194)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanks12 authored Nov 26, 2024
1 parent 29f0d7a commit dd01417
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions yarn-project/end-to-end/src/e2e_avm_simulator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] });
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/simulator/src/avm/avm_simulator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/simulator/src/avm/opcodes/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dd01417

Please sign in to comment.