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
311 stars 360 forks source link

Feat: TWAP order decoding in tx history/queue [SW-1] #3861

Closed compojoom closed 1 week ago

compojoom commented 1 week ago

What it solves

Resolves # https://www.notion.so/safe-global/76f265123c0a4ad680947ce489804342?v=17c30f9503cd4d48a622209408de56d6&p=0f273a0f06f2465589628c7299f44e05&pm=s

How to test it

Create a twap order throw the native swap feature.

Screenshots

grafik

Checklist

notion-workspace[bot] commented 1 week ago

Swap order - queue/history decoding

github-actions[bot] commented 1 week ago

Branch preview

βœ… Deploy successful!

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

Storybook: https://feat_twaps--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

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
78.92% (-0.26% πŸ”»)
11613/14714
πŸ”΄ Branches
58.36% (-0.11% πŸ”»)
2811/4817
🟑 Functions
65.83% (-0.28% πŸ”»)
1857/2821
🟒 Lines
80.25% (-0.27% πŸ”»)
10471/13048
Show new covered files 🐣
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | πŸ”΄ |
`...` / SwapTx.tsx
| 45.45% | 0% | 0% | 50% | | 🟒 |
`...` / interactWith.tsx
| 57.14% | 0% | 0% | 80% | | 🟒 |
`...` / EmptyRow.tsx
| 66.67% | 100% | 0% | 100% |
Show files with reduced coverage πŸ”»
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | 🟑 |
`...` / transaction-guards.ts
|
78.52% (-1.9% πŸ”»)
|
47.5% (-2.5% πŸ”»)
|
75% (-3.26% πŸ”»)
|
79.21% (-1.2% πŸ”»)
| | 🟑 |
`...` / formatters.ts
|
76.92% (-0.44% πŸ”»)
|
54.55% (-6.99% πŸ”»)
| 83.33% |
76.32% (-0.61% πŸ”»)
| | 🟑 |
`...` / index.tsx
|
59.26% (-6.13% πŸ”»)
| 0% | 0% |
66.67% (-4.17% πŸ”»)
| | 🟑 |
`...` / index.tsx
|
71.88% (-1.65% πŸ”»)
|
30% (+1.43% πŸ”Ό)
|
50% (+7.14% πŸ”Ό)
|
73.33% (-1.67% πŸ”»)
| | 🟑 |
`...` / useTransactionType.ts
|
67.57% (-1.88% πŸ”»)
|
41.03% (-1.08% πŸ”»)
| 100% |
68.57% (-2.02% πŸ”»)
| | 🟒 |
`...` / index.tsx
|
87.72% (-0.61% πŸ”»)
|
75.76% (+3.54% πŸ”Ό)
| 60% |
86.79% (-0.71% πŸ”»)
| | πŸ”΄ |
`...` / index.tsx
|
35.56% (-16.94% πŸ”»)
| 0% | 0% |
37.65% (-20.69% πŸ”»)
|

Test suite run success

1446 tests passing in 199 suites.

Report generated by πŸ§ͺjest coverage report action from 586802b6faa992b78623de16b349a2024c3cd135

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 1004.67 KB (🟑 +768 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!

Six Pages Changed Size

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

Page Size (compressed) First Load
/apps 50.12 KB (🟑 +3.56 KB) 1.03 MB
/apps/custom 41.74 KB (🟑 +3.56 KB) 1.02 MB
/apps/open 52.28 KB (🟑 +3.56 KB) 1.03 MB
/home 59.98 KB (🟑 +3.56 KB) 1.04 MB
/settings/safe-apps 25.96 KB (🟑 +3.56 KB) 1.01 MB
/swap 29.94 KB (🟑 +3.59 KB) 1.01 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.

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

francovenica commented 1 week ago

For me it throws an error right where the type of tx is not recognized and won't allow me to execute. Given this I can see the tx in the queue (which it loosk fine btw) but not in the history tab.

image

The safe: https://feat_twaps--walletweb.review.5afe.dev/transactions/queue?safe=sep:0x8f4A19C85b39032A37f7a6dCc65234f966F72551

Is a sepolia safe with only 1 owner Is a tx that was queued first and I'm trying to execute now. I didn't had issues signing the tx in the first place. I had to check the checkbox to update the fallbackhandler during the TWAP creation, so "SetFallbackHandler" is also in the bulk for execution

compojoom commented 1 week ago

@francovenica - I was able to reproduce & fix the bug you encountered: https://github.com/safe-global/safe-wallet-web/pull/3865