Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit f1bff62

Browse files
authored
token-js: renamed getExtraAccountMetaAccount to getExtraAccountMetaAddress (#5186)
* Renamed `getExtraAccountMetaAccount` to `getExtraAccountMetaAddress` for clarity * Also renamed the function in the tests
1 parent eafe27f commit f1bff62

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

token/js/src/extensions/transferHook/instructions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { publicKey } from '@solana/buffer-layout-utils';
99
import { createTransferCheckedInstruction } from '../../instructions/transferChecked.js';
1010
import { createTransferCheckedWithFeeInstruction } from '../transferFee/instructions.js';
1111
import { getMint } from '../../state/mint.js';
12-
import { getExtraAccountMetaAccount, getExtraAccountMetas, getTransferHook, resolveExtraAccountMeta } from './state.js';
12+
import { getExtraAccountMetaAddress, getExtraAccountMetas, getTransferHook, resolveExtraAccountMeta } from './state.js';
1313

1414
export enum TransferHookInstruction {
1515
Initialize = 0,
@@ -144,7 +144,7 @@ export async function addExtraAccountsToInstruction(
144144
return instruction;
145145
}
146146

147-
const extraAccountsAccount = getExtraAccountMetaAccount(transferHook.programId, mint);
147+
const extraAccountsAccount = getExtraAccountMetaAddress(mint, transferHook.programId);
148148
const extraAccountsInfo = await connection.getAccountInfo(extraAccountsAccount, commitment);
149149
if (extraAccountsInfo == null) {
150150
return instruction;

token/js/src/extensions/transferHook/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function getTransferHookAccount(account: Account): TransferHookAccount |
5353
}
5454
}
5555

56-
export function getExtraAccountMetaAccount(programId: PublicKey, mint: PublicKey): PublicKey {
56+
export function getExtraAccountMetaAddress(mint: PublicKey, programId: PublicKey): PublicKey {
5757
const seeds = [Buffer.from('extra-account-metas'), mint.toBuffer()];
5858
return PublicKey.findProgramAddressSync(seeds, programId)[0];
5959
}

token/js/test/e2e-2022/transferHook.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
getAssociatedTokenAddressSync,
2020
ASSOCIATED_TOKEN_PROGRAM_ID,
2121
createMintToCheckedInstruction,
22-
getExtraAccountMetaAccount,
22+
getExtraAccountMetaAddress,
2323
ExtraAccountMetaListLayout,
2424
ExtraAccountMetaLayout,
2525
transferCheckedWithTransferHook,
@@ -48,7 +48,7 @@ describe('transferHook', () => {
4848
beforeEach(async () => {
4949
const mintKeypair = Keypair.generate();
5050
mint = mintKeypair.publicKey;
51-
pdaExtraAccountMeta = getExtraAccountMetaAccount(TRANSFER_HOOK_TEST_PROGRAM_ID, mint);
51+
pdaExtraAccountMeta = getExtraAccountMetaAddress(mint, TRANSFER_HOOK_TEST_PROGRAM_ID);
5252
payerAta = getAssociatedTokenAddressSync(
5353
mint,
5454
payer.publicKey,

0 commit comments

Comments
 (0)