user.ID.ScriptHash should return no error #302

Closed
opened 2024-12-04 11:23:58 +00:00 by fyrchik · 0 comments
Owner

user.ID is a script hash and has 1-1 mapping to it (see #303)
The struct itself may have some of its internal invariants violated, but we already panic in the current code, and this seems right.
DecodeBytesBE returns nil error, because we check the lengths ourselves.
It's implementation may change in future, but I still think that the benefits of more succinct API are bigger, than downsides from ignoring an as-of-now-always-nil error.

`user.ID` _is_ a script hash and has 1-1 mapping to it (see #303) The struct itself may have some of its internal invariants violated, but we already panic in the current code, and this seems right. `DecodeBytesBE` returns nil error, because we check the lengths ourselves. It's implementation may change in future, but I still think that the benefits of more succinct API are bigger, than downsides from ignoring an as-of-now-always-nil error.
fyrchik added the
refactoring
internal
good first issue
labels 2024-12-04 11:27:20 +00:00
elebedeva was assigned by fyrchik 2024-12-27 12:19:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-sdk-go#302
No description provided.