From 29fac7de448c85049a97cbec3dc0819122bd2cb0 Mon Sep 17 00:00:00 2001 From: gluk256 Date: Thu, 23 Feb 2017 09:41:47 +0100 Subject: Whisper API fixed (#3687) * whisper: wnode updated for tests with geth * whisper: updated processing of incoming messages * whisper: symmetric encryption updated * whisper: filter id type changed to enhance security * whisper: allow filter without topic for asymmetric encryption * whisper: POW updated * whisper: logging updated * whisper: spellchecker update * whisper: error handling changed * whisper: JSON field names fixed --- whisper/whisperv5/peer_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'whisper/whisperv5/peer_test.go') diff --git a/whisper/whisperv5/peer_test.go b/whisper/whisperv5/peer_test.go index cc98ba2d6..cce2c92ba 100644 --- a/whisper/whisperv5/peer_test.go +++ b/whisper/whisperv5/peer_test.go @@ -79,7 +79,7 @@ type TestNode struct { shh *Whisper id *ecdsa.PrivateKey server *p2p.Server - filerId uint32 + filerId string } var result TestData @@ -122,7 +122,10 @@ func initialize(t *testing.T) { topics := make([]TopicType, 0) topics = append(topics, sharedTopic) f := Filter{KeySym: sharedKey, Topics: topics} - node.filerId = node.shh.Watch(&f) + node.filerId, err = node.shh.Watch(&f) + if err != nil { + t.Fatalf("failed to install the filter: %s.", err) + } node.id, err = crypto.HexToECDSA(keys[i]) if err != nil { t.Fatalf("failed convert the key: %s.", keys[i]) @@ -187,7 +190,7 @@ func checkPropagation(t *testing.T) { for i := 0; i < NumNodes; i++ { f := nodes[i].shh.GetFilter(nodes[i].filerId) if f == nil { - t.Fatalf("failed to get filterId %d from node %d.", nodes[i].filerId, i) + t.Fatalf("failed to get filterId %s from node %d.", nodes[i].filerId, i) } mail := f.Retrieve() -- cgit v1.2.3