Replies: 1 comment
-
This should be formed by some historical reasons, in the rpc interface, if the target does not exist, either return get_object_by_pathFor
op-env's get relate methodsop-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 |
Beta Was this translation helpful? Give feedback.
-
path op env's get_by_path has return value BuckyResult<Option>
it shows when path not exists, it may return Ok(None)
but root_state_accessor_stub's get_object_by_path function has return value BuckyResult
I think when path not exists, it will return BuckyErrorCode::NotFound?
Is there a need to make the return values of these two functions same?
Beta Was this translation helpful? Give feedback.
All reactions