@@ -10,12 +10,12 @@ import (
1010 "strings"
1111 "time"
1212
13+ "github.com/0xPolygon/polygon-cli/metrics"
14+ "github.com/0xPolygon/polygon-cli/rpctypes"
1315 ethcommon "github.com/ethereum/go-ethereum/common"
1416 ethrpc "github.com/ethereum/go-ethereum/rpc"
1517 ui "github.com/gizak/termui/v3"
1618 "github.com/gizak/termui/v3/widgets"
17- "github.com/0xPolygon/polygon-cli/metrics"
18- "github.com/0xPolygon/polygon-cli/rpctypes"
1919 "github.com/rs/zerolog/log"
2020)
2121
@@ -25,15 +25,15 @@ var (
2525)
2626
2727type UiSkeleton struct {
28- Current , TxPool , ZkEVM * widgets.Paragraph
29- TxPerBlockChart * widgets.Sparkline
30- GasPriceChart * widgets.Sparkline
31- BlockSizeChart * widgets.Sparkline
32- PendingTxChart * widgets.Sparkline
33- GasChart * widgets.Sparkline
34- BlockInfo * widgets.List
35- TxInfo * widgets.List
36- Receipts * widgets.List
28+ Current , TxPool , ZkEVM , Rollup * widgets.Paragraph
29+ TxPerBlockChart * widgets.Sparkline
30+ GasPriceChart * widgets.Sparkline
31+ BlockSizeChart * widgets.Sparkline
32+ PendingTxChart * widgets.Sparkline
33+ GasChart * widgets.Sparkline
34+ BlockInfo * widgets.List
35+ TxInfo * widgets.List
36+ Receipts * widgets.List
3737}
3838
3939func GetCurrentText (widget * widgets.Paragraph , headBlock * big.Int , gasPrice string , peerCount uint64 , chainID * big.Int , rpcURL string ) string {
@@ -66,6 +66,11 @@ func GetZkEVMText(widget *widgets.Paragraph, trustedBatchesCount, virtualBatches
6666 return formatParagraph (widget , []string {trustedBatches , virtualBatches , verifiedBatches })
6767}
6868
69+ func GetRollupText (widget * widgets.Paragraph , forkID uint64 ) string {
70+ forkIDString := fmt .Sprintf ("ForkID: %d" , forkID )
71+ return formatParagraph (widget , []string {forkIDString })
72+ }
73+
6974func formatParagraph (widget * widgets.Paragraph , content []string ) string {
7075 dx := widget .Inner .Dx ()
7176 dy := widget .Inner .Dy ()
@@ -524,6 +529,10 @@ func SetUISkeleton(txPoolStatusSupported, zkEVMBatchesSupported bool) (blockList
524529 termUi .ZkEVM = widgets .NewParagraph ()
525530 termUi .ZkEVM .Title = "ZkEVM Batch No."
526531 totalWidgets ++
532+
533+ termUi .Rollup = widgets .NewParagraph ()
534+ termUi .Rollup .Title = "Rollup Info"
535+ totalWidgets ++
527536 }
528537
529538 topRowBlocks := []interface {}{
@@ -534,6 +543,8 @@ func SetUISkeleton(txPoolStatusSupported, zkEVMBatchesSupported bool) (blockList
534543 }
535544 if zkEVMBatchesSupported {
536545 topRowBlocks = append (topRowBlocks , ui .NewCol (1.0 / 5.0 , termUi .ZkEVM ))
546+
547+ topRowBlocks = append (topRowBlocks , ui .NewCol (1.0 / 5.0 , termUi .Rollup ))
537548 }
538549
539550 termUi .TxPerBlockChart = widgets .NewSparkline ()
0 commit comments