Implement signed data calculating function from SignedDataReader

This commit is contained in:
Leonard Lyubich 2020-05-11 17:28:44 +03:00
parent ab198b4049
commit e01fb0cc62
10 changed files with 126 additions and 149 deletions

View file

@ -1,16 +1,14 @@
package bootstrap
import "io"
import (
"io"
"github.com/nspcc-dev/neofs-api-go/service"
)
// SignedData returns payload bytes of the request.
func (m Request) SignedData() ([]byte, error) {
data := make([]byte, m.SignedDataSize())
if _, err := m.ReadSignedData(data); err != nil {
return nil, err
}
return data, nil
return service.SignedDataFromReader(m)
}
// SignedDataSize returns payload size of the request.