Skip to content

Commit

Permalink
Convert errors in @solana/signers to coded exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed Mar 1, 2024
1 parent b59fecd commit 75de449
Show file tree
Hide file tree
Showing 26 changed files with 167 additions and 70 deletions.
9 changes: 9 additions & 0 deletions packages/errors/src/codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ export const SOLANA_ERROR__INSTRUCTION_ERROR_MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEE
export const SOLANA_ERROR__INSTRUCTION_ERROR_MAX_ACCOUNTS_EXCEEDED = 4615052 as const;
export const SOLANA_ERROR__INSTRUCTION_ERROR_MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED = 4615053 as const;
export const SOLANA_ERROR__INSTRUCTION_ERROR_BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS = 4615054 as const;
// Reserve signer-related error codes in the range [5508000-5508999]
export const SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS = 5508000 as const;
export const SOLANA_ERROR__SIGNER_TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS = 5508001 as const;
export const SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER = 5508002 as const;
export const SOLANA_ERROR__SIGNER_EXPECTED_TRANSACTION_SENDING_SIGNER = 5508003 as const;
// Reserve transaction-related error codes in the range [5663000-5663999]
export const SOLANA_ERROR__TRANSACTION_INVOKED_PROGRAMS_CANNOT_PAY_FEES = 5663001 as const;
export const SOLANA_ERROR__TRANSACTION_INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE = 5663002 as const;
Expand Down Expand Up @@ -226,6 +231,10 @@ export type SolanaErrorCode =
| typeof SOLANA_ERROR__CODECS_CODEC_REQUIRES_FIXED_SIZE
| typeof SOLANA_ERROR__CODECS_INVALID_STRING_FOR_BASE
| typeof SOLANA_ERROR__CODECS_NUMBER_OUT_OF_RANGE
| typeof SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS
| typeof SOLANA_ERROR__SIGNER_TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS
| typeof SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER
| typeof SOLANA_ERROR__SIGNER_EXPECTED_TRANSACTION_SENDING_SIGNER
| typeof SOLANA_ERROR__INSTRUCTION_ERROR_UNKNOWN
| typeof SOLANA_ERROR__INSTRUCTION_ERROR_GENERIC_ERROR
| typeof SOLANA_ERROR__INSTRUCTION_ERROR_INVALID_ARGUMENT
Expand Down
9 changes: 9 additions & 0 deletions packages/errors/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ import {
SOLANA_ERROR__NOT_ALL_ACCOUNTS_DECODED,
SOLANA_ERROR__PROGRAM_DERIVED_ADDRESS_BUMP_SEED_OUT_OF_RANGE,
SOLANA_ERROR__RPC_INTEGER_OVERFLOW,
SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS,
SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER,
SOLANA_ERROR__TRANSACTION_ERROR_DUPLICATE_INSTRUCTION,
SOLANA_ERROR__TRANSACTION_ERROR_INSUFFICIENT_FUNDS_FOR_RENT,
SOLANA_ERROR__TRANSACTION_ERROR_PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED,
Expand Down Expand Up @@ -288,6 +290,13 @@ export type SolanaErrorContext = DefaultUnspecifiedErrorContextToUndefined<
path?: string;
value: bigint;
};
[SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS]: {
address: string;
};
[SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER]: {
address: string;
interfaceName: string;
};
[SOLANA_ERROR__TRANSACTION_ERROR_DUPLICATE_INSTRUCTION]: {
index: number;
};
Expand Down
14 changes: 14 additions & 0 deletions packages/errors/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ import {
SOLANA_ERROR__PROGRAM_ADDRESS_ENDS_WITH_PDA_MARKER,
SOLANA_ERROR__PROGRAM_DERIVED_ADDRESS_BUMP_SEED_OUT_OF_RANGE,
SOLANA_ERROR__RPC_INTEGER_OVERFLOW,
SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS,
SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER,
SOLANA_ERROR__SIGNER_EXPECTED_TRANSACTION_SENDING_SIGNER,
SOLANA_ERROR__SIGNER_TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS,
SOLANA_ERROR__SUBTLE_CRYPTO_DIGEST_MISSING,
SOLANA_ERROR__SUBTLE_CRYPTO_ED25519_ALGORITHM_MISSING,
SOLANA_ERROR__SUBTLE_CRYPTO_EXPORT_FUNCTION_MISSING,
Expand Down Expand Up @@ -298,6 +302,16 @@ export const SolanaErrorMessages: Readonly<{
'The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was ' +
'`$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds ' +
'`Number.MAX_SAFE_INTEGER`.',
[SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS]:
'Multiple distinct signers were identified for address `$address`. Please ensure that ' +
'you are using the same signer instance for each address.',
[SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER]:
'The provided value does not implement the `$interfaceName` interface',
[SOLANA_ERROR__SIGNER_EXPECTED_TRANSACTION_SENDING_SIGNER]:
'No `TransactionSendingSigner` was identified. Please provide a valid ' +
'`ITransactionWithSingleSendingSigner` transaction.',
[SOLANA_ERROR__SIGNER_TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS]:
'More than one `TransactionSendingSigner` was identified.',
[SOLANA_ERROR__SUBTLE_CRYPTO_DIGEST_MISSING]: 'No digest implementation could be found.',
[SOLANA_ERROR__SUBTLE_CRYPTO_ED25519_ALGORITHM_MISSING]:
'This runtime does not support the generation of Ed25519 key pairs.\n\nInstall and ' +
Expand Down
6 changes: 4 additions & 2 deletions packages/signers/src/__tests__/add-signers-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '@solana/test-matchers/toBeFrozenObject';

import { Address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, SolanaError } from '@solana/errors';
import { AccountRole, IInstruction } from '@solana/instructions';
import { BaseTransaction } from '@solana/transactions';

Expand Down Expand Up @@ -116,8 +117,9 @@ describe('addSignersToInstruction', () => {

// Then we expect an error to be thrown.
expect(fn).toThrow(
'Multiple distinct signers were identified for address "1111". ' +
'Please ensure that you are using the same signer instance for each address.',
new SolanaError(SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, {
address: '1111',
}),
);
});

Expand Down
6 changes: 4 additions & 2 deletions packages/signers/src/__tests__/deduplicate-signers-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, SolanaError } from '@solana/errors';

import { deduplicateSigners } from '../deduplicate-signers';
import {
Expand Down Expand Up @@ -41,8 +42,9 @@ describe('deduplicateSigners', () => {

// Then we expect an error to be thrown.
expect(fn).toThrow(
`Multiple distinct signers were identified for address "${addressA}". ` +
`Please ensure that you are using the same signer instance for each address.`,
new SolanaError(SOLANA_ERROR__SIGNER_ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, {
address: addressA,
}),
);
});

Expand Down
14 changes: 9 additions & 5 deletions packages/signers/src/__tests__/keypair-signer-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '@solana/test-matchers/toBeFrozenObject';

import { address, getAddressFromPublicKey } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, SolanaError } from '@solana/errors';
import { generateKeyPair, SignatureBytes, signBytes } from '@solana/keys';
import { CompilableTransaction, partiallySignTransaction } from '@solana/transactions';

Expand Down Expand Up @@ -58,12 +59,15 @@ describe('assertIsKeyPairSigner', () => {
signTransactions: async () => [],
} satisfies KeyPairSigner<'Gp7YgHcJciP4px5FdFnywUiMG4UcfMZV9UagSAZzDxdy'>;

const expectedMessage = 'The provided value does not implement the KeyPairSigner interface';
const expectedError = new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, {
address: myAddress,
interfaceName: 'KeyPairSigner',
});
expect(() => assertIsKeyPairSigner(mySigner)).not.toThrow();
expect(() => assertIsKeyPairSigner({ address: myAddress })).toThrow(expectedMessage);
expect(() => assertIsKeyPairSigner({ ...mySigner, signMessages: 42 })).toThrow(expectedMessage);
expect(() => assertIsKeyPairSigner({ ...mySigner, signTransactions: 42 })).toThrow(expectedMessage);
expect(() => assertIsKeyPairSigner({ ...mySigner, keyPair: 42 })).toThrow(expectedMessage);
expect(() => assertIsKeyPairSigner({ address: myAddress })).toThrow(expectedError);
expect(() => assertIsKeyPairSigner({ ...mySigner, signMessages: 42 })).toThrow(expectedError);
expect(() => assertIsKeyPairSigner({ ...mySigner, signTransactions: 42 })).toThrow(expectedError);
expect(() => assertIsKeyPairSigner({ ...mySigner, keyPair: 42 })).toThrow(expectedError);
});
});

Expand Down
10 changes: 7 additions & 3 deletions packages/signers/src/__tests__/message-modifying-signer-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, SolanaError } from '@solana/errors';

import {
assertIsMessageModifyingSigner,
Expand Down Expand Up @@ -28,11 +29,14 @@ describe('assertIsMessageModifyingSigner', () => {
modifyAndSignMessages: async () => [],
} satisfies MessageModifyingSigner<'Gp7YgHcJciP4px5FdFnywUiMG4UcfMZV9UagSAZzDxdy'>;

const expectedMessage = 'The provided value does not implement the MessageModifyingSigner interface';
const expectedError = new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, {
address: myAddress,
interfaceName: 'MessageModifyingSigner',
});
expect(() => assertIsMessageModifyingSigner(mySigner)).not.toThrow();
expect(() => assertIsMessageModifyingSigner({ address: myAddress })).toThrow(expectedMessage);
expect(() => assertIsMessageModifyingSigner({ address: myAddress })).toThrow(expectedError);
expect(() => assertIsMessageModifyingSigner({ address: myAddress, modifyAndSignMessages: 42 })).toThrow(
expectedMessage,
expectedError,
);
});
});
10 changes: 7 additions & 3 deletions packages/signers/src/__tests__/message-partial-signer-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, SolanaError } from '@solana/errors';

import { assertIsMessagePartialSigner, isMessagePartialSigner, MessagePartialSigner } from '../message-partial-signer';

Expand All @@ -24,9 +25,12 @@ describe('assertIsMessagePartialSigner', () => {
signMessages: async () => [],
} satisfies MessagePartialSigner<'Gp7YgHcJciP4px5FdFnywUiMG4UcfMZV9UagSAZzDxdy'>;

const expectedMessage = 'The provided value does not implement the MessagePartialSigner interface';
const expectedError = new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, {
address: myAddress,
interfaceName: 'MessagePartialSigner',
});
expect(() => assertIsMessagePartialSigner(mySigner)).not.toThrow();
expect(() => assertIsMessagePartialSigner({ address: myAddress })).toThrow(expectedMessage);
expect(() => assertIsMessagePartialSigner({ address: myAddress, signMessages: 42 })).toThrow(expectedMessage);
expect(() => assertIsMessagePartialSigner({ address: myAddress })).toThrow(expectedError);
expect(() => assertIsMessagePartialSigner({ address: myAddress, signMessages: 42 })).toThrow(expectedError);
});
});
12 changes: 8 additions & 4 deletions packages/signers/src/__tests__/message-signer-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, SolanaError } from '@solana/errors';

import { assertIsMessageSigner, isMessageSigner, MessageSigner } from '../message-signer';

Expand Down Expand Up @@ -35,12 +36,15 @@ describe('assertIsMessageSigner', () => {
modifyAndSignMessages: async () => [],
} satisfies MessageSigner<'Gp7YgHcJciP4px5FdFnywUiMG4UcfMZV9UagSAZzDxdy'>;

const expectedMessage = 'The provided value does not implement any of the MessageSigner interfaces';
const expectedError = new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, {
address: myAddress,
interfaceName: 'MessageSigner',
});
expect(() => assertIsMessageSigner(myPartialSigner)).not.toThrow();
expect(() => assertIsMessageSigner(myModifyingSigner)).not.toThrow();
expect(() => assertIsMessageSigner({ ...myPartialSigner, ...myModifyingSigner })).not.toThrow();
expect(() => assertIsMessageSigner({ address: myAddress })).toThrow(expectedMessage);
expect(() => assertIsMessageSigner({ address: myAddress, signMessages: 42 })).toThrow(expectedMessage);
expect(() => assertIsMessageSigner({ address: myAddress, modifyAndSignMessages: 42 })).toThrow(expectedMessage);
expect(() => assertIsMessageSigner({ address: myAddress })).toThrow(expectedError);
expect(() => assertIsMessageSigner({ address: myAddress, signMessages: 42 })).toThrow(expectedError);
expect(() => assertIsMessageSigner({ address: myAddress, modifyAndSignMessages: 42 })).toThrow(expectedError);
});
});
8 changes: 6 additions & 2 deletions packages/signers/src/__tests__/sign-transaction-test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import '@solana/test-matchers/toBeFrozenObject';

import { Address } from '@solana/addresses';
import { SOLANA_ERROR__TRANSACTION_MISSING_SIGNATURES, SolanaError } from '@solana/errors';
import {
SOLANA_ERROR__SIGNER_EXPECTED_TRANSACTION_SENDING_SIGNER,
SOLANA_ERROR__TRANSACTION_MISSING_SIGNATURES,
SolanaError,
} from '@solana/errors';
import { CompilableTransaction, IFullySignedTransaction, ITransactionWithSignatures } from '@solana/transactions';

import {
Expand Down Expand Up @@ -404,7 +408,7 @@ describe('signAndSendTransactionWithSigners', () => {

// Then we expect an error letting us know no sending mechanism was provided.
await expect(promise).rejects.toThrow(
'No `TransactionSendingSigner` was identified. Please provide a valid `ITransactionWithSingleSendingSigner` transaction.',
new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_TRANSACTION_SENDING_SIGNER),
);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, SolanaError } from '@solana/errors';

import {
assertIsTransactionModifyingSigner,
Expand Down Expand Up @@ -28,11 +29,14 @@ describe('assertIsTransactionModifyingSigner', () => {
modifyAndSignTransactions: async () => [],
} satisfies TransactionModifyingSigner<'Gp7YgHcJciP4px5FdFnywUiMG4UcfMZV9UagSAZzDxdy'>;

const expectedMessage = 'The provided value does not implement the TransactionModifyingSigner interface';
const expectedError = new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, {
address: myAddress,
interfaceName: 'TransactionModifyingSigner',
});
expect(() => assertIsTransactionModifyingSigner(mySigner)).not.toThrow();
expect(() => assertIsTransactionModifyingSigner({ address: myAddress })).toThrow(expectedMessage);
expect(() => assertIsTransactionModifyingSigner({ address: myAddress })).toThrow(expectedError);
expect(() => assertIsTransactionModifyingSigner({ address: myAddress, modifyAndSignTransactions: 42 })).toThrow(
expectedMessage,
expectedError,
);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, SolanaError } from '@solana/errors';

import {
assertIsTransactionPartialSigner,
Expand Down Expand Up @@ -28,11 +29,14 @@ describe('assertIsTransactionPartialSigner', () => {
signTransactions: async () => [],
} satisfies TransactionPartialSigner<'Gp7YgHcJciP4px5FdFnywUiMG4UcfMZV9UagSAZzDxdy'>;

const expectedMessage = 'The provided value does not implement the TransactionPartialSigner interface';
const expectedError = new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, {
address: myAddress,
interfaceName: 'TransactionPartialSigner',
});
expect(() => assertIsTransactionPartialSigner(mySigner)).not.toThrow();
expect(() => assertIsTransactionPartialSigner({ address: myAddress })).toThrow(expectedMessage);
expect(() => assertIsTransactionPartialSigner({ address: myAddress })).toThrow(expectedError);
expect(() => assertIsTransactionPartialSigner({ address: myAddress, signTransactions: 42 })).toThrow(
expectedMessage,
expectedError,
);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, SolanaError } from '@solana/errors';

import {
assertIsTransactionSendingSigner,
Expand Down Expand Up @@ -28,11 +29,14 @@ describe('assertIsTransactionSendingSigner', () => {
signAndSendTransactions: async () => [],
} satisfies TransactionSendingSigner<'Gp7YgHcJciP4px5FdFnywUiMG4UcfMZV9UagSAZzDxdy'>;

const expectedMessage = 'The provided value does not implement the TransactionSendingSigner interface';
const expectedError = new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, {
address: myAddress,
interfaceName: 'TransactionSendingSigner',
});
expect(() => assertIsTransactionSendingSigner(mySigner)).not.toThrow();
expect(() => assertIsTransactionSendingSigner({ address: myAddress })).toThrow(expectedMessage);
expect(() => assertIsTransactionSendingSigner({ address: myAddress })).toThrow(expectedError);
expect(() => assertIsTransactionSendingSigner({ address: myAddress, signAndSendTransactions: 42 })).toThrow(
expectedMessage,
expectedError,
);
});
});
14 changes: 9 additions & 5 deletions packages/signers/src/__tests__/transaction-signer-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { address } from '@solana/addresses';
import { SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, SolanaError } from '@solana/errors';

import { assertIsTransactionSigner, isTransactionSigner, TransactionSigner } from '../transaction-signer';

Expand Down Expand Up @@ -48,7 +49,10 @@ describe('assertIsTransactionSigner', () => {
signAndSendTransactions: async () => [],
} satisfies TransactionSigner<'Gp7YgHcJciP4px5FdFnywUiMG4UcfMZV9UagSAZzDxdy'>;

const expectedMessage = 'The provided value does not implement any of the TransactionSigner interfaces';
const expectedError = new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_CONFORMING_SIGNER, {
address: myAddress,
interfaceName: 'TransactionSigner',
});
expect(() => assertIsTransactionSigner(myPartialSigner)).not.toThrow();
expect(() => assertIsTransactionSigner(myModifyingSigner)).not.toThrow();
expect(() => assertIsTransactionSigner(mySendingSigner)).not.toThrow();
Expand All @@ -58,13 +62,13 @@ describe('assertIsTransactionSigner', () => {
expect(() =>
assertIsTransactionSigner({ ...myPartialSigner, ...myModifyingSigner, ...mySendingSigner }),
).not.toThrow();
expect(() => assertIsTransactionSigner({ address: myAddress })).toThrow(expectedMessage);
expect(() => assertIsTransactionSigner({ address: myAddress, signTransactions: 42 })).toThrow(expectedMessage);
expect(() => assertIsTransactionSigner({ address: myAddress })).toThrow(expectedError);
expect(() => assertIsTransactionSigner({ address: myAddress, signTransactions: 42 })).toThrow(expectedError);
expect(() => assertIsTransactionSigner({ address: myAddress, modifyAndSignTransactions: 42 })).toThrow(
expectedMessage,
expectedError,
);
expect(() => assertIsTransactionSigner({ address: myAddress, signAndSendTransactions: 42 })).toThrow(
expectedMessage,
expectedError,
);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { Address } from '@solana/addresses';
import {
SOLANA_ERROR__SIGNER_EXPECTED_TRANSACTION_SENDING_SIGNER,
SOLANA_ERROR__SIGNER_TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS,
SolanaError,
} from '@solana/errors';

import {
assertIsTransactionWithSingleSendingSigner,
Expand Down Expand Up @@ -83,7 +88,7 @@ describe('assertIsTransactionWithSingleSendingSigner', () => {

// Then we expect the assertion to fail.
expect(() => assertIsTransactionWithSingleSendingSigner(transaction)).toThrow(
'More than one `TransactionSendingSigner` was identified',
new SolanaError(SOLANA_ERROR__SIGNER_TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS),
);
});

Expand All @@ -95,7 +100,7 @@ describe('assertIsTransactionWithSingleSendingSigner', () => {

// Then we expect the assertion to fail.
expect(() => assertIsTransactionWithSingleSendingSigner(transaction)).toThrow(
'No `TransactionSendingSigner` was identified',
new SolanaError(SOLANA_ERROR__SIGNER_EXPECTED_TRANSACTION_SENDING_SIGNER),
);
});
});
Loading

0 comments on commit 75de449

Please sign in to comment.