Skip to content

Commit

Permalink
fix: panic if poa admin address is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorency committed Aug 6, 2024
1 parent 5809aea commit 55ce29c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ import (
// The default PoA admin is the governance module account.
func GetPoAAdmin() string {
if addr := os.Getenv("POA_ADMIN_ADDRESS"); addr != "" {
// Panic if the address is invalid
_, err := sdk.AccAddressFromBech32(addr)
if err != nil {
panic(fmt.Sprintf("invalid POA_ADMIN_ADDRESS: %s", addr))

Check warning on line 150 in app/app.go

View check run for this annotation

Codecov / codecov/patch

app/app.go#L150

Added line #L150 was not covered by tests
}
return addr
}

Expand Down

0 comments on commit 55ce29c

Please sign in to comment.