From 1c7139a9e3ee5f72f3be8bc8ca18475ed4d43d5a Mon Sep 17 00:00:00 2001 From: robert-balcerowicz <56016086+robert-balcerowicz@users.noreply.github.com> Date: Sun, 20 Mar 2022 19:11:41 +0100 Subject: [PATCH] ts: Use return value of `wallet.signTransaction` in `provider.ts` (#1527) --- CHANGELOG.md | 1 + ts/src/provider.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 739bde98..3290a0d4 100644 --- a/CHANGELOG.md +++ b/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 = ` 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 diff --git a/ts/src/provider.ts b/ts/src/provider.ts index 887f3c82..e67f4c55 100644 --- a/ts/src/provider.ts +++ b/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) => {