Skip to content

Commit

Permalink
chg: better comment on panic
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Mar 13, 2024
1 parent 722da0a commit a852574
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/keys/secp256k1/secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const PubKeySize = 65
// Address returns an Ethereum style addresses
func (pubKey *PubKey) Address() crypto.Address {
if len(pubKey.Key) != PubKeySize {
panic("length of pubkey is incorrect")
panic(fmt.Sprintf("length of pubkey is incorrect %d != %d", len(pubKey.Key), PubKeySize))

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
}

return crypto.Address(ethCrypto.Keccak256(pubKey.Key[1:])[12:])
Expand Down

0 comments on commit a852574

Please sign in to comment.