aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/message.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-04-14 16:12:09 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-04-14 16:12:09 +0800
commit4af7743663fa3e444668b90878f64d0df4316deb (patch)
tree0ad5898d8510600fe8cfe230d18f2c72b8cf53ed /whisper/message.go
parentcb707ba50ce8626aa1b0e87d7526416a9592852a (diff)
downloadgo-tangerine-4af7743663fa3e444668b90878f64d0df4316deb.tar
go-tangerine-4af7743663fa3e444668b90878f64d0df4316deb.tar.gz
go-tangerine-4af7743663fa3e444668b90878f64d0df4316deb.tar.bz2
go-tangerine-4af7743663fa3e444668b90878f64d0df4316deb.tar.lz
go-tangerine-4af7743663fa3e444668b90878f64d0df4316deb.tar.xz
go-tangerine-4af7743663fa3e444668b90878f64d0df4316deb.tar.zst
go-tangerine-4af7743663fa3e444668b90878f64d0df4316deb.zip
whisper: add utility functions for creating topics
Diffstat (limited to 'whisper/message.go')
-rw-r--r--whisper/message.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/whisper/message.go b/whisper/message.go
index ad31aa592..a4de18f65 100644
--- a/whisper/message.go
+++ b/whisper/message.go
@@ -30,7 +30,7 @@ type Options struct {
From *ecdsa.PrivateKey
To *ecdsa.PublicKey
TTL time.Duration
- Topics [][]byte
+ Topics []Topic
}
// NewMessage creates and initializes a non-signed, non-encrypted Whisper message.
@@ -75,13 +75,8 @@ func (self *Message) Wrap(pow time.Duration, options Options) (*Envelope, error)
return nil, err
}
}
- // Convert the user topic into whisper ones
- topics := make([]Topic, len(options.Topics))
- for i, topic := range options.Topics {
- topics[i] = NewTopic(topic)
- }
// Wrap the processed message, seal it and return
- envelope := NewEnvelope(options.TTL, topics, self)
+ envelope := NewEnvelope(options.TTL, options.Topics, self)
envelope.Seal(pow)
return envelope, nil