-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: cp-7.58.0 gasless transaction submission method selection logic #21637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
I have read the CLA Document and I hereby sign the CLA |
aa55ed0 to
ced2989
Compare
app/components/Views/confirmations/hooks/transactions/useTransactionConfirm.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks great. I will add those changes to the Extension PR as well.
Here might help with the coverage to pass the sonar validation.
it('returns false for chainSupportsSendBundle when chainId is undefined', async () => {
useTransactionMetadataRequestMock.mockReturnValue({
id: transactionIdMock,
chainId: undefined,
} as unknown as TransactionMeta);
isSendBundleSupportedMock.mockResolvedValue(true);
useAsyncResultMock.mockImplementation((fn) => {
fn();
return { pending: false, value: false };
});
const { result } = renderHook();
await act(async () => {
await result.current.onConfirm();
});
expect(isSendBundleSupportedMock).not.toHaveBeenCalled();
expect(onApprovalConfirm).toHaveBeenCalled();
});
it('does nothing when transactionMetadata is missing', async () => {
useTransactionMetadataRequestMock.mockReturnValue(undefined);
const { result } = renderHook();
await act(async () => {
await result.current.onConfirm();
});
expect(onApprovalConfirm).not.toHaveBeenCalled();
});
ced2989 to
3206f7d
Compare
|



Description
Fixes issue #21613
This PR is a follow-up fix on #21604
Changelog
CHANGELOG entry:
null
Fixes:
Manual testing steps
https://docs.google.com/spreadsheets/d/1m0xBMr48fXhfuOFnzgm9xw2QG5L4sUm6r4Hqaun29E4/edit?gid=0#gid=0
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Gate smart-transaction batching by Sentinel sendBundle support and fall back to external-sign gasless flow; add Sentinel API util and expand tests.
useTransactionConfirm):isSendBundleSupportedviauseAsyncResultto determine chain capability.shouldUseSmartTransactionandchainSupportsSendBundleare true; otherwise uses gasless 7702 path by settingtxMeta.isExternalSignwhen aselectedGasFeeTokenexists.chainSupportsSendBundle.util/transactions/sentinel-apiwithgetSentinelNetworkFlags,isSendBundleSupported,getSendBundleSupportedChains, andbuildUrl(fetches fromtx-sentinelservice).useAsyncResultand Sentinel API; wraps confirmations inact.chainIdhandling.Written by Cursor Bugbot for commit 3206f7d. This will update automatically on new commits. Configure here.