Skip to content

Commit bb2d7d4

Browse files
committed
wip
1 parent 51d67dd commit bb2d7d4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export class PXEOracleInterface implements ExecutionDataProvider {
291291
// contractName,
292292
// contractAddress,
293293
// });
294-
await this.taggingDataProvider.setTaggingSecretIndexAsSender(directionalAppTaggingSecret, index + 1);
294+
await this.taggingDataProvider.setTaggingSecretIndexesAsSender([{ directionalAppTaggingSecret, index: index + 1 }]);
295295

296296
// Compute and return the tag using the current index
297297
return computeTag(directionalAppTaggingSecret, index);
@@ -389,7 +389,9 @@ export class PXEOracleInterface implements ExecutionDataProvider {
389389

390390
const contractName = await this.contractDataProvider.getDebugContractName(contractAddress);
391391
if (currentIndex !== oldIndex) {
392-
await this.taggingDataProvider.setTaggingSecretIndexAsSender(directionalAppTaggingSecret, currentIndex);
392+
await this.taggingDataProvider.setTaggingSecretIndexesAsSender([
393+
{ directionalAppTaggingSecret, index: currentIndex },
394+
]);
393395

394396
this.log.debug(
395397
`Syncing logs for secret ${directionalAppTaggingSecret.toString()} at contract ${contractName}(${contractAddress})`,

yarn-project/pxe/src/storage/tagging_data_provider/tagging_data_provider.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ export class TaggingDataProvider {
2222
this.#taggingSecretIndexesAsRecipients = this.#store.openMap('tagging_secret_indexes_as_recipients');
2323
}
2424

25-
setTaggingSecretIndexAsSender(directionalAppTaggingSecret: Fr, index: number) {
26-
return this.#taggingSecretIndexesAsSenders.set(directionalAppTaggingSecret.toString(), index);
25+
setTaggingSecretIndexesAsSender(indexedTaggingSecrets: IndexedTaggingSecret[]) {
26+
return Promise.all(
27+
indexedTaggingSecrets.map(({ directionalAppTaggingSecret, index }) =>
28+
this.#taggingSecretIndexesAsSenders.set(`${directionalAppTaggingSecret.toString()}`, index),
29+
),
30+
);
2731
}
2832

2933
setTaggingSecretsIndexesAsRecipient(indexedTaggingSecrets: IndexedTaggingSecret[]) {

0 commit comments

Comments
 (0)