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
8d1de2c4
Unverified
Commit
8d1de2c4
authored
May 29, 2023
by
Igor Stuev
Committed by
GitHub
May 29, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #841 from blockscout/block-wthdrwls-count
add withdrawals to block details
parents
22cbf9f4
132d3b1d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
5 deletions
+15
-5
block.ts
mocks/blocks/block.ts
+0
-2
block.ts
stubs/block.ts
+0
-1
block.ts
types/api/block.ts
+1
-1
BlockDetails.tsx
ui/block/BlockDetails.tsx
+13
-0
Block.tsx
ui/pages/Block.tsx
+1
-1
No files found.
mocks/blocks/block.ts
View file @
8d1de2c4
...
@@ -47,7 +47,6 @@ export const base: Block = {
...
@@ -47,7 +47,6 @@ export const base: Block = {
tx_fees
:
'
26853607500000000
'
,
tx_fees
:
'
26853607500000000
'
,
type
:
'
block
'
,
type
:
'
block
'
,
uncles_hashes
:
[],
uncles_hashes
:
[],
has_beacon_chain_withdrawals
:
false
,
};
};
export
const
genesis
:
Block
=
{
export
const
genesis
:
Block
=
{
...
@@ -84,7 +83,6 @@ export const genesis: Block = {
...
@@ -84,7 +83,6 @@ export const genesis: Block = {
tx_fees
:
'
0
'
,
tx_fees
:
'
0
'
,
type
:
'
block
'
,
type
:
'
block
'
,
uncles_hashes
:
[],
uncles_hashes
:
[],
has_beacon_chain_withdrawals
:
false
,
};
};
export
const
base2
:
Block
=
{
export
const
base2
:
Block
=
{
...
...
stubs/block.ts
View file @
8d1de2c4
...
@@ -14,7 +14,6 @@ export const BLOCK: Block = {
...
@@ -14,7 +14,6 @@ export const BLOCK: Block = {
gas_target_percentage
:
55.79
,
gas_target_percentage
:
55.79
,
gas_used
:
'
6631036
'
,
gas_used
:
'
6631036
'
,
gas_used_percentage
:
22.10
,
gas_used_percentage
:
22.10
,
has_beacon_chain_withdrawals
:
null
,
hash
:
BLOCK_HASH
,
hash
:
BLOCK_HASH
,
height
:
8988736
,
height
:
8988736
,
miner
:
ADDRESS_PARAMS
,
miner
:
ADDRESS_PARAMS
,
...
...
types/api/block.ts
View file @
8d1de2c4
...
@@ -10,7 +10,6 @@ export interface Block {
...
@@ -10,7 +10,6 @@ export interface Block {
tx_count
:
number
;
tx_count
:
number
;
miner
:
AddressParam
;
miner
:
AddressParam
;
size
:
number
;
size
:
number
;
has_beacon_chain_withdrawals
:
boolean
|
null
;
hash
:
string
;
hash
:
string
;
parent_hash
:
string
;
parent_hash
:
string
;
difficulty
:
string
;
difficulty
:
string
;
...
@@ -30,6 +29,7 @@ export interface Block {
...
@@ -30,6 +29,7 @@ export interface Block {
type
:
BlockType
;
type
:
BlockType
;
tx_fees
:
string
|
null
;
tx_fees
:
string
|
null
;
uncles_hashes
:
Array
<
string
>
;
uncles_hashes
:
Array
<
string
>
;
withdrawals_count
?:
number
;
}
}
export
interface
BlocksResponse
{
export
interface
BlocksResponse
{
...
...
ui/block/BlockDetails.tsx
View file @
8d1de2c4
...
@@ -180,6 +180,19 @@ const BlockDetails = ({ query }: Props) => {
...
@@ -180,6 +180,19 @@ const BlockDetails = ({ query }: Props) => {
</
LinkInternal
>
</
LinkInternal
>
</
Skeleton
>
</
Skeleton
>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
{
appConfig
.
beaconChain
.
hasBeaconChain
&&
Boolean
(
data
.
withdrawals_count
)
&&
(
<
DetailsInfoItem
title=
"Withdrawals"
hint=
"The number of beacon withdrawals in the block"
isLoading=
{
isPlaceholderData
}
>
<
Skeleton
isLoaded=
{
!
isPlaceholderData
}
>
<
LinkInternal
href=
{
route
({
pathname
:
'
/block/[height]
'
,
query
:
{
height
:
heightOrHash
,
tab
:
'
withdrawals
'
}
})
}
>
{
data
.
withdrawals_count
}
withdrawal
{
data
.
withdrawals_count
===
1
?
''
:
'
s
'
}
</
LinkInternal
>
</
Skeleton
>
</
DetailsInfoItem
>
)
}
<
DetailsInfoItem
<
DetailsInfoItem
title=
{
appConfig
.
network
.
verificationType
===
'
validation
'
?
'
Validated by
'
:
'
Mined by
'
}
title=
{
appConfig
.
network
.
verificationType
===
'
validation
'
?
'
Validated by
'
:
'
Mined by
'
}
hint=
"A block producer who successfully included the block onto the blockchain"
hint=
"A block producer who successfully included the block onto the blockchain"
...
...
ui/pages/Block.tsx
View file @
8d1de2c4
...
@@ -81,7 +81,7 @@ const BlockPageContent = () => {
...
@@ -81,7 +81,7 @@ const BlockPageContent = () => {
const
tabs
:
Array
<
RoutedTab
>
=
React
.
useMemo
(()
=>
([
const
tabs
:
Array
<
RoutedTab
>
=
React
.
useMemo
(()
=>
([
{
id
:
'
index
'
,
title
:
'
Details
'
,
component
:
<
BlockDetails
query=
{
blockQuery
}
/>
},
{
id
:
'
index
'
,
title
:
'
Details
'
,
component
:
<
BlockDetails
query=
{
blockQuery
}
/>
},
{
id
:
'
txs
'
,
title
:
'
Transactions
'
,
component
:
<
TxsContent
query=
{
blockTxsQuery
}
showBlockInfo=
{
false
}
showSocketInfo=
{
false
}
/>
},
{
id
:
'
txs
'
,
title
:
'
Transactions
'
,
component
:
<
TxsContent
query=
{
blockTxsQuery
}
showBlockInfo=
{
false
}
showSocketInfo=
{
false
}
/>
},
appConfig
.
beaconChain
.
hasBeaconChain
&&
blockQuery
.
data
?.
has_beacon_chain_withdrawals
?
appConfig
.
beaconChain
.
hasBeaconChain
&&
Boolean
(
blockQuery
.
data
?.
withdrawals_count
)
?
{
id
:
'
withdrawals
'
,
title
:
'
Withdrawals
'
,
component
:
<
BlockWithdrawals
blockWithdrawalsQuery=
{
blockWithdrawalsQuery
}
/>
}
:
{
id
:
'
withdrawals
'
,
title
:
'
Withdrawals
'
,
component
:
<
BlockWithdrawals
blockWithdrawalsQuery=
{
blockWithdrawalsQuery
}
/>
}
:
null
,
null
,
].
filter
(
Boolean
)),
[
blockQuery
,
blockTxsQuery
,
blockWithdrawalsQuery
]);
].
filter
(
Boolean
)),
[
blockQuery
,
blockTxsQuery
,
blockWithdrawalsQuery
]);
...
...
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