Ver Fonte

ts: Use return value of `wallet.signTransaction` in `provider.ts` (#1527)

robert-balcerowicz há 3 anos atrás
pai
commit
1c7139a9e3
2 ficheiros alterados com 3 adições e 2 exclusões
  1. 1 0
      CHANGELOG.md
  2. 2 2
      ts/src/provider.ts

+ 1 - 0
CHANGELOG.md

@@ -33,6 +33,7 @@ incremented for features.
 * ts: Fix `spl-token` coder account parsing ([#1604](https://github.com/project-serum/anchor/pull/1604)).
 * cli: Fix `npm install` fallback if `yarn` install doesn't work ([#1643](https://github.com/project-serum/anchor/pull/1643)).
 * lang: Fix bug where `owner = <target>` would not compile because of missing type annotation ([#1648](https://github.com/project-serum/anchor/pull/1648)).
+* ts: Adjust `send` and `simulate` functions in `provider.ts`, so they use the return value of `Wallet.signTransaction`([#1527](https://github.com/project-serum/anchor/pull/1527)).
 
 ### Breaking
 

+ 2 - 2
ts/src/provider.ts

@@ -106,7 +106,7 @@ export default class Provider {
       await this.connection.getRecentBlockhash(opts.preflightCommitment)
     ).blockhash;
 
-    await this.wallet.signTransaction(tx);
+    tx = await this.wallet.signTransaction(tx);
     signers
       .filter((s): s is Signer => s !== undefined)
       .forEach((kp) => {
@@ -197,7 +197,7 @@ export default class Provider {
       )
     ).blockhash;
 
-    await this.wallet.signTransaction(tx);
+    tx = await this.wallet.signTransaction(tx);
     signers
       .filter((s): s is Signer => s !== undefined)
       .forEach((kp) => {