Skip to content

Commit

Permalink
chore: address some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Aug 4, 2023
1 parent faa0903 commit 0d8d779
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion yarn-project/acir-simulator/src/client/simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class AcirSimulator {
contractAddress: AztecAddress,
portalContractAddress: EthAddress,
historicRoots: PrivateHistoricTreeRoots,
aztecNode: AztecNode | undefined = undefined,
aztecNode?: AztecNode,
) {
if (entryPointABI.functionType !== FunctionType.UNCONSTRAINED) {
throw new Error(`Cannot run ${entryPointABI.functionType} function as constrained`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class UnconstrainedFunctionExecution {
* @param aztecNode - The aztec node.
* @returns The return values of the executed function.
*/
public async run(aztecNode: AztecNode | undefined = undefined): Promise<any[]> {
public async run(aztecNode?: AztecNode): Promise<any[]> {
this.log(
`Executing unconstrained function ${this.contractAddress.toShortString()}:${this.functionData.functionSelectorBuffer.toString(
'hex',
Expand All @@ -57,7 +57,7 @@ export class UnconstrainedFunctionExecution {
getL1ToL2Message: ([msgKey]) => this.context.getL1ToL2Message(fromACVMField(msgKey)),
getCommitment: ([commitment]) => this.context.getCommitment(this.contractAddress, commitment),
storageRead: async ([slot], [numberOfElements]) => {
if (aztecNode === undefined) {
if (!aztecNode) {
this.log(`Aztec node is undefined, cannot read public storage`);
throw new Error(`Aztec node is undefined, cannot read public storage`);
}
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_lending_contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('e2e_lending_contract', () => {
const getStorageSnapshot = async (contract: LendingContract, aztecNode: AztecRPC, account: Account) => {
const storageValues: { [key: string]: Fr } = {};
const accountKey = await account.key();
const toFields = (res: any) => res[0].map((v: number | bigint | Fr) => new Fr(v));
const toFields = (res: any[]) => res[0].map((v: number | bigint | Fr) => new Fr(v));

[storageValues['interestAccumulator'], storageValues['last_updated_ts']] = toFields(
await contract.methods.getTot(0).view(),
Expand Down

0 comments on commit 0d8d779

Please sign in to comment.