Skip to content

Commit

Permalink
fix: acir sim
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Aug 11, 2023
1 parent cac043f commit 61afd38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions yarn-project/acir-simulator/src/public/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('ACIR public execution simulator', () => {
const result = await executor.execute(execution, GlobalVariables.empty());

const expectedBalance = new Fr(160n);
expect(result.returnValues).toEqual([expectedBalance]);
expect(result.returnValues[0]).toEqual(expectedBalance);

const storageSlot = computeSlotForMapping(new Fr(1n), recipient.toField(), circuitsWasm);
expect(result.contractStorageUpdateRequests).toEqual([
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('ACIR public execution simulator', () => {
const expectedRecipientBalance = new Fr(160n);
const expectedSenderBalance = new Fr(60n);

expect(result.returnValues).toEqual([expectedRecipientBalance]);
expect(result.returnValues[0]).toEqual(expectedRecipientBalance);

expect(result.contractStorageUpdateRequests).toEqual([
{ storageSlot: senderStorageSlot, oldValue: senderBalance, newValue: expectedSenderBalance },
Expand All @@ -174,7 +174,7 @@ describe('ACIR public execution simulator', () => {

const result = await executor.execute(execution, GlobalVariables.empty());

expect(result.returnValues).toEqual([recipientBalance]);
expect(result.returnValues[0]).toEqual(recipientBalance);

expect(result.contractStorageReads).toEqual([
{ storageSlot: recipientStorageSlot, value: recipientBalance },
Expand Down Expand Up @@ -245,15 +245,15 @@ describe('ACIR public execution simulator', () => {
} else {
const result = await executor.execute(execution, globalVariables);

expect(result.returnValues).toEqual([
expect(result.returnValues[0]).toEqual(
new Fr(
initialValue +
globalVariables.chainId.value +
globalVariables.version.value +
globalVariables.blockNumber.value +
globalVariables.timestamp.value,
),
]);
);
}
},
20_000,
Expand Down

0 comments on commit 61afd38

Please sign in to comment.