[#356] refs: Implement `Unmarshal` method on `SubnetID`

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/KirillovDenis/master
Leonard Lyubich 2021-11-23 14:23:49 +03:00 committed by LeL
parent 50ab22c19c
commit 5ce4b22e40
1 changed files with 8 additions and 0 deletions

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