-
Notifications
You must be signed in to change notification settings - Fork 404
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(display-raw-data): Show raw data when the method name and parameters is missing in a tx #4260
base: dev
Are you sure you want to change the base?
Conversation
Branch preview✅ Deploy successful! Storybook: |
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
954.82 KB (🟡 +26 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!
Coverage reportCaution Test run failed
Show files with reduced coverage 🔻
Test suite run failedFailed tests: 0/1460. Failed suites: 7/203.
Report generated by 🧪jest coverage report action from fa1a642 |
src/components/transactions/TxDetails/TxData/DecodedData/index.tsx
Outdated
Show resolved
Hide resolved
@@ -50,7 +50,7 @@ export const DecodedData = ({ txData, toInfo }: Props): ReactElement | null => { | |||
const avatar = addressInfo?.logoUri || toInfo?.logoUri || txData.to.logoUri | |||
|
|||
let decodedData = <></> | |||
if (txData.dataDecoded) { | |||
if (txData.dataDecoded && (method || (!method && txData.dataDecoded.parameters))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check for the parameters and method name is needed because for a native token transfer (from transaction builder) the decoded data comes also with an empty method:
{
"type": "GENERIC",
"method": "",
"parameters": [
{
"name": "to",
"type": "address",
"value": "0xDa5e9FA404881Ff36DDa97b41Da402dF6430EE6b"
},
{
"name": "value",
"type": "uint256",
"value": "1000000000000000000"
}
]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well!
Could you add a unit test case to e.g. DecodedTx/index.test.ts
?
What it solves
Resolves #4215
How this PR fixes it
it adds the hexData in the txData of the
DecodedTx
component and check if there is parameters when the method name is missing, if there are no parameters and method name is missing, we show the raw hexDataHow to test it
Expected: The raw data should appears in the confirmation screen as screenshot bellow
Screenshots
Checklist