aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/mailserver/server_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'whisper/mailserver/server_test.go')
-rw-r--r--whisper/mailserver/server_test.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/whisper/mailserver/server_test.go b/whisper/mailserver/server_test.go
index 15652ea4a..64dbcd783 100644
--- a/whisper/mailserver/server_test.go
+++ b/whisper/mailserver/server_test.go
@@ -58,15 +58,19 @@ func TestDBKey(t *testing.T) {
}
func generateEnvelope(t *testing.T) *whisper.Envelope {
+ h := crypto.Keccak256Hash([]byte("test sample data"))
params := &whisper.MessageParams{
- KeySym: []byte("test key"),
+ KeySym: h[:],
Topic: whisper.TopicType{},
Payload: []byte("test payload"),
PoW: powRequirement,
WorkTime: 2,
}
- msg := whisper.NewSentMessage(params)
+ msg, err := whisper.NewSentMessage(params)
+ if err != nil {
+ t.Fatalf("failed to create new message with seed %d: %s.", seed, err)
+ }
env, err := msg.Wrap(params)
if err != nil {
t.Fatalf("failed to wrap with seed %d: %s.", seed, err)
@@ -188,7 +192,10 @@ func createRequest(t *testing.T, p *ServerTestParams) *whisper.Envelope {
Src: p.key,
}
- msg := whisper.NewSentMessage(params)
+ msg, err := whisper.NewSentMessage(params)
+ if err != nil {
+ t.Fatalf("failed to create new message with seed %d: %s.", seed, err)
+ }
env, err := msg.Wrap(params)
if err != nil {
t.Fatalf("failed to wrap with seed %d: %s.", seed, err)