Skip to content

Commit fd39b63

Browse files
committed
invallid taging index update in cache check
1 parent 182377a commit fd39b63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

yarn-project/pxe/src/contract_function_simulator/execution_tagging_index_cache.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export class ExecutionTaggingIndexCache {
1313
}
1414

1515
public setTaggingIndex(secret: DirectionalAppTaggingSecret, index: number) {
16+
const currentValue = this.taggingIndexMap.get(secret.toString());
17+
if (currentValue !== undefined && currentValue !== index - 1) {
18+
throw new Error(`Invalid tagging index update. Current value: ${currentValue}, new value: ${index}`);
19+
}
1620
this.taggingIndexMap.set(secret.toString(), index);
1721
}
1822

0 commit comments

Comments
 (0)