safe-global / safe-wallet-web

Safe{Wallet} โ€“ smart contract wallet for Ethereum (ex-Gnosis Safe multisig)
https://app.safe.global
GNU General Public License v3.0
314 stars 372 forks source link

Fix: display swap fees using the correct token [SW-67] #3913

Closed jmealy closed 1 week ago

jmealy commented 1 week ago

What it solves

For buy orders the fee was being displayed in the wrong token.

How this PR fixes it

How to test it

Checklist

notion-workspace[bot] commented 1 week ago

Fees are not shown properly for Buy Orders in the tx details

github-actions[bot] commented 1 week ago

Branch preview

โœ… Deploy successful!

Website: https://fix_fees_display--walletweb.review.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6

Storybook: https://fix_fees_display--walletweb.review.5afe.dev/storybook/

github-actions[bot] commented 1 week ago

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

Report generated by eslint-plus-action

github-actions[bot] commented 1 week ago

๐Ÿ“ฆ Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. ๐Ÿค–

โš ๏ธ Global Bundle Size Increased

Page Size (compressed)
global 1000.83ย KB (๐ŸŸก +59ย 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
/settings/cookies 7.64ย KB (๐ŸŸข -2ย B) 1008.47ย KB
/terms 11.58ย KB (๐ŸŸก +1.56ย KB) 1012.42ย KB
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.

github-actions[bot] commented 1 week ago

Coverage report

[!CAUTION] Test run failed

St.:grey_question:
Category Percentage Covered / Total
๐ŸŸก Statements
79.06% (+0.02% ๐Ÿ”ผ)
11628/14707
๐Ÿ”ด Branches
58.62% (+0.03% ๐Ÿ”ผ)
2848/4858
๐ŸŸก Functions 66.06% 1859/2814
๐ŸŸข Lines
80.45% (+0.02% ๐Ÿ”ผ)
10483/13031

Test suite run failed

Failed tests: 2/1433. Failed suites: 1/198.
``` โ— 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 => { 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) at getGasPrice (src/hooks/useGasPrice.ts:200:27) at callback (src/hooks/useAsync.ts:21:21) at commitHookEffectListMount (node_modules/react-dom/cjs/react-dom.development.js:23150:26) at commitPassiveMountOnFiber (node_modules/react-dom/cjs/react-dom.development.js:24931:11) at commitPassiveMountEffects_complete (node_modules/react-dom/cjs/react-dom.development.js:24891:9) at commitPassiveMountEffects_begin (node_modules/react-dom/cjs/react-dom.development.js:24878:7) at commitPassiveMountEffects (node_modules/react-dom/cjs/react-dom.development.js:24866:3) at flushPassiveEffectsImpl (node_modules/react-dom/cjs/react-dom.development.js:27039:3) at flushPassiveEffects (node_modules/react-dom/cjs/react-dom.development.js:26984:14) at node_modules/react-dom/cjs/react-dom.development.js:26769:9 at flushActQueue (node_modules/react/cjs/react.development.js:2667:24) at act (node_modules/react/cjs/react.development.js:2582:11) at node_modules/@testing-library/react/dist/act-compat.js:63:25 at renderRoot (node_modules/@testing-library/react/dist/pure.js:159:26) at render (node_modules/@testing-library/react/dist/pure.js:246:10) at customRender (src/tests/test-utils.tsx:71:16) at Object. (src/components/tx/SignOrExecuteForm/PermissionsCheck/__test__/PermissionsCheck.test.tsx:126:35) โ— 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 => { 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) at getGasPrice (src/hooks/useGasPrice.ts:200:27) at callback (src/hooks/useAsync.ts:21:21) at commitHookEffectListMount (node_modules/react-dom/cjs/react-dom.development.js:23150:26) at commitPassiveMountOnFiber (node_modules/react-dom/cjs/react-dom.development.js:24931:11) at commitPassiveMountEffects_complete (node_modules/react-dom/cjs/react-dom.development.js:24891:9) at commitPassiveMountEffects_begin (node_modules/react-dom/cjs/react-dom.development.js:24878:7) at commitPassiveMountEffects (node_modules/react-dom/cjs/react-dom.development.js:24866:3) at flushPassiveEffectsImpl (node_modules/react-dom/cjs/react-dom.development.js:27039:3) at flushPassiveEffects (node_modules/react-dom/cjs/react-dom.development.js:26984:14) at node_modules/react-dom/cjs/react-dom.development.js:26769:9 at flushActQueue (node_modules/react/cjs/react.development.js:2667:24) at act (node_modules/react/cjs/react.development.js:2582:11) at node_modules/@testing-library/react/dist/act-compat.js:63:25 at renderRoot (node_modules/@testing-library/react/dist/pure.js:159:26) at render (node_modules/@testing-library/react/dist/pure.js:246:10) at customRender (src/tests/test-utils.tsx:71:16) at Object. (src/components/tx/SignOrExecuteForm/PermissionsCheck/__test__/PermissionsCheck.test.tsx:144:35) โ— 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 => { 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) at getGasPrice (src/hooks/useGasPrice.ts:200:27) at callback (src/hooks/useAsync.ts:21:21) at commitHookEffectListMount (node_modules/react-dom/cjs/react-dom.development.js:23150:26) at commitPassiveMountOnFiber (node_modules/react-dom/cjs/react-dom.development.js:24931:11) at commitPassiveMountEffects_complete (node_modules/react-dom/cjs/react-dom.development.js:24891:9) at commitPassiveMountEffects_begin (node_modules/react-dom/cjs/react-dom.development.js:24878:7) at commitPassiveMountEffects (node_modules/react-dom/cjs/react-dom.development.js:24866:3) at flushPassiveEffectsImpl (node_modules/react-dom/cjs/react-dom.development.js:27039:3) at flushPassiveEffects (node_modules/react-dom/cjs/react-dom.development.js:26984:14) at node_modules/react-dom/cjs/react-dom.development.js:26769:9 at flushActQueue (node_modules/react/cjs/react.development.js:2667:24) at act (node_modules/react/cjs/react.development.js:2582:11) at node_modules/@testing-library/react/dist/act-compat.js:63:25 at renderRoot (node_modules/@testing-library/react/dist/pure.js:159:26) at render (node_modules/@testing-library/react/dist/pure.js:246:10) at customRender (src/tests/test-utils.tsx:71:16) at Object. (src/components/tx/SignOrExecuteForm/PermissionsCheck/__test__/PermissionsCheck.test.tsx:165:45) โ— PermissionsCheck โ€บ execute the tx when the submit button is clicked ReferenceError: fetch is not defined 70 | const fetchGasOracle = async (gasPriceOracle: GasPriceOracle): Promise => { 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) at getGasPrice (src/hooks/useGasPrice.ts:200:27) at callback (src/hooks/useAsync.ts:21:21) at commitHookEffectListMount (node_modules/react-dom/cjs/react-dom.development.js:23150:26) at commitPassiveMountOnFiber (node_modules/react-dom/cjs/react-dom.development.js:24931:11) at commitPassiveMountEffects_complete (node_modules/react-dom/cjs/react-dom.development.js:24891:9) at commitPassiveMountEffects_begin (node_modules/react-dom/cjs/react-dom.development.js:24878:7) at commitPassiveMountEffects (node_modules/react-dom/cjs/react-dom.development.js:24866:3) at flushPassiveEffectsImpl (node_modules/react-dom/cjs/react-dom.development.js:27039:3) at flushPassiveEffects (node_modules/react-dom/cjs/react-dom.development.js:26984:14) at node_modules/react-dom/cjs/react-dom.development.js:26769:9 at flushActQueue (node_modules/react/cjs/react.development.js:2667:24) at act (node_modules/react/cjs/react.development.js:2582:11) at node_modules/@testing-library/react/dist/act-compat.js:63:25 at renderRoot (node_modules/@testing-library/react/dist/pure.js:159:26) at render (node_modules/@testing-library/react/dist/pure.js:246:10) at customRender (src/tests/test-utils.tsx:71:16) at Object. (src/components/tx/SignOrExecuteForm/PermissionsCheck/__test__/PermissionsCheck.test.tsx:189:34) ```

Report generated by ๐Ÿงชjest coverage report action from 3ae6eb2cdba8b11ce37d58bc06e89b2c9fdbd6b8