|
9 | 9 | stakingWithdrawInstructionsIndexes, |
10 | 10 | } from '../../src/lib/constants'; |
11 | 11 | import BigNumber from 'bignumber.js'; |
| 12 | +import { TOKEN_2022_PROGRAM_ID } from '@solana/spl-token'; |
12 | 13 |
|
13 | 14 | describe('SOL util library', function () { |
14 | 15 | describe('isValidAddress', function () { |
@@ -320,14 +321,22 @@ describe('SOL util library', function () { |
320 | 321 | const tokenAddress = 'JC2HAixRNrhBgNjCsV2PBfZEdyitEnWqJPNGokFD8xSA'; |
321 | 322 | it('should succeed for native address as owner address', async function () { |
322 | 323 | const ownerAddress = testData.sol2022AuthAccount.pub; |
323 | | - const result = await Utils.getAssociatedTokenAccountAddress(ai16ZMintAddress, ownerAddress); |
| 324 | + const result = await Utils.getAssociatedTokenAccountAddress( |
| 325 | + ai16ZMintAddress, |
| 326 | + ownerAddress, |
| 327 | + false, |
| 328 | + TOKEN_2022_PROGRAM_ID.toString() |
| 329 | + ); |
324 | 330 | result.should.be.equal(tokenAddress); |
325 | 331 | }); |
326 | 332 | it('should fail for token address as owner address', async function () { |
327 | 333 | const invalidOwnerAddress = tokenAddress; |
328 | | - await Utils.getAssociatedTokenAccountAddress(ai16ZMintAddress, invalidOwnerAddress).should.be.rejectedWith( |
329 | | - 'Invalid ownerAddress - address off ed25519 curve, got: ' + invalidOwnerAddress |
330 | | - ); |
| 334 | + await Utils.getAssociatedTokenAccountAddress( |
| 335 | + ai16ZMintAddress, |
| 336 | + invalidOwnerAddress, |
| 337 | + false, |
| 338 | + TOKEN_2022_PROGRAM_ID.toString() |
| 339 | + ).should.be.rejectedWith('Invalid ownerAddress - address off ed25519 curve, got: ' + invalidOwnerAddress); |
331 | 340 | }); |
332 | 341 | }); |
333 | 342 |
|
|
0 commit comments