Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/geth: support string (non-hex) keys in db get/put/delete #23744

Merged
merged 6 commits into from
Oct 18, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update cmd/utils/cmd.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
  • Loading branch information
zhiburt and holiman authored Oct 15, 2021
commit 92b82c743df04d0bd5b917a9fdc4ae23fcba759d
9 changes: 3 additions & 6 deletions cmd/utils/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,10 @@ func ExportPreimages(db ethdb.Database, fn string) error {

zhiburt marked this conversation as resolved.
Show resolved Hide resolved
func ParseHexOrString(b string) ([]byte, error) {
k, err := hexutil.Decode(b)
if err != nil {
if err == hexutil.ErrMissingPrefix {
return []byte(b), nil
}

return nil, err
if errors.Is(err,hexutil.ErrMissingPrefix) {
return []byte(b), nil
}
return k, err

return k, nil
}