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
db1e20c5
Unverified
Commit
db1e20c5
authored
Nov 14, 2022
by
tom goriunov
Committed by
GitHub
Nov 14, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #309 from blockscout/tx-contract-created
created contract tx state
parents
02bc55b3
ae65e565
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
27 deletions
+40
-27
transaction.ts
types/api/transaction.ts
+2
-2
TxDetails.tsx
ui/tx/TxDetails.tsx
+22
-12
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+4
-3
TxsTableItem.tsx
ui/txs/TxsTableItem.tsx
+12
-10
No files found.
types/api/transaction.ts
View file @
db1e20c5
...
@@ -18,7 +18,7 @@ export interface Transaction {
...
@@ -18,7 +18,7 @@ export interface Transaction {
timestamp
:
string
|
null
;
timestamp
:
string
|
null
;
confirmation_duration
:
Array
<
number
>
;
confirmation_duration
:
Array
<
number
>
;
from
:
AddressParam
;
from
:
AddressParam
;
to
:
AddressParam
;
to
:
AddressParam
|
null
;
created_contract
:
AddressParam
;
created_contract
:
AddressParam
;
value
:
string
;
value
:
string
;
fee
:
Fee
;
fee
:
Fee
;
...
@@ -39,7 +39,7 @@ export interface Transaction {
...
@@ -39,7 +39,7 @@ export interface Transaction {
token_transfers
:
Array
<
TokenTransfer
>
|
null
;
token_transfers
:
Array
<
TokenTransfer
>
|
null
;
token_transfers_overflow
:
boolean
;
token_transfers_overflow
:
boolean
;
exchange_rate
:
string
;
exchange_rate
:
string
;
method
:
string
;
method
:
string
|
null
;
tx_types
:
Array
<
TransactionType
>
;
tx_types
:
Array
<
TransactionType
>
;
tx_tag
:
string
|
null
;
tx_tag
:
string
|
null
;
}
}
...
...
ui/tx/TxDetails.tsx
View file @
db1e20c5
...
@@ -58,10 +58,11 @@ const TxDetails = () => {
...
@@ -58,10 +58,11 @@ const TxDetails = () => {
...
data
.
from
.
watchlist_names
||
[],
...
data
.
from
.
watchlist_names
||
[],
].
map
((
tag
)
=>
<
Tag
key=
{
tag
.
label
}
>
{
tag
.
display_name
}
</
Tag
>);
].
map
((
tag
)
=>
<
Tag
key=
{
tag
.
label
}
>
{
tag
.
display_name
}
</
Tag
>);
const
toAddress
=
data
.
to
&&
data
.
to
.
hash
?
data
.
to
:
data
.
created_contract
;
const
addressToTags
=
[
const
addressToTags
=
[
...
data
.
to
.
private_tags
||
[],
...
toAddress
.
private_tags
||
[],
...
data
.
to
.
public_tags
||
[],
...
toAddress
.
public_tags
||
[],
...
data
.
to
.
watchlist_names
||
[],
...
toAddress
.
watchlist_names
||
[],
].
map
((
tag
)
=>
<
Tag
key=
{
tag
.
label
}
>
{
tag
.
display_name
}
</
Tag
>);
].
map
((
tag
)
=>
<
Tag
key=
{
tag
.
label
}
>
{
tag
.
display_name
}
</
Tag
>);
return
(
return
(
...
@@ -143,31 +144,40 @@ const TxDetails = () => {
...
@@ -143,31 +144,40 @@ const TxDetails = () => {
)
}
)
}
</
DetailsInfoItem
>
</
DetailsInfoItem
>
<
DetailsInfoItem
<
DetailsInfoItem
title=
{
data
.
to
.
is_contract
?
'
Interacted with contract
'
:
'
To
'
}
title=
{
toAddress
.
is_contract
?
'
Interacted with contract
'
:
'
To
'
}
hint=
"Address (external or contract) receiving the transaction."
hint=
"Address (external or contract) receiving the transaction."
flexWrap=
{
{
base
:
'
wrap
'
,
lg
:
'
nowrap
'
}
}
flexWrap=
{
{
base
:
'
wrap
'
,
lg
:
'
nowrap
'
}
}
columnGap=
{
3
}
columnGap=
{
3
}
>
>
<
Address
>
{
data
.
to
&&
data
.
to
.
hash
?
(
<
AddressIcon
hash=
{
data
.
to
.
hash
}
/>
<
Address
>
<
AddressLink
ml=
{
2
}
hash=
{
data
.
to
.
hash
}
/>
<
AddressIcon
hash=
{
toAddress
.
hash
}
/>
<
CopyToClipboard
text=
{
data
.
to
.
hash
}
/>
<
AddressLink
ml=
{
2
}
hash=
{
toAddress
.
hash
}
/>
</
Address
>
<
CopyToClipboard
text=
{
toAddress
.
hash
}
/>
{
data
.
to
.
is_contract
&&
data
.
result
===
'
success
'
&&
(
</
Address
>
)
:
(
<
Flex
width=
"100%"
whiteSpace=
"pre"
>
<
span
>
[Contract
</
span
>
<
AddressLink
hash=
{
toAddress
.
hash
}
/>
<
span
>
created]
</
span
>
<
CopyToClipboard
text=
{
toAddress
.
hash
}
/>
</
Flex
>
)
}
{
toAddress
.
name
&&
<
Text
>
{
toAddress
.
name
}
</
Text
>
}
{
toAddress
.
is_contract
&&
data
.
result
===
'
success
'
&&
(
<
Tooltip
label=
"Contract execution completed"
>
<
Tooltip
label=
"Contract execution completed"
>
<
chakra
.
span
display=
"inline-flex"
>
<
chakra
.
span
display=
"inline-flex"
>
<
Icon
as=
{
successIcon
}
boxSize=
{
4
}
color=
"green.500"
cursor=
"pointer"
/>
<
Icon
as=
{
successIcon
}
boxSize=
{
4
}
color=
"green.500"
cursor=
"pointer"
/>
</
chakra
.
span
>
</
chakra
.
span
>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
{
data
.
to
.
is_contract
&&
Boolean
(
data
.
status
)
&&
data
.
result
!==
'
success
'
&&
(
{
toAddress
.
is_contract
&&
Boolean
(
data
.
status
)
&&
data
.
result
!==
'
success
'
&&
(
<
Tooltip
label=
"Error occured during contract execution"
>
<
Tooltip
label=
"Error occured during contract execution"
>
<
chakra
.
span
display=
"inline-flex"
>
<
chakra
.
span
display=
"inline-flex"
>
<
Icon
as=
{
errorIcon
}
boxSize=
{
4
}
color=
"red.500"
cursor=
"pointer"
/>
<
Icon
as=
{
errorIcon
}
boxSize=
{
4
}
color=
"red.500"
cursor=
"pointer"
/>
</
chakra
.
span
>
</
chakra
.
span
>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
{
data
.
to
.
name
&&
<
Text
>
{
data
.
to
.
name
}
</
Text
>
}
{
addressToTags
.
length
>
0
&&
(
{
addressToTags
.
length
>
0
&&
(
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
{
addressToTags
}
{
addressToTags
}
...
...
ui/txs/TxsListItem.tsx
View file @
db1e20c5
...
@@ -33,6 +33,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
...
@@ -33,6 +33,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
const
iconColor
=
useColorModeValue
(
'
blue.600
'
,
'
blue.300
'
);
const
iconColor
=
useColorModeValue
(
'
blue.600
'
,
'
blue.300
'
);
const
borderColor
=
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
);
const
borderColor
=
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
);
const
dataTo
=
tx
.
to
&&
tx
.
to
.
hash
?
tx
.
to
:
tx
.
created_contract
;
return
(
return
(
<>
<>
...
@@ -99,10 +100,10 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
...
@@ -99,10 +100,10 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
color=
"gray.500"
color=
"gray.500"
/>
/>
<
Address
width=
"calc((100%-40px)/2)"
>
<
Address
width=
"calc((100%-40px)/2)"
>
<
AddressIcon
hash=
{
tx
.
t
o
.
hash
}
/>
<
AddressIcon
hash=
{
dataT
o
.
hash
}
/>
<
AddressLink
<
AddressLink
hash=
{
tx
.
t
o
.
hash
}
hash=
{
dataT
o
.
hash
}
alias=
{
tx
.
t
o
.
name
}
alias=
{
dataT
o
.
name
}
fontWeight=
"500"
fontWeight=
"500"
ml=
{
2
}
ml=
{
2
}
/>
/>
...
...
ui/txs/TxsTableItem.tsx
View file @
db1e20c5
...
@@ -44,12 +44,14 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
...
@@ -44,12 +44,14 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
</
Address
>
</
Address
>
);
);
const
dataTo
=
tx
.
to
&&
tx
.
to
.
hash
?
tx
.
to
:
tx
.
created_contract
;
const
addressTo
=
(
const
addressTo
=
(
<
Address
>
<
Address
>
<
Tooltip
label=
{
tx
.
t
o
.
implementation_name
}
>
<
Tooltip
label=
{
dataT
o
.
implementation_name
}
>
<
Box
display=
"flex"
><
AddressIcon
hash=
{
tx
.
t
o
.
hash
}
/></
Box
>
<
Box
display=
"flex"
><
AddressIcon
hash=
{
dataT
o
.
hash
}
/></
Box
>
</
Tooltip
>
</
Tooltip
>
<
AddressLink
hash=
{
tx
.
to
.
hash
}
alias=
{
tx
.
t
o
.
name
}
fontWeight=
"500"
ml=
{
2
}
truncation=
"constant"
/>
<
AddressLink
hash=
{
dataTo
.
hash
}
alias=
{
dataT
o
.
name
}
fontWeight=
"500"
ml=
{
2
}
truncation=
"constant"
/>
</
Address
>
</
Address
>
);
);
...
@@ -92,13 +94,13 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
...
@@ -92,13 +94,13 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
</
VStack
>
</
VStack
>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
TruncatedTextTooltip
label=
{
tx
.
method
}
>
{
tx
.
method
?
(
<
T
ag
<
T
runcatedTextTooltip
label=
{
tx
.
method
}
>
colorScheme=
{
tx
.
method
===
'
Multicall
'
?
'
teal
'
:
'
gray
'
}
<
Tag
colorScheme=
{
tx
.
method
===
'
Multicall
'
?
'
teal
'
:
'
gray
'
}
>
>
{
tx
.
method
}
{
tx
.
method
}
</
Tag
>
</
T
ag
>
</
T
runcatedTextTooltip
>
</
TruncatedTextTooltip
>
)
:
'
-
'
}
</
Td
>
</
Td
>
<
Td
>
<
Td
>
{
tx
.
block
&&
<
Link
href=
{
link
(
'
block
'
,
{
id
:
tx
.
block
.
toString
()
})
}
>
{
tx
.
block
}
</
Link
>
}
{
tx
.
block
&&
<
Link
href=
{
link
(
'
block
'
,
{
id
:
tx
.
block
.
toString
()
})
}
>
{
tx
.
block
}
</
Link
>
}
...
...
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