diff options
Diffstat (limited to 'whisper/whisperv2/envelope_test.go')
-rw-r--r-- | whisper/whisperv2/envelope_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/whisper/whisperv2/envelope_test.go b/whisper/whisperv2/envelope_test.go index 75e2fbe8a..c1b128c61 100644 --- a/whisper/whisperv2/envelope_test.go +++ b/whisper/whisperv2/envelope_test.go @@ -40,10 +40,10 @@ func TestEnvelopeOpen(t *testing.T) { if opened.Flags != message.Flags { t.Fatalf("flags mismatch: have %d, want %d", opened.Flags, message.Flags) } - if bytes.Compare(opened.Signature, message.Signature) != 0 { + if !bytes.Equal(opened.Signature, message.Signature) { t.Fatalf("signature mismatch: have 0x%x, want 0x%x", opened.Signature, message.Signature) } - if bytes.Compare(opened.Payload, message.Payload) != 0 { + if !bytes.Equal(opened.Payload, message.Payload) { t.Fatalf("payload mismatch: have 0x%x, want 0x%x", opened.Payload, message.Payload) } if opened.Sent.Unix() != message.Sent.Unix() { @@ -71,7 +71,7 @@ func TestEnvelopeAnonymousOpenUntargeted(t *testing.T) { if opened.To != nil { t.Fatalf("recipient mismatch: have 0x%x, want nil", opened.To) } - if bytes.Compare(opened.Payload, payload) != 0 { + if !bytes.Equal(opened.Payload, payload) { t.Fatalf("payload mismatch: have 0x%x, want 0x%x", opened.Payload, payload) } } @@ -96,7 +96,7 @@ func TestEnvelopeAnonymousOpenTargeted(t *testing.T) { if opened.To != nil { t.Fatalf("recipient mismatch: have 0x%x, want nil", opened.To) } - if bytes.Compare(opened.Payload, payload) == 0 { + if bytes.Equal(opened.Payload, payload) { t.Fatalf("payload match, should have been encrypted: 0x%x", opened.Payload) } } @@ -127,7 +127,7 @@ func TestEnvelopeIdentifiedOpenUntargeted(t *testing.T) { if opened.To != nil { t.Fatalf("recipient mismatch: have 0x%x, want nil", opened.To) } - if bytes.Compare(opened.Payload, payload) != 0 { + if !bytes.Equal(opened.Payload, payload) { t.Fatalf("payload mismatch: have 0x%x, want 0x%x", opened.Payload, payload) } } @@ -152,7 +152,7 @@ func TestEnvelopeIdentifiedOpenTargeted(t *testing.T) { if opened.To != nil { t.Fatalf("recipient mismatch: have 0x%x, want nil", opened.To) } - if bytes.Compare(opened.Payload, payload) != 0 { + if !bytes.Equal(opened.Payload, payload) { t.Fatalf("payload mismatch: have 0x%x, want 0x%x", opened.Payload, payload) } } |