Skip to content

Commit

Permalink
refactor: not breaking note processing on missing hash and nullifier …
Browse files Browse the repository at this point in the history
…func (#1364)

# Description

Fixes #1303
Fixes formatting
  • Loading branch information
benesjan authored Aug 2, 2023
1 parent 71dc039 commit 861db2a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 33 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 @@ -173,7 +173,7 @@ export class AcirSimulator {
};
} catch (e) {
throw new Error(
`Please define an unconstrained function "${computeNoteHashAndNullifierSignature}" in the noir contract. Bubbled error message: ${e}`,
`Mandatory implementation of "${computeNoteHashAndNullifierSignature}" missing in noir contract ${contractAddress.toString()}.`,
);
}
}
Expand Down
32 changes: 18 additions & 14 deletions yarn-project/aztec-rpc/src/note_processor/note_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,24 @@ export class NoteProcessor {
indexOfTxInABlock * MAX_NEW_NULLIFIERS_PER_TX,
(indexOfTxInABlock + 1) * MAX_NEW_NULLIFIERS_PER_TX,
);
userPertainingTxIndices.add(indexOfTxInABlock);
const { index, nonce, nullifier } = await this.findNoteIndexAndNullifier(
dataStartIndexForTx,
newCommitments,
newNullifiers[0],
noteSpendingInfo,
);
noteSpendingInfoDaos.push({
...noteSpendingInfo,
index,
nonce,
nullifier,
publicKey: this.publicKey,
});
try {
const { index, nonce, nullifier } = await this.findNoteIndexAndNullifier(
dataStartIndexForTx,
newCommitments,
newNullifiers[0],
noteSpendingInfo,
);
noteSpendingInfoDaos.push({
...noteSpendingInfo,
index,
nonce,
nullifier,
publicKey: this.publicKey,
});
userPertainingTxIndices.add(indexOfTxInABlock);
} catch (e) {
this.log.warn(`Could not process note because of "${e}". Skipping note...`);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/package.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"scripts": {
"build": "yarn clean && tsc -b && webpack"
}
}
}
6 changes: 2 additions & 4 deletions yarn-project/aztec.js/tsconfig.dest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@
"path": "../types/tsconfig.dest.json"
}
],
"exclude": [
"src/**/*.test.ts"
]
}
"exclude": ["src/**/*.test.ts"]
}
7 changes: 2 additions & 5 deletions yarn-project/circuits.js/tsconfig.dest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@
"path": "../foundation/tsconfig.dest.json"
}
],
"exclude": [
"src/**/*.test.ts",
"src/**/*.in.ts"
]
}
"exclude": ["src/**/*.test.ts", "src/**/*.in.ts"]
}
6 changes: 2 additions & 4 deletions yarn-project/foundation/tsconfig.dest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"extends": ".",
"references": [],
"exclude": [
"src/**/*.test.ts"
]
}
"exclude": ["src/**/*.test.ts"]
}
6 changes: 2 additions & 4 deletions yarn-project/types/tsconfig.dest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
"path": "../foundation/tsconfig.dest.json"
}
],
"exclude": [
"src/**/*.test.ts"
]
}
"exclude": ["src/**/*.test.ts"]
}

0 comments on commit 861db2a

Please sign in to comment.