Skip to content

Commit

Permalink
fix: don't panic if we fail to convert hex to bytes (#3734)
Browse files Browse the repository at this point in the history
  • Loading branch information
kishansagathiya committed Feb 2, 2024
1 parent 8d46333 commit 12234de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dot/state/storage_notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ func (s *StorageState) notifyObserver(root common.Hash, o Observer) error {
} else {
// filter result to include only interested keys
for k, cachedValue := range o.GetFilter() {
value := t.Get(common.MustHexToBytes(k))
bytes, err := common.HexToBytes(k)
if err != nil {
return fmt.Errorf("failed to convert hex to bytes: %s", err)
}
value := t.Get(bytes)
if !reflect.DeepEqual(cachedValue, value) {
kv := &KeyValue{
Key: common.MustHexToBytes(k),
Expand Down

0 comments on commit 12234de

Please sign in to comment.