Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: misc cleanup #10194

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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