diff --git a/x/cert/keeper/keeper.go b/x/cert/keeper/keeper.go index 9b7a28548..c43ba0847 100644 --- a/x/cert/keeper/keeper.go +++ b/x/cert/keeper/keeper.go @@ -147,10 +147,7 @@ func (k keeper) WithCertificates1(ctx sdk.Context, fn func(id types.CertID, cert }() for ; iter.Valid(); iter.Next() { - id, err := parseCertID(iter.Key()) - if err != nil { - panic(err.Error()) - } + id := parseCertID(iter.Key()) item := k.mustUnmarshal(iter.Key(), iter.Value()) if stop := fn(id, item); stop { diff --git a/x/cert/keeper/key.go b/x/cert/keeper/key.go index 0c4573ccd..3ec10fbe9 100644 --- a/x/cert/keeper/key.go +++ b/x/cert/keeper/key.go @@ -51,7 +51,7 @@ func certificateSerialFromKey(key []byte) big.Int { return *new(big.Int).SetBytes(key[keyAddrPrefixLen+addrLen:]) } -func parseCertID(from []byte) (types.CertID, error) { +func parseCertID(from []byte) types.CertID { res := types.CertID{ Serial: *big.NewInt(0), } @@ -66,5 +66,5 @@ func parseCertID(from []byte) (types.CertID, error) { strOwner := res.Owner.String() _ = strOwner - return res, nil + return res }