-
Notifications
You must be signed in to change notification settings - Fork 360
fix: bytes params are truncated #3600
Conversation
|
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Pull Request Test Coverage Report for Build 1946166994
💛 - Coveralls |
|
E2E Tests Failed Failed tests:
|
iamacook
left a comment
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.
| export const isUint = (type: string): boolean => type.indexOf('uint') === 0 | ||
| export const isInt = (type: string): boolean => type.indexOf('int') === 0 | ||
| export const isByte = (type: string): boolean => type.indexOf('byte') === 0 | ||
| export const isBytes = (type: string): boolean => type.indexOf('bytes') === 0 |
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.
Is "byte" never returned?
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.
I was checking Solidity documentation and all the byte arrays types start with bytes....
Curiously also found that
Prior to version 0.8.0, byte used to be an alias for bytes1.
I think we'd be safe this way but will revert the expression as it is not adding much value.
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.
I'd suggest renaming the function back then.
src/routes/safe/components/Transactions/TxList/MethodDetails.tsx
Outdated
Show resolved
Hide resolved
I've reduce the number of characters being displayed when
If we'd go with a monospaced font, byte arrays would display more elegantly. Otherwise I find this one tricky as it requires calculating if we should truncate the value based on the hexData width and not in the number of characters. |
6c3a9f4 to
31e5a38
Compare
iamacook
left a comment
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.
💪
aed5200 to
20d6ac3
Compare
|
The bytes data look fine |








What it solves
Resolves #3592
How this PR fixes it
Truncates Smart Contracts methods
bytesvaluesHow to test it
Open a transaction details, for instance:
eth:0x84443F61efc60D10DA9F9a2398980CD5748394BB/transactions/0xb176b051059e2fea8418e4206cca7e7e4cb99b52c18031a27660914d39991592bytesare now truncatedScreenshots