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: re-enable swaps for counterfactual safes [SW-23] #3757

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

compojoom
Copy link
Collaborator

DRAFT: setting this as draft for now, as the swap widget offers to sign a message instead of submitting a tx and that doesn't work since the safe is not deployed.

What it solves

Cow was not being able to work with counterfactual safes - it was showing the widget as not connected.

Resolves #
Now the widget is connected to the safe and one can submit an order.

How this PR fixes it

How to test it

  1. Create counterfactual safe
  2. Fund it with money
  3. Try to make a swap

Screenshots

Checklist

  • I've tested the branch on mobile πŸ“±
  • I've documented how it affects the analytics (if at all) πŸ“Š
  • I've written a unit/e2e test for it (if applicable) πŸ§‘β€πŸ’»

Copy link

Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: βœ… success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented May 28, 2024

πŸ“¦ Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. πŸ€–

πŸŽ‰ Global Bundle Size Decreased

Page Size (compressed)
global 1003.72Β KB (-8Β B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Two Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/balances 29.41 KB (🟒 -13 B) 1.01 MB
/home 60.02 KB (🟒 -13 B) 1.04 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

github-actions bot commented May 28, 2024

Coverage report

Caution

Test run failed

St.❔
Category Percentage Covered / Total
🟑 Statements
79.16% (-0% πŸ”»)
11543/14582
πŸ”΄ Branches
58.35% (+0.05% πŸ”Ό)
2791/4783
🟑 Functions
66.09% (-0.02% πŸ”»)
1848/2796
🟒 Lines
80.49% (+0.01% πŸ”Ό)
10407/12929
Show files with reduced coverage πŸ”»
St.❔
File Statements Branches Functions Lines
πŸ”΄
... / undeployedSafesSlice.ts
38.24% (-5.88% πŸ”»)
33.33%
50% (-12.5% πŸ”»)
45.83% (-4.17% πŸ”»)

Test suite run failed

Failed tests: 2/1444. Failed suites: 1/199.
  ● PermissionsCheck β€Ί disables the submit button when the call is not allowed and shows the permission check status

    ReferenceError: fetch is not defined

      70 | const fetchGasOracle = async (gasPriceOracle: GasPriceOracle): Promise<EstimatedGasPrice> => {
      71 |   const { uri, gasParameter, gweiFactor } = gasPriceOracle
    > 72 |   const response = await fetch(uri)
         |                    ^
      73 |   if (!response.ok) {
      74 |     throw new Error(`Error fetching gas price from oracle ${uri}`)
      75 |   }

      at fetchGasOracle (src/hooks/useGasPrice.ts:72:20)
      at fetchGasOracle (src/hooks/useGasPrice.ts:117:22)

  ● PermissionsCheck β€Ί disables the submit button when the call is not allowed and shows the permission check status

    ReferenceError: fetch is not defined

      70 | const fetchGasOracle = async (gasPriceOracle: GasPriceOracle): Promise<EstimatedGasPrice> => {
      71 |   const { uri, gasParameter, gweiFactor } = gasPriceOracle
    > 72 |   const response = await fetch(uri)
         |                    ^
      73 |   if (!response.ok) {
      74 |     throw new Error(`Error fetching gas price from oracle ${uri}`)
      75 |   }

      at fetchGasOracle (src/hooks/useGasPrice.ts:72:20)
      at fetchGasOracle (src/hooks/useGasPrice.ts:117:22)

  ● PermissionsCheck β€Ί disables the submit button when the call is not allowed and shows the permission check status

    ReferenceError: fetch is not defined

      70 | const fetchGasOracle = async (gasPriceOracle: GasPriceOracle): Promise<EstimatedGasPrice> => {
      71 |   const { uri, gasParameter, gweiFactor } = gasPriceOracle
    > 72 |   const response = await fetch(uri)
         |                    ^
      73 |   if (!response.ok) {
      74 |     throw new Error(`Error fetching gas price from oracle ${uri}`)
      75 |   }

      at fetchGasOracle (src/hooks/useGasPrice.ts:72:20)
      at fetchGasOracle (src/hooks/useGasPrice.ts:117:22)

  ● PermissionsCheck β€Ί execute the tx when the submit button is clicked

    ReferenceError: fetch is not defined

      70 | const fetchGasOracle = async (gasPriceOracle: GasPriceOracle): Promise<EstimatedGasPrice> => {
      71 |   const { uri, gasParameter, gweiFactor } = gasPriceOracle
    > 72 |   const response = await fetch(uri)
         |                    ^
      73 |   if (!response.ok) {
      74 |     throw new Error(`Error fetching gas price from oracle ${uri}`)
      75 |   }

      at fetchGasOracle (src/hooks/useGasPrice.ts:72:20)
      at fetchGasOracle (src/hooks/useGasPrice.ts:117:22)

Report generated by πŸ§ͺjest coverage report action from 0d15de5

CowSwap should now be able to detect once a counterfactual safe is
deployed, so we can safely re-enable swaps for counterfactual safes.
@compojoom compojoom force-pushed the fix-enable-for-counterfactual-safes branch from 8626216 to 0d15de5 Compare June 17, 2024 07:32
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: βœ… success
  • Annotations: 0 total

Report generated by eslint-plus-action

@compojoom compojoom changed the title fix: re-enable swaps for counterfactual safes [SWAP-80] fix: re-enable swaps for counterfactual safes [SW-23] Jun 19, 2024
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant