You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The core/store API indicates that nil should be returned when the key does not exist in the key/value store.
This is a behaviour inherited from BBolt, but it's not the most natural implementation. BBolt makes this choice assuming that errors never happen, except for a "key not found", but this assumption may not hold for other stores.
As a consequence, there are two error signals: the returned error and the value returned. This does not allow store users (smart contracts, ...) to cleanly manage the cases where a key does not exist. It would be much preferable (and more explicit) to return a sentinel error to indicate that the key was not found.
This implies updating:
The
core/store
API indicates thatnil
should be returned when the key does not exist in the key/value store.This is a behaviour inherited from BBolt, but it's not the most natural implementation. BBolt makes this choice assuming that errors never happen, except for a "key not found", but this assumption may not hold for other stores.
As a consequence, there are two error signals: the returned error and the value returned. This does not allow store users (smart contracts, ...) to cleanly manage the cases where a key does not exist. It would be much preferable (and more explicit) to return a sentinel error to indicate that the key was not found.
This implies updating:
core/store
APIcore/store
implementations (hashtree
,kv
)core/access/darc
)The text was updated successfully, but these errors were encountered: