fix: Minor fixes - Solana (#2737)
What changed, and why it matters
This commit makes small Solana-related fixes in the Cake Wallet app. It shortens a network-request delay, removes an unnecessary Observer wrapper from a QR-code address page, wraps a send-confirmation sheet in an Observer so the slide-to-send button reacts to connectivity changes, dims the slide icon when disabled, and adds a user-friendly error message for expired Solana block hashes. None of these changes appear to be security fixes; they are usability and reliability tweaks.
No security action required. Treat as a routine bug-fix/UX commit. If reviewing for quality, verify the removed Observer on AddressPage does not break reactive updates and that the new Solana blockhash error message is shown correctly.
Security signals we found
No security-relevant keywords in commit title or message
No changes to key storage, seed handling, encryption, or authentication
UI-only and error-message changes
Solana network polling delay reduced (performance/reliability, not security)
No CVE, advisory, or vendor security disclosure referenced
Evidence from the diff
The diff contains six small changes: (1) reduce polling delay between Solana signature batch requests from 300 ms to 100 ms; (2) whitespace/formatting in SolanaWalletBase; (3) remove Observer wrapper around AddressPage QRWidget; (4) wrap ConfirmSendingBottomSheet in Observer so isSlideActionEnabled reacts to sendViewModel.isReadyForSend updates; (5) adjust slide-button icon opacity based on disabled state; (6) add localized error handling for Solana ‘Blockhash not found’ variants. No cryptographic, authentication, or access-control changes are present. The commit message frames these as ‘Minor fixes’.
Changed components
cw_solana/lib/solana_client.dartcw_solana/lib/solana_wallet.dartlib/src/screens/dashboard/pages/address_page.dartlib/src/screens/send/send_page.dartlib/src/widgets/standard_slide_button_widget.dartlib/view_model/send/send_view_model.dartInspect captured patch +46 / −35
diff --git a/cw_solana/lib/solana_client.dart b/cw_solana/lib/solana_client.dart
index 4360086d..c4069c26 100644
--- a/cw_solana/lib/solana_client.dart
+++ b/cw_solana/lib/solana_client.dart
@@ -458,7 +458,7 @@ class SolanaWalletClient {
}
if (i + batchSize < signatures.length) {
- await Future.delayed(const Duration(milliseconds: 300));
+ await Future.delayed(const Duration(milliseconds: 100));
}
}
diff --git a/cw_solana/lib/solana_wallet.dart b/cw_solana/lib/solana_wallet.dart
index 8bb094ea..68e2d4be 100644
--- a/cw_solana/lib/solana_wallet.dart
+++ b/cw_solana/lib/solana_wallet.dart
@@ -145,6 +145,7 @@ abstract class SolanaWalletBase
await walletAddresses.init();
await transactionHistory.init();
+
await save();
}
@@ -227,8 +228,8 @@ abstract class SolanaWalletBase
await _updateBalance();
final transactionCurrency = balance.keys.firstWhere(
- (currency) =>
- currency.title == credentials.currency.title &&
+ (currency) =>
+ currency.title == credentials.currency.title &&
currency.tag == credentials.currency.tag,
orElse: () => throw Exception(
'Currency ${credentials.currency.title} ${credentials.currency.tag} is not accessible in the wallet, try to enable it first.'));
diff --git a/lib/src/screens/dashboard/pages/address_page.dart b/lib/src/screens/dashboard/pages/address_page.dart
index c7e5c879..20b1b915 100644
--- a/lib/src/screens/dashboard/pages/address_page.dart
+++ b/lib/src/screens/dashboard/pages/address_page.dart
@@ -144,13 +144,11 @@ class AddressPage extends BasePage {
child: Column(
children: <Widget>[
Expanded(
- child: Observer(
- builder: (_) => QRWidget(
- formKey: _formKey,
- addressListViewModel: addressListViewModel,
- amountTextFieldFocusNode: _cryptoAmountFocus,
- amountController: _amountController,
- ),
+ child: QRWidget(
+ formKey: _formKey,
+ addressListViewModel: addressListViewModel,
+ amountTextFieldFocusNode: _cryptoAmountFocus,
+ amountController: _amountController,
),
),
SizedBox(height: 16),
diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart
index 09f9fc68..68e59f5d 100644
--- a/lib/src/screens/send/send_page.dart
+++ b/lib/src/screens/send/send_page.dart
@@ -576,30 +576,34 @@ class SendPage extends BasePage {
isDismissible: false,
isScrollControlled: true,
builder: (BuildContext bottomSheetContext) {
- return ConfirmSendingBottomSheet(
- key: ValueKey('send_page_confirm_sending_bottom_sheet_key'),
- titleText: S.of(bottomSheetContext).confirm_transaction,
- accessibleNavigationModeSlideActionButtonText: S.of(bottomSheetContext).send,
- footerType: FooterType.slideActionButton,
- isSlideActionEnabled: sendViewModel.isReadyForSend,
- walletType: sendViewModel.walletType,
- titleIconPath: sendViewModel.selectedCryptoCurrency.iconPath,
- currency: sendViewModel.selectedCryptoCurrency,
- amount: S.of(bottomSheetContext).send_amount,
- amountValue: sendViewModel.pendingTransaction!.amountFormatted,
- fiatAmountValue: sendViewModel.pendingTransactionFiatAmountFormatted,
- fee: isEVMCompatibleChain(sendViewModel.walletType)
- ? S.of(bottomSheetContext).send_estimated_fee
- : S.of(bottomSheetContext).send_fee,
- feeValue: sendViewModel.pendingTransaction!.feeFormatted,
- feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmountFormatted,
- outputs: sendViewModel.outputs,
- onSlideActionComplete: () async {
- Navigator.of(bottomSheetContext).pop(true);
- sendViewModel.commitTransaction(context);
- },
- change: sendViewModel.pendingTransaction!.change,
- isOpenCryptoPay: sendViewModel.ocpRequest != null,
+ return Observer(
+ builder: (_) => ConfirmSendingBottomSheet(
+ key: ValueKey('send_page_confirm_sending_bottom_sheet_key'),
+ titleText: S.of(bottomSheetContext).confirm_transaction,
+ accessibleNavigationModeSlideActionButtonText:
+ S.of(bottomSheetContext).send,
+ footerType: FooterType.slideActionButton,
+ isSlideActionEnabled: sendViewModel.isReadyForSend,
+ walletType: sendViewModel.walletType,
+ titleIconPath: sendViewModel.selectedCryptoCurrency.iconPath,
+ currency: sendViewModel.selectedCryptoCurrency,
+ amount: S.of(bottomSheetContext).send_amount,
+ amountValue: sendViewModel.pendingTransaction!.amountFormatted,
+ fiatAmountValue: sendViewModel.pendingTransactionFiatAmountFormatted,
+ fee: isEVMCompatibleChain(sendViewModel.walletType)
+ ? S.of(bottomSheetContext).send_estimated_fee
+ : S.of(bottomSheetContext).send_fee,
+ feeValue: sendViewModel.pendingTransaction!.feeFormatted,
+ feeFiatAmount:
+ sendViewModel.pendingTransactionFeeFiatAmountFormatted,
+ outputs: sendViewModel.outputs,
+ onSlideActionComplete: () async {
+ Navigator.of(bottomSheetContext).pop(true);
+ sendViewModel.commitTransaction(context);
+ },
+ change: sendViewModel.pendingTransaction!.change,
+ isOpenCryptoPay: sendViewModel.ocpRequest != null,
+ ),
);
},
);
diff --git a/lib/src/widgets/standard_slide_button_widget.dart b/lib/src/widgets/standard_slide_button_widget.dart
index 3f6b9ad5..5a7c019c 100644
--- a/lib/src/widgets/standard_slide_button_widget.dart
+++ b/lib/src/widgets/standard_slide_button_widget.dart
@@ -113,7 +113,7 @@ class StandardSlideButtonState extends State<StandardSlideButton> {
child: Icon(
key: ValueKey('standard_slide_button_widget_slider_icon_key'),
Icons.arrow_forward,
- color: Theme.of(context).colorScheme.onSurface,
+ color: widget.isDisabled ? Theme.of(context).colorScheme.onSurface.withOpacity(0.2) : Theme.of(context).colorScheme.onSurface,
),
),
),
diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart
index 24f71cac..bdfb76cd 100644
--- a/lib/view_model/send/send_view_model.dart
+++ b/lib/view_model/send/send_view_model.dart
@@ -1053,6 +1053,14 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
return S.current.solana_invalid_data_message;
}
+ if (errorMessage.contains('Blockhash not found') ||
+ errorMessage.contains('BlockhashNotFound') ||
+ errorMessage.contains('BlockhashMNotFound')) {
+ return 'Transaction failed because its recent blockhash expired. '
+ 'Please retry your send; if this keeps happening, try again in '
+ 'a few seconds or switch to a different Solana node.';
+ }
+
return errorMessage;
}
if (walletType == WalletType.ethereum ||
Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.