Skip to content

Commit

Permalink
fix: cleanup api on getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jan 25, 2024
1 parent 73cd53b commit ab0372f
Showing 1 changed file with 2 additions and 43 deletions.
45 changes: 2 additions & 43 deletions yarn-project/acir-simulator/src/avm/fixtures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,10 @@ import { Fr } from '@aztec/foundation/fields';

import { AvmExecutionEnvironment } from '../avm_execution_environment.js';

/**
* An interface that allows to override the default values of the AvmExecutionEnvironment
*/
export interface AvmExecutionEnvironmentOverrides {
address?: AztecAddress;

storageAddress?: AztecAddress;

origin?: AztecAddress;

sender?: AztecAddress;

portal?: EthAddress;

feePerL1Gas?: Fr;

feePerL2Gas?: Fr;

feePerDaGas?: Fr;

contractCallDepth?: Fr;

globals?: GlobalVariables;

isStaticCall?: boolean;

isDelegateCall?: boolean;

calldata?: Fr[];
}

/**
* Create an empty instance of the Execution Environment where all values are zero, unless overriden in the overrides object
*/
export function initExecutionEnvironment(overrides?: AvmExecutionEnvironmentOverrides): AvmExecutionEnvironment {
export function initExecutionEnvironment(overrides?: Partial<AvmExecutionEnvironment>): AvmExecutionEnvironment {
return new AvmExecutionEnvironment(
overrides?.address ?? AztecAddress.zero(),
overrides?.storageAddress ?? AztecAddress.zero(),
Expand All @@ -58,20 +27,10 @@ export function initExecutionEnvironment(overrides?: AvmExecutionEnvironmentOver
);
}

/**
* An interface that allows to override the default values of the GlobalVariables
*/
export interface GlobalVariablesOverrides {
chainId?: Fr;
version?: Fr;
blockNumber?: Fr;
timestamp?: Fr;
}

/**
* Create an empty instance of the Execution Environment where all values are zero, unless overriden in the overrides object
*/
export function initGlobalVariables(overrides?: GlobalVariablesOverrides): GlobalVariables {
export function initGlobalVariables(overrides?: Partial<GlobalVariables>): GlobalVariables {
return new GlobalVariables(
overrides?.chainId ?? Fr.zero(),
overrides?.version ?? Fr.zero(),
Expand Down

0 comments on commit ab0372f

Please sign in to comment.