Skip to content

Commit

Permalink
[#356] refs: Implement Unmarshal method on SubnetID
Browse files Browse the repository at this point in the history
Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
Leonard Lyubich authored and cthulhu-rider committed Nov 24, 2021
1 parent 50ab22c commit 5ce4b22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions refs/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,11 @@ func (s *SubnetID) StableSize() (size int) {

return
}

// Unmarshal unmarshals SubnetID from NeoFS API V2 binary format (see StableMarshal).
// Must not be called on nil.
//
// Note: empty data corresponds to zero ID value or nil pointer to it.
func (s *SubnetID) Unmarshal(data []byte) error {
return message.Unmarshal(s, data, new(refs.SubnetID))
}

0 comments on commit 5ce4b22

Please sign in to comment.