diff options
author | gluk256 <gluk256@users.noreply.github.com> | 2017-04-10 05:49:22 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-04-10 05:49:22 +0800 |
commit | 9cd713551627a9b48e04a77f64a15ea6f829dcf4 (patch) | |
tree | f1849e61cd8269dfe9c70861f49216cf78acec3b /whisper/whisperv5/peer_test.go | |
parent | 8570ef19eb8dfe4e2a450525c589dec291f3a517 (diff) | |
download | go-tangerine-9cd713551627a9b48e04a77f64a15ea6f829dcf4.tar go-tangerine-9cd713551627a9b48e04a77f64a15ea6f829dcf4.tar.gz go-tangerine-9cd713551627a9b48e04a77f64a15ea6f829dcf4.tar.bz2 go-tangerine-9cd713551627a9b48e04a77f64a15ea6f829dcf4.tar.lz go-tangerine-9cd713551627a9b48e04a77f64a15ea6f829dcf4.tar.xz go-tangerine-9cd713551627a9b48e04a77f64a15ea6f829dcf4.tar.zst go-tangerine-9cd713551627a9b48e04a77f64a15ea6f829dcf4.zip |
whisper: big refactoring (#13852)
* whisper: GetMessages fixed; size restriction updated
* whisper: made PoW and MaxMsgSize customizable
* whisper: test added
* whisper: sym key management changed
* whisper: identity management refactored
* whisper: API refactoring (Post and Filter)
* whisper: big refactoring complete
* whisper: spelling fix
* whisper: variable topic size allowed for a filter
* whisper: final update
* whisper: formatting
* whisper: file exchange introduced in wnode
* whisper: bugfix
* whisper: API updated + new tests
* whisper: statistics updated
* whisper: wnode server updated
* whisper: allowed filtering for variable topic size
* whisper: tests added
* whisper: resolving merge conflicts
* whisper: refactoring (documenting mostly)
* whsiper: tests fixed
* whisper: down cased error messages
* whisper: documenting the API functions
* whisper: logging fixed
* whisper: fixed wnode parameters
* whisper: logs fixed (typos)
Diffstat (limited to 'whisper/whisperv5/peer_test.go')
-rw-r--r-- | whisper/whisperv5/peer_test.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/whisper/whisperv5/peer_test.go b/whisper/whisperv5/peer_test.go index e3073bc6c..a79b6ad14 100644 --- a/whisper/whisperv5/peer_test.go +++ b/whisper/whisperv5/peer_test.go @@ -114,12 +114,13 @@ func initialize(t *testing.T) { for i := 0; i < NumNodes; i++ { var node TestNode node.shh = New() - node.shh.test = true + node.shh.SetMinimumPoW(0.00000001) node.shh.Start(nil) topics := make([]TopicType, 0) topics = append(topics, sharedTopic) - f := Filter{KeySym: sharedKey, Topics: topics} - node.filerId, err = node.shh.Watch(&f) + f := Filter{KeySym: sharedKey} + f.Topics = [][]byte{topics[0][:]} + node.filerId, err = node.shh.Subscribe(&f) if err != nil { t.Fatalf("failed to install the filter: %s.", err) } @@ -166,7 +167,7 @@ func stopServers() { for i := 0; i < NumNodes; i++ { n := nodes[i] if n != nil { - n.shh.Unwatch(n.filerId) + n.shh.Unsubscribe(n.filerId) n.shh.Stop() n.server.Stop() } @@ -257,7 +258,7 @@ func sendMsg(t *testing.T, expected bool, id int) { return } - opt := MessageParams{KeySym: sharedKey, Topic: sharedTopic, Payload: expectedMessage, PoW: 0.00000001} + opt := MessageParams{KeySym: sharedKey, Topic: sharedTopic, Payload: expectedMessage, PoW: 0.00000001, WorkTime: 1} if !expected { opt.KeySym[0]++ opt.Topic[0]++ @@ -267,12 +268,12 @@ func sendMsg(t *testing.T, expected bool, id int) { msg := NewSentMessage(&opt) envelope, err := msg.Wrap(&opt) if err != nil { - t.Fatalf("failed to seal message.") + t.Fatalf("failed to seal message: %s", err) } err = nodes[id].shh.Send(envelope) if err != nil { - t.Fatalf("failed to send message.") + t.Fatalf("failed to send message: %s", err) } } |