Skip to content
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

fix: Update STX Banner Alert, include chainSupportsSmartTransactions & STX liveness check #29911

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

httpJunkie
Copy link
Contributor

@httpJunkie httpJunkie commented Jan 27, 2025

…STX liveness checks.

  • Added imports for feature flag and STX liveness checks
  • Added Redux dispatch hook
  • Added selectors for chain support and preference enabled
  • Added useEffect to fetch feature flags and STX liveness when alert is enabled
  • Updated alertConditions to include chain support and preference enabled checks

The banner will now wait for feature flags and STX liveness to be fetched before potentially rendering, and will only show if the chain supports smart transactions and they are enabled in preferences.

Description

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

…STX liveness checks.

- Added imports for feature flag and STX liveness checks
- Added Redux dispatch hook
- Added selectors for chain support and preference enabled
- Added useEffect to fetch feature flags and STX liveness when alert is enabled
- Updated alertConditions to include chain support and preference enabled checks

The banner will now wait for feature flags and STX liveness to be fetched before potentially rendering, and will only show if the chain supports smart transactions and they are enabled in preferences.
@httpJunkie httpJunkie requested a review from a team as a code owner January 27, 2025 07:11
@httpJunkie httpJunkie marked this pull request as draft January 27, 2025 07:11
Copy link
Contributor

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.

Updates test state structure to match production selectors:
- Integrated `mockNetworkState` helper for network configuration WAS KEY
- Added required `swapsState` structure (`extensionActive`, `smartTransactions config`)
- Fixes `preference-disabled` tests w/ complete feat flag state

The `swapsState` configuration contains essential settings that control how smart transactions behave

Adding `swapsState` was needed to match network-specific MetaMask smart
transaction settings, including extension state and transaction params

These settings determine feature availability and transaction behavior across different platforms and networks
@httpJunkie httpJunkie self-assigned this Jan 27, 2025
@httpJunkie httpJunkie added the team-transactions Transactions team label Jan 27, 2025
Changes:

- `135.ts` - Updated migration script to only `set   smartTransactionsMigrationApplied` when STX is newly enabled
- `135.test.ts` - Updated tests to verify migration behavior with clearer test descriptions
`transaction-alerts.test.js`   - Updated test to properly mock network configuration for the banner component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-transactions Transactions team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant