go-waku/waku/v2/protocol/envelope.go

30 lines
453 B
Go
Raw Normal View History

2021-04-22 00:09:37 +00:00
package protocol
2021-04-22 00:09:37 +00:00
import "github.com/status-im/go-waku/waku/v2/protocol/pb"
type Envelope struct {
2021-04-22 00:09:37 +00:00
msg *pb.WakuMessage
size int
2021-04-11 23:43:59 +00:00
hash []byte
}
2021-04-22 00:09:37 +00:00
func NewEnvelope(msg *pb.WakuMessage, size int, hash []byte) *Envelope {
return &Envelope{
msg: msg,
size: size,
hash: hash,
}
}
2021-04-22 00:09:37 +00:00
func (e *Envelope) Message() *pb.WakuMessage {
return e.msg
}
2021-04-11 23:43:59 +00:00
func (e *Envelope) Hash() []byte {
return e.hash
}
func (e *Envelope) Size() int {
return e.size
}