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
61b2d54a
Commit
61b2d54a
authored
Jan 17, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tx info in address logs
parent
77e0febf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
10 deletions
+19
-10
log.ts
types/api/log.ts
+1
-0
LogItem.pw.tsx
ui/shared/logs/LogItem.pw.tsx
+4
-2
LogItem.tsx
ui/shared/logs/LogItem.tsx
+13
-7
TxLogs.tsx
ui/tx/TxLogs.tsx
+1
-1
No files found.
types/api/log.ts
View file @
61b2d54a
...
...
@@ -7,6 +7,7 @@ export interface Log {
data
:
string
;
index
:
number
;
decoded
:
DecodedInput
|
null
;
tx_hash
:
string
|
null
;
}
export
interface
LogsResponseTx
{
...
...
ui/shared/logs/LogItem.pw.tsx
View file @
61b2d54a
...
...
@@ -24,7 +24,8 @@ test('with decoded input data +@mobile +@dark-mode', async({ mount }) => {
address=
{
addressMocks
.
withName
}
topics=
{
TOPICS
}
data=
{
DATA
}
type=
"tx"
type=
"transaction"
tx_hash=
{
null
}
/>
</
TestApp
>,
);
...
...
@@ -40,7 +41,8 @@ test('without decoded input data +@mobile', async({ mount }) => {
address=
{
addressMocks
.
withoutName
}
topics=
{
TOPICS
}
data=
{
DATA
}
type=
"tx"
type=
"transaction"
tx_hash=
{
null
}
/>
</
TestApp
>,
);
...
...
ui/shared/logs/LogItem.tsx
View file @
61b2d54a
...
...
@@ -14,7 +14,7 @@ import LogDecodedInputData from 'ui/shared/logs/LogDecodedInputData';
import
LogTopic
from
'
ui/shared/logs/LogTopic
'
;
type
Props
=
Log
&
{
type
:
'
address
'
|
'
t
x
'
;
type
:
'
address
'
|
'
t
ransaction
'
;
};
const
RowHeader
=
({
children
}:
{
children
:
React
.
ReactNode
})
=>
(
...
...
@@ -23,11 +23,13 @@ const RowHeader = ({ children }: { children: React.ReactNode }) => (
</
GridItem
>
);
const
TxLogItem
=
({
address
,
index
,
topics
,
data
,
decoded
,
type
}:
Props
)
=>
{
const
LogItem
=
({
address
,
index
,
topics
,
data
,
decoded
,
type
,
tx_hash
:
txHash
}:
Props
)
=>
{
const
borderColor
=
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
);
const
dataBgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
const
hasTxInfo
=
type
===
'
address
'
&&
txHash
;
return
(
<
Grid
gridTemplateColumns=
{
{
base
:
'
minmax(0, 1fr)
'
,
lg
:
'
200px minmax(0, 1fr)
'
}
}
...
...
@@ -41,7 +43,7 @@ const TxLogItem = ({ address, index, topics, data, decoded, type }: Props) => {
pt
:
0
,
}
}
>
{
!
decoded
&&
type
===
'
t
x
'
&&
(
{
!
decoded
&&
type
===
'
t
ransaction
'
&&
(
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
<
Alert
status=
"warning"
display=
"inline-table"
whiteSpace=
"normal"
>
To see accurate decoded input data, the contract must be verified.
{
space
}
...
...
@@ -49,11 +51,15 @@ const TxLogItem = ({ address, index, topics, data, decoded, type }: Props) => {
</
Alert
>
</
GridItem
>
)
}
<
RowHeader
>
Address
</
RowHeader
>
{
hasTxInfo
?
<
RowHeader
>
Transaction
</
RowHeader
>
:
<
RowHeader
>
Address
</
RowHeader
>
}
<
GridItem
display=
"flex"
alignItems=
"center"
>
<
Address
mr=
{
{
base
:
9
,
lg
:
0
}
}
>
<
AddressIcon
address=
{
address
}
/>
<
AddressLink
hash=
{
address
.
hash
}
alias=
{
address
.
name
}
ml=
{
2
}
/>
{
!
hasTxInfo
&&
<
AddressIcon
address=
{
address
}
mr=
{
2
}
/>
}
<
AddressLink
hash=
{
hasTxInfo
?
txHash
:
address
.
hash
}
alias=
{
hasTxInfo
?
undefined
:
address
.
name
}
type=
{
type
}
/>
</
Address
>
{
/* api doesn't have find topic feature yet */
}
{
/* <Tooltip label="Find matches topic">
...
...
@@ -93,4 +99,4 @@ const TxLogItem = ({ address, index, topics, data, decoded, type }: Props) => {
);
};
export
default
React
.
memo
(
Tx
LogItem
);
export
default
React
.
memo
(
LogItem
);
ui/tx/TxLogs.tsx
View file @
61b2d54a
...
...
@@ -50,7 +50,7 @@ const TxLogs = () => {
<
Pagination
ml=
"auto"
{
...
pagination
}
/>
</
ActionBar
>
)
}
{
data
.
items
.
map
((
item
,
index
)
=>
<
LogItem
key=
{
index
}
{
...
item
}
type=
"t
x
"
/>)
}
{
data
.
items
.
map
((
item
,
index
)
=>
<
LogItem
key=
{
index
}
{
...
item
}
type=
"t
ransaction
"
/>)
}
</
Box
>
);
};
...
...
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