Skip to content

Commit

Permalink
fix: remove error check when parsing cert id
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Jul 29, 2024
1 parent 7c08dc6 commit dcc6f7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions x/cert/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions x/cert/keeper/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand All @@ -66,5 +66,5 @@ func parseCertID(from []byte) (types.CertID, error) {
strOwner := res.Owner.String()
_ = strOwner

return res, nil
return res
}

0 comments on commit dcc6f7a

Please sign in to comment.