Skip to content

Commit

Permalink
Merge branch 'genesis-icm' into genesis-poa
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemadero committed Sep 26, 2024
2 parents e7bed94 + a24ae5b commit e39d745
Showing 1 changed file with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions cmd/blockchaincmd/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,29 +306,36 @@ 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
}
if address == common.HexToAddress(validatormanager.PoAValidarorMessengerContractAddress) {
description = "PoA Validator Manager"
}
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 320 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
}
if address == common.HexToAddress(validatormanager.PoAValidarorMessengerContractAddress) {
description = "PoA Validator Manager"
}
if address == common.HexToAddress(validatormanager.PoSValidarorMessengerContractAddress) {
description = "PoS Validator Manager"
}
t.AppendRow(table.Row{description, address.Hex(), deployer})

}

Check failure on line 337 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 e39d745

Please sign in to comment.