fix: createProgramAddress now throws on an invalid seed length
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
import BN from 'bn.js';
|
||||
|
||||
import {PublicKey} from '../src/publickey';
|
||||
import {PublicKey, MAX_SEED_LENGTH} from '../src/publickey';
|
||||
|
||||
test('invalid', () => {
|
||||
expect(() => {
|
||||
@ -279,6 +279,13 @@ test('createProgramAddress', async () => {
|
||||
);
|
||||
expect(programAddress.equals(programAddress2)).toBe(false);
|
||||
|
||||
await expect(
|
||||
PublicKey.createProgramAddress(
|
||||
[Buffer.alloc(MAX_SEED_LENGTH + 1)],
|
||||
programId,
|
||||
),
|
||||
).rejects.toThrow('Max seed length exceeded');
|
||||
|
||||
// https://github.com/solana-labs/solana/issues/11950
|
||||
{
|
||||
let seeds = [
|
||||
|
Reference in New Issue
Block a user