[#229] v2/object: Add hash fields to ShortHeader message

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-12-17 13:18:07 +03:00
parent b2528d4c59
commit 8fe135ab8c
5 changed files with 81 additions and 1 deletions

View file

@ -19,6 +19,8 @@ type ShortHeader struct {
typ Type
payloadLen uint64
payloadHash, homoHash *refs.Checksum
}
type Attribute struct {
@ -296,6 +298,34 @@ func (h *ShortHeader) SetPayloadLength(v uint64) {
}
}
func (h *ShortHeader) GetPayloadHash() *refs.Checksum {
if h != nil {
return h.payloadHash
}
return nil
}
func (h *ShortHeader) SetPayloadHash(v *refs.Checksum) {
if h != nil {
h.payloadHash = v
}
}
func (h *ShortHeader) GetHomomorphicHash() *refs.Checksum {
if h != nil {
return h.homoHash
}
return nil
}
func (h *ShortHeader) SetHomomorphicHash(v *refs.Checksum) {
if h != nil {
h.homoHash = v
}
}
func (h *ShortHeader) getHeaderPart() {}
func (a *Attribute) GetKey() string {