aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/message.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-08 19:43:33 +0800
committerobscuren <geffobscura@gmail.com>2014-12-08 19:43:33 +0800
commitebe2d9d872c5482e02508f1d3e9c3a56e8a41d44 (patch)
treec26c4e780226851bc699ca182bcb2f4d5da3dc0e /whisper/message.go
parentf06543fd066e11ac5c36f3eba4f1f82a7a1aefb8 (diff)
downloadgo-tangerine-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.tar.gz
go-tangerine-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.tar.zst
go-tangerine-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.zip
First draft of Whisper messages relaying
Diffstat (limited to 'whisper/message.go')
-rw-r--r--whisper/message.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/whisper/message.go b/whisper/message.go
new file mode 100644
index 000000000..21cf163e6
--- /dev/null
+++ b/whisper/message.go
@@ -0,0 +1,15 @@
+package whisper
+
+type Message struct {
+ Flags byte
+ Signature []byte
+ Payload []byte
+}
+
+func NewMessage(payload []byte) *Message {
+ return &Message{Flags: 0, Payload: payload}
+}
+
+func (self *Message) Bytes() []byte {
+ return append([]byte{self.Flags}, append(self.Signature, self.Payload...)...)
+}