fix comments

This commit is contained in:
Leonard Lyubich 2020-05-08 12:45:16 +03:00
parent 2c2150b101
commit 15a55d54a2
2 changed files with 7 additions and 1 deletions

View file

@ -130,7 +130,7 @@ type LifetimeSource interface {
ExpirationEpochSource
}
// LifetimeSource is an interface of the container of creation-expiration epoch pair.
// LifetimeContainer is an interface of the container of creation-expiration epoch pair.
type LifetimeContainer interface {
CreationEpochContainer
ExpirationEpochContainer

View file

@ -14,6 +14,7 @@ const signedRequestDataSize = 0 +
var requestEndianness = binary.BigEndian
// NewParams creates a new CreateRequest message and returns CreateParamsContainer interface.
func NewParams() CreateParamsContainer {
return new(CreateRequest)
}
@ -28,6 +29,7 @@ func (m *CreateRequest) SetOwnerID(id OwnerID) {
m.OwnerID = id
}
// SignedData returns payload bytes of the request.
func (m CreateRequest) SignedData() ([]byte, error) {
data := make([]byte, m.SignedDataSize())
@ -39,10 +41,14 @@ func (m CreateRequest) SignedData() ([]byte, error) {
return data, nil
}
// SignedDataSize returns payload size of the request.
func (m CreateRequest) SignedDataSize() int {
return signedRequestDataSize
}
// ReadSignedData copies payload bytes to passed buffer.
//
// If the buffer size is insufficient, io.ErrUnexpectedEOF returns.
func (m CreateRequest) ReadSignedData(p []byte) (int, error) {
sz := m.SignedDataSize()
if len(p) < sz {