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
e6354ba1
Commit
e6354ba1
authored
Oct 11, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tx revert reason
parent
23e48718
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
39 deletions
+90
-39
transaction.ts
types/api/transaction.ts
+6
-4
TxDecodedInputData.tsx
ui/tx/TxDecodedInputData.tsx
+39
-35
TxDetails.tsx
ui/tx/TxDetails.tsx
+9
-0
TxRevertReason.tsx
ui/tx/details/TxRevertReason.tsx
+36
-0
No files found.
types/api/transaction.ts
View file @
e6354ba1
...
...
@@ -3,6 +3,11 @@ import type { DecodedInput } from './decodedInput';
import
type
{
Fee
}
from
'
./fee
'
;
import
type
{
TokenTransfer
}
from
'
./tokenTransfer
'
;
export
type
TransactionRevertReason
=
{
raw
:
string
;
decoded
:
string
;
}
|
DecodedInput
;
export
interface
Transaction
{
hash
:
string
;
result
:
string
;
...
...
@@ -27,10 +32,7 @@ export interface Transaction {
tx_burnt_fee
:
number
|
null
;
nonce
:
number
;
position
:
number
;
revert_reason
:
{
raw
:
string
;
decoded
:
string
;
}
|
null
;
revert_reason
:
TransactionRevertReason
|
null
;
raw_input
:
string
;
decoded_input
:
DecodedInput
|
null
;
token_transfers
:
Array
<
TokenTransfer
>
|
null
;
...
...
ui/tx/TxDecodedInputData.tsx
View file @
e6354ba1
...
...
@@ -111,45 +111,49 @@ const TxDecodedInputData = ({ data }: Props) => {
{
data
.
method_call
}
</
GridItem
>
{
/* TABLE INSIDE OF BLOCK */
}
<
GridItem
pl=
{
PADDING
}
pr=
{
GAP
}
pt=
{
PADDING
}
pb=
{
1
}
bgColor=
{
bgColor
}
fontWeight=
{
600
}
>
{
data
.
parameters
.
length
>
0
&&
(
<>
<
GridItem
pl=
{
PADDING
}
pr=
{
GAP
}
pt=
{
PADDING
}
pb=
{
1
}
bgColor=
{
bgColor
}
fontWeight=
{
600
}
>
Name
</
GridItem
>
<
GridItem
pr=
{
GAP
}
pt=
{
PADDING
}
pb=
{
1
}
bgColor=
{
bgColor
}
fontWeight=
{
600
}
>
</
GridItem
>
<
GridItem
pr=
{
GAP
}
pt=
{
PADDING
}
pb=
{
1
}
bgColor=
{
bgColor
}
fontWeight=
{
600
}
>
Type
</
GridItem
>
{
hasIndexed
&&
(
<
GridItem
pr=
{
GAP
}
pt=
{
PADDING
}
pb=
{
1
}
bgColor=
{
bgColor
}
fontWeight=
{
600
}
>
</
GridItem
>
{
hasIndexed
&&
(
<
GridItem
pr=
{
GAP
}
pt=
{
PADDING
}
pb=
{
1
}
bgColor=
{
bgColor
}
fontWeight=
{
600
}
>
Inde
<
wbr
/>
xed?
</
GridItem
>
)
}
<
GridItem
pr=
{
PADDING
}
pt=
{
PADDING
}
pb=
{
1
}
bgColor=
{
bgColor
}
fontWeight=
{
600
}
>
</
GridItem
>
)
}
<
GridItem
pr=
{
PADDING
}
pt=
{
PADDING
}
pb=
{
1
}
bgColor=
{
bgColor
}
fontWeight=
{
600
}
>
Data
</
GridItem
>
</
GridItem
>
</>
)
}
{
data
.
parameters
.
map
(({
name
,
type
,
value
,
indexed
},
index
)
=>
{
return
(
<
TableRow
key=
{
name
}
name=
{
name
}
type=
{
type
}
isLast=
{
index
===
data
.
parameters
.
length
-
1
}
indexed=
{
indexed
}
>
...
...
ui/tx/TxDetails.tsx
View file @
e6354ba1
...
...
@@ -31,6 +31,7 @@ import TextSeparator from 'ui/shared/TextSeparator';
import
TxStatus
from
'
ui/shared/TxStatus
'
;
import
Utilization
from
'
ui/shared/Utilization
'
;
import
TxDetailsSkeleton
from
'
ui/tx/details/TxDetailsSkeleton
'
;
import
TxRevertReason
from
'
ui/tx/details/TxRevertReason
'
;
import
TokenTransfer
from
'
ui/tx/TokenTransfer
'
;
import
TxDecodedInputData
from
'
ui/tx/TxDecodedInputData
'
;
...
...
@@ -85,6 +86,14 @@ const TxDetails = () => {
>
<
TxStatus
status=
{
data
.
status
}
errorText=
{
data
.
status
===
'
error
'
?
data
.
result
:
undefined
}
/>
</
DetailsInfoItem
>
{
data
.
revert_reason
&&
(
<
DetailsInfoItem
title=
"Revert reason"
hint=
"The revert reason of the transaction."
>
<
TxRevertReason
{
...
data
.
revert_reason
}
/>
</
DetailsInfoItem
>
)
}
<
DetailsInfoItem
title=
"Block"
hint=
"Block number containing the transaction."
...
...
ui/tx/details/TxRevertReason.tsx
0 → 100644
View file @
e6354ba1
import
{
Grid
,
GridItem
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TransactionRevertReason
}
from
'
types/api/transaction
'
;
import
TxDecodedInputData
from
'
ui/tx/TxDecodedInputData
'
;
type
Props
=
TransactionRevertReason
;
const
TxRevertReason
=
(
props
:
Props
)
=>
{
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
if
(
'
raw
'
in
props
)
{
return
(
<
Grid
bgColor=
{
bgColor
}
p=
{
4
}
fontSize=
"sm"
borderRadius=
"md"
templateColumns=
"auto minmax(0, 1fr)"
rowGap=
{
2
}
columnGap=
{
4
}
whiteSpace=
"normal"
>
<
GridItem
fontWeight=
{
500
}
>
Raw:
</
GridItem
>
<
GridItem
>
{
props
.
raw
}
</
GridItem
>
<
GridItem
fontWeight=
{
500
}
>
Decoded:
</
GridItem
>
<
GridItem
>
{
props
.
decoded
}
</
GridItem
>
</
Grid
>
);
}
return
<
TxDecodedInputData
data=
{
props
}
/>;
};
export
default
React
.
memo
(
TxRevertReason
);
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