[#356] refs: Implement Unmarshal method on SubnetID

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-11-23 14:23:49 +03:00 committed by LeL
parent 50ab22c19c
commit 5ce4b22e40

View file

@ -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))
}