Skip to content

Commit

Permalink
Make the return type of AccountClient.fetchMultiple consistent (#2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
quellen-sol authored Feb 7, 2023
1 parent cfdaac1 commit 37cc99c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The minor version will be incremented upon a breaking change and the patch versi

### Fixes

- ts: Make the return type of `AccountClient.fetchMultiple` match the account type being fetched ([#2390](https://github.com/coral-xyz/anchor/pull/2390))
- cli: Don't regenerate idl in read_all_programs(). ([#2332](https://github.com/coral-xyz/anchor/pull/2332)).
- ts: `provider.simulate` will send the transaction with `sigVerify: false` if no `signers` are present ([#2331](https://github.com/coral-xyz/anchor/pull/2331)).
- cli: Failing commands will return the correct exit status. ([#2370](https://github.com/coral-xyz/anchor/pull/2370)).
Expand Down
4 changes: 2 additions & 2 deletions ts/packages/anchor/src/program/namespace/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class AccountClient<
async fetchMultiple(
addresses: Address[],
commitment?: Commitment
): Promise<(Object | null)[]> {
): Promise<(T | null)[]> {
const accounts = await this.fetchMultipleAndContext(addresses, commitment);
return accounts.map((account) => (account ? account.data : null));
}
Expand All @@ -225,7 +225,7 @@ export class AccountClient<
async fetchMultipleAndContext(
addresses: Address[],
commitment?: Commitment
): Promise<({ data: Object; context: Context } | null)[]> {
): Promise<({ data: T; context: Context } | null)[]> {
const accounts = await rpcUtil.getMultipleAccountsAndContext(
this._provider.connection,
addresses.map((address) => translateAddress(address)),
Expand Down

1 comment on commit 37cc99c

@vercel
Copy link

@vercel vercel bot commented on 37cc99c Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

anchor-docs – ./

anchor-docs-200ms.vercel.app
anchor-lang.com
anchor-docs-git-master-200ms.vercel.app
www.anchor-lang.com

Please sign in to comment.