Skip to content

Commit

Permalink
feat: linking errors (#3004)
Browse files Browse the repository at this point in the history
Fixes #2969
  • Loading branch information
benesjan authored and Maddiaa0 committed Oct 25, 2023
1 parent 240a414 commit d0f47c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion yarn-project/key-store/src/test_key_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export class TestKeyStore implements KeyStore {
private getAccount(pubKey: PublicKey) {
const account = this.accounts.find(a => a.getPublicKey().equals(pubKey));
if (!account) {
throw new Error('Unknown account.');
throw new Error(
'Unknown account.\nSee docs for context: https://docs.aztec.network/dev_docs/contracts/common_errors#unknown-contract-error',
);
}
return account;
}
Expand Down
4 changes: 3 additions & 1 deletion yarn-project/pxe/src/pxe_service/pxe_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ export class PXEService implements PXE {
async #getFunctionCall(functionName: string, args: any[], to: AztecAddress): Promise<FunctionCall> {
const contract = await this.db.getContract(to);
if (!contract) {
throw new Error(`Unknown contract ${to}: add it to PXE Service by calling server.addContracts(...)`);
throw new Error(
`Unknown contract ${to}: add it to PXE Service by calling server.addContracts(...).\nSee docs for context: https://docs.aztec.network/dev_docs/contracts/common_errors#unknown-contract-error`,
);
}

const functionDao = contract.functions.find(f => f.name === functionName);
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/pxe/src/simulator_oracle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class SimulatorOracle implements DBOracle {
const completeAddress = await this.db.getCompleteAddress(address);
if (!completeAddress)
throw new Error(
`No public key registered for address ${address.toString()}. Register it by calling pxe.registerRecipient(...) or pxe.registerAccount(...)`,
`No public key registered for address ${address.toString()}. Register it by calling pxe.registerRecipient(...) or pxe.registerAccount(...).\nSee docs for context: https://docs.aztec.network/dev_docs/contracts/common_errors#no-public-key-registered-error`,
);
return completeAddress;
}
Expand Down

0 comments on commit d0f47c5

Please sign in to comment.