Răsfoiți Sursa

ts: Make `Provider` require publicKey instead of wallet in accounts resolver (#3613)

Davit Badalyan 6 luni în urmă
părinte
comite
70bdd6a8cb
2 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 1 0
      CHANGELOG.md
  2. 3 3
      ts/packages/anchor/src/program/accounts-resolver.ts

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@ The minor version will be incremented upon a breaking change and the patch versi
 ## [Unreleased]
 
 ### Features
+ - ts: Make `Provider` require publicKey instead of wallet in accounts resolver ([#3613](https://github.com/coral-xyz/anchor/pull/3613))
 
 ### Fixes
 

+ 3 - 3
ts/packages/anchor/src/program/accounts-resolver.ts

@@ -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