Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
c3676134
Unverified
Commit
c3676134
authored
Sep 08, 2023
by
Igor Stuev
Committed by
GitHub
Sep 08, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1148 from blockscout/tx-revert-reason-hex-no-hex
support no-hex revert reason
parents
24d14e88
9390eb79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
regexp.ts
lib/regexp.ts
+2
-0
TxRevertReason.tsx
ui/tx/details/TxRevertReason.tsx
+7
-1
No files found.
lib/regexp.ts
View file @
c3676134
export
const
URL_PREFIX
=
/^https
?
:
\/\/
/i
;
export
const
IPFS_PREFIX
=
/^ipfs:
\/\/
/i
;
export
const
HEX_REGEXP
=
/^
(?:
0x
)?[\d
a-fA-F
]
+$/
;
ui/tx/details/TxRevertReason.tsx
View file @
c3676134
import
{
Grid
,
GridItem
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Grid
,
GridItem
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TransactionRevertReason
}
from
'
types/api/transaction
'
;
import
hexToUtf8
from
'
lib/hexToUtf8
'
;
import
{
HEX_REGEXP
}
from
'
lib/regexp
'
;
import
LogDecodedInputData
from
'
ui/shared/logs/LogDecodedInputData
'
;
type
Props
=
TransactionRevertReason
;
...
...
@@ -12,7 +13,12 @@ const TxRevertReason = (props: Props) => {
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
if
(
'
raw
'
in
props
)
{
if
(
!
HEX_REGEXP
.
test
(
props
.
raw
))
{
return
<
Text
>
{
props
.
raw
}
</
Text
>;
}
const
decoded
=
hexToUtf8
(
props
.
raw
);
return
(
<
Grid
bgColor=
{
bgColor
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment