Skip to content

Commit

Permalink
feat: Proxy client - address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
EthenNotEthan committed Jun 9, 2024
1 parent fad7859 commit b6c518f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ func (c *client) SetData(ctx context.Context, b []byte) (*common.Certificate, er
return nil, fmt.Errorf("read certificate is of invalid length: %d", len(b))
}

var blob *common.Certificate
if err = rlp.DecodeBytes(b[decodingOffset:], &blob); err != nil {
var cert *common.Certificate
if err = rlp.DecodeBytes(b[decodingOffset:], &cert); err != nil {
return nil, err
}

return blob, err
return cert, err
}
23 changes: 0 additions & 23 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,26 +110,3 @@ func ParseBytesAmount(s string) (uint64, error) {
return 0, fmt.Errorf("unsupported unit: %s", unit)
}
}

func SubsetExists[P comparable](arr, sub []P) bool {
if len(sub) == 0 {
return true
}

i := 0
j := 0

for i < len(arr) {
if arr[i] == sub[j] {
j++
if j == len(sub) {
return true
}
} else {
i -= j
j = 0
}
i++
}
return false
}

0 comments on commit b6c518f

Please sign in to comment.