Skip to content

Commit

Permalink
fixing getPublicKeysAndPartialAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed May 9, 2024
1 parent a1eada4 commit 5adfc12
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions yarn-project/simulator/src/acvm/oracle/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,11 @@ export class Oracle {
}

async getPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<ACVMField[]> {
let publicKeys: Point[] | undefined;
let partialAddress: PartialAddress;
const parsedAddress = AztecAddress.fromField(fromACVMField(address));

// TODO #5834: This should be reworked to return the public keys as well
try {
({ partialAddress } = await this.typedOracle.getCompleteAddress(AztecAddress.fromField(fromACVMField(address))));
} catch (err) {
partialAddress = Fr.ZERO;
}

try {
publicKeys = await this.typedOracle.getPublicKeysForAddress(AztecAddress.fromField(fromACVMField(address)));
} catch (err) {
publicKeys = Array(4).fill(Point.ZERO);
}
const { partialAddress } = await this.typedOracle.getCompleteAddress(parsedAddress);
const publicKeys = await this.typedOracle.getPublicKeysForAddress(parsedAddress);

const acvmPublicKeys = publicKeys.flatMap(key => key.toFields());

Expand Down

0 comments on commit 5adfc12

Please sign in to comment.