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
{{ message }}
Repository navigation
op env's get_by_path return value different from root_state_accessor_stub's get_object_by_path #235
This should be formed by some historical reasons, in the rpc interface, if the target does not exist, either return None, or NotFound error
get_object_by_path
For accessor.get_object_by_path method, this internal is integrated with the root-state and non interfaces, so at the beginning of the design, the counterpart is non.get_object (because the semantics are closer), and non.get_object is a very old interface, at the beginning of the design is designed to return NotFound when the target object does not exist
get_object_by_path's target does not exist, but also contains two layers of meaning
The corresponding path does not exist on the root-state
The object_id corresponding to root-state/{path}, but the corresponding object does not exist
op-env's get relate methods
op-env is designed to add, delete, check and change global-state (root-state + local-cache), so if the path does not exist, it is more friendly to return None directly, against the interface of some common data structures, such as the get interface of rust's HashMap
Activity
lurenpluto commentedon Apr 22, 2023
This should be formed by some historical reasons, in the rpc interface, if the target does not exist, either return
None, orNotFounderrorget_object_by_path
For
accessor.get_object_by_pathmethod, this internal is integrated with the root-state and non interfaces, so at the beginning of the design, the counterpart isnon.get_object(because the semantics are closer), andnon.get_objectis a very old interface, at the beginning of the design is designed to returnNotFoundwhen the target object does not existget_object_by_path's target does not exist, but also contains two layers of meaningop-env's get relate methods
op-env is designed to add, delete, check and change global-state (root-state + local-cache), so if the path does not exist, it is more friendly to return None directly, against the interface of some common data structures, such as the get interface of rust's HashMap
https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.get