[#1369] checksum: Upgrade SDK package

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-05-11 19:35:01 +03:00 committed by LeL
parent 088df0e2a9
commit ae92074272
16 changed files with 96 additions and 56 deletions

View file

@ -54,7 +54,11 @@ func (t *validatingTarget) WriteHeader(obj *objectSDK.Object) error {
return ErrExceedingMaxSize
}
cs := obj.PayloadChecksum()
cs, csSet := obj.PayloadChecksum()
if !csSet {
return errors.New("missing payload checksum")
}
switch typ := cs.Type(); typ {
default:
return fmt.Errorf("(%T) unsupported payload checksum type %v", t, typ)
@ -64,7 +68,7 @@ func (t *validatingTarget) WriteHeader(obj *objectSDK.Object) error {
t.hash = tz.New()
}
t.checksum = cs.Sum()
t.checksum = cs.Value()
}
if err := t.fmt.Validate(obj, t.unpreparedObject); err != nil {