aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-04-17 19:11:46 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-04-17 19:11:46 +0800
commit4afc22ba6e79fe951256251444b4a5b8d38b50fb (patch)
treedff06f8e9569293df1a20d6b38cc76c42e31a236
parentbd14bd6c5b8fcfb2430720da58de152dbbcb84ab (diff)
downloadgo-tangerine-4afc22ba6e79fe951256251444b4a5b8d38b50fb.tar
go-tangerine-4afc22ba6e79fe951256251444b4a5b8d38b50fb.tar.gz
go-tangerine-4afc22ba6e79fe951256251444b4a5b8d38b50fb.tar.bz2
go-tangerine-4afc22ba6e79fe951256251444b4a5b8d38b50fb.tar.lz
go-tangerine-4afc22ba6e79fe951256251444b4a5b8d38b50fb.tar.xz
go-tangerine-4afc22ba6e79fe951256251444b4a5b8d38b50fb.tar.zst
go-tangerine-4afc22ba6e79fe951256251444b4a5b8d38b50fb.zip
whisper: cleanup lefover scoping
-rw-r--r--whisper/topic.go2
-rw-r--r--whisper/topic_test.go2
-rw-r--r--whisper/whisper.go4
3 files changed, 4 insertions, 4 deletions
diff --git a/whisper/topic.go b/whisper/topic.go
index 7c26cfba9..a965c7cc2 100644
--- a/whisper/topic.go
+++ b/whisper/topic.go
@@ -52,7 +52,7 @@ func (self *Topic) String() string {
type topicSet map[string]struct{}
// NewTopicSet creates a topic hash set from a slice of topics.
-func NewTopicSet(topics []Topic) topicSet {
+func newTopicSet(topics []Topic) topicSet {
set := make(map[string]struct{})
for _, topic := range topics {
set[topic.String()] = struct{}{}
diff --git a/whisper/topic_test.go b/whisper/topic_test.go
index 5f8583987..4015079dc 100644
--- a/whisper/topic_test.go
+++ b/whisper/topic_test.go
@@ -57,7 +57,7 @@ func TestTopicSetCreation(t *testing.T) {
for i, tt := range topicCreationTests {
topics[i] = NewTopic(tt.data)
}
- set := NewTopicSet(topics)
+ set := newTopicSet(topics)
for i, tt := range topicCreationTests {
topic := NewTopic(tt.data)
if _, ok := set[topic.String()]; !ok {
diff --git a/whisper/whisper.go b/whisper/whisper.go
index 48efff622..9317fad50 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -119,7 +119,7 @@ func (self *Whisper) Watch(options Filter) int {
filter := filter.Generic{
Str1: string(crypto.FromECDSAPub(options.To)),
Str2: string(crypto.FromECDSAPub(options.From)),
- Data: NewTopicSet(options.Topics),
+ Data: newTopicSet(options.Topics),
Fn: func(data interface{}) {
options.Fn(data.(*Message))
},
@@ -281,7 +281,7 @@ func createFilter(message *Message, topics []Topic) filter.Filter {
return filter.Generic{
Str1: string(crypto.FromECDSAPub(message.To)),
Str2: string(crypto.FromECDSAPub(message.Recover())),
- Data: NewTopicSet(topics),
+ Data: newTopicSet(topics),
}
}