Skip to content

Commit 9bde4d7

Browse files
authored
fix(react): correct featureName in signTransaction error and assert context in tests (#1199)
Fixes #1181
1 parent fb1c576 commit 9bde4d7

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.changeset/lazy-cats-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@solana/react': patch
3+
---
4+
5+
Correct featureName in `signTransaction` error

packages/react/src/__tests__/useSignTransaction-test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ describe('useSignTransaction', () => {
8989
supportedFeatures: ['solana:signTransaction'],
9090
}),
9191
);
92+
expect(result.current).toMatchObject({
93+
context: { featureName: 'solana:signTransaction' },
94+
});
9295
});
9396
it('fatals when the wallet account lookup for the supplied React wallet account fails', () => {
9497
jest.mocked(getWalletAccountForUiWalletAccount_DO_NOT_USE_OR_YOU_WILL_BE_FIRED).mockImplementation(() => {
@@ -181,6 +184,9 @@ describe('useSignTransaction', () => {
181184
supportedFeatures: ['solana:signTransaction'],
182185
}),
183186
);
187+
expect(result.current).toMatchObject({
188+
context: { featureName: 'solana:signTransaction' },
189+
});
184190
});
185191
});
186192
});

packages/react/src/useSignTransaction.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
SolanaSignAndSendTransaction,
32
SolanaSignTransaction,
43
SolanaSignTransactionFeature,
54
SolanaSignTransactionInput,
@@ -127,7 +126,7 @@ export function useSignTransactions<TWalletAccount extends UiWalletAccount>(
127126
throw new WalletStandardError(WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_CHAIN_UNSUPPORTED, {
128127
address: uiWalletAccount.address,
129128
chain,
130-
featureName: SolanaSignAndSendTransaction,
129+
featureName: SolanaSignTransaction,
131130
supportedChains: [...uiWalletAccount.chains],
132131
supportedFeatures: [...uiWalletAccount.features],
133132
});

0 commit comments

Comments
 (0)