Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ts/packages/anchor/src/program/accounts-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class AccountsResolver<IDL extends Idl> {
let depth = 0;
while (
(await this.resolvePdasAndRelations(this._idlIx.accounts)) +
(await this.resolveCustom()) >
(await this.resolveCustom()) >
0
) {
depth++;
Expand Down Expand Up @@ -279,12 +279,12 @@ export class AccountsResolver<IDL extends Idl> {
if ((account.signer || account.address) && !this.get([...path, name])) {
// Default signers to the provider
if (account.signer) {
if (!this._provider.wallet) {
if (!this._provider.publicKey) {
throw new Error(
"This function requires the `Provider` interface implementor to have a `wallet` field."
"This function requires the `Provider` interface implementor to have a `publicKey` field."
);
}
this.set([...path, name], this._provider.wallet.publicKey);
this.set([...path, name], this._provider.publicKey);
}

// Set based on `address` field
Expand Down Expand Up @@ -334,7 +334,7 @@ export class AccountsResolver<IDL extends Idl> {

this.set([...path, name], pubkey);
}
} catch {}
} catch { }

try {
if (account.relations) {
Expand All @@ -346,7 +346,7 @@ export class AccountsResolver<IDL extends Idl> {
this.set([...path, name], account[name]);
}
}
} catch {}
} catch { }
}
}
}
Expand Down