Skip to content

Commit

Permalink
Update cmd/blockchaincmd/describe.go
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kaplan <[email protected]>
Signed-off-by: felipemadero <[email protected]>
  • Loading branch information
felipemadero and michaelkaplan13 authored Sep 26, 2024
1 parent 0e054cb commit a24ae5b
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions cmd/blockchaincmd/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,26 +305,30 @@ func printAllocations(sc models.Sidecar, genesis core.Genesis) error {
}

func printSmartContracts(genesis core.Genesis) {
if len(genesis.Alloc) > 0 {
ux.Logger.PrintToUser("")
t := table.NewWriter()
t.Style().Title.Align = text.AlignCenter
t.Style().Title.Format = text.FormatUpper
t.Style().Options.SeparateRows = true
t.SetTitle("Smart Contracts")
t.AppendHeader(table.Row{"Description", "Address", "Deployer"})
for address, allocation := range genesis.Alloc {
var description, deployer string
if len(allocation.Code) > 0 {
if address == common.HexToAddress(icmgenesis.MessengerContractAddress) {
description = "ICM Messenger"
deployer = icmgenesis.MessengerDeployerAddress
}
t.AppendRow(table.Row{description, address.Hex(), deployer})
}
if len(genesis.Alloc) == 0 {
return
}

ux.Logger.PrintToUser("")
t := table.NewWriter()
t.Style().Title.Align = text.AlignCenter
t.Style().Title.Format = text.FormatUpper
t.Style().Options.SeparateRows = true
t.SetTitle("Smart Contracts")
t.AppendHeader(table.Row{"Description", "Address", "Deployer"})
for address, allocation := range genesis.Alloc {

Check warning on line 319 in cmd/blockchaincmd/describe.go

View workflow job for this annotation

GitHub Actions / Lint

empty-lines: extra empty line at the end of a block (revive)
if len(allocation.Code) == 0 {
continue
}
ux.Logger.PrintToUser(t.Render())
var description, deployer string
if address == common.HexToAddress(icmgenesis.MessengerContractAddress) {
description = "ICM Messenger"
deployer = icmgenesis.MessengerDeployerAddress
}
t.AppendRow(table.Row{description, address.Hex(), deployer})

Check failure on line 329 in cmd/blockchaincmd/describe.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofmt`-ed with `-s` (gofmt)
}

Check failure on line 330 in cmd/blockchaincmd/describe.go

View workflow job for this annotation

GitHub Actions / Lint

unnecessary trailing newline (whitespace)
ux.Logger.PrintToUser(t.Render())
}

func printPrecompiles(genesis core.Genesis) {
Expand Down

0 comments on commit a24ae5b

Please sign in to comment.