From 6600165e27c0396ecf1aa472865cd0daccdb061e Mon Sep 17 00:00:00 2001 From: b00ris Date: Tue, 16 Jan 2018 08:07:33 +0300 Subject: [PATCH] whisper: added lastTopicByte const --- whisper/whisperv5/filter_test.go | 3 ++- whisper/whisperv6/filter_test.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/whisper/whisperv5/filter_test.go b/whisper/whisperv5/filter_test.go index ca22920beb..01034a3513 100644 --- a/whisper/whisperv5/filter_test.go +++ b/whisper/whisperv5/filter_test.go @@ -776,6 +776,7 @@ func TestWatchers(t *testing.T) { func TestVariableTopics(t *testing.T) { InitSingleTest() + const lastTopicByte = 3 var match bool params, err := generateMessageParams() if err != nil { @@ -802,7 +803,7 @@ func TestVariableTopics(t *testing.T) { t.Fatalf("failed MatchEnvelope symmetric with seed %d, step %d.", seed, i) } - f.Topics[i][1]++ + f.Topics[i][lastTopicByte]++ match = f.MatchEnvelope(env) if match { t.Fatalf("MatchEnvelope symmetric with seed %d, step %d: false positive.", seed, i) diff --git a/whisper/whisperv6/filter_test.go b/whisper/whisperv6/filter_test.go index 6a669a2e83..9c7fdad95a 100644 --- a/whisper/whisperv6/filter_test.go +++ b/whisper/whisperv6/filter_test.go @@ -800,6 +800,7 @@ func TestWatchers(t *testing.T) { func TestVariableTopics(t *testing.T) { InitSingleTest() + const lastTopicByte = 3 var match bool params, err := generateMessageParams() if err != nil { @@ -826,7 +827,7 @@ func TestVariableTopics(t *testing.T) { t.Fatalf("failed MatchEnvelope symmetric with seed %d, step %d.", seed, i) } - f.Topics[i][1]++ + f.Topics[i][lastTopicByte]++ match = f.MatchEnvelope(env) if match { t.Fatalf("MatchEnvelope symmetric with seed %d, step %d: false positive.", seed, i)