aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/mailserver
diff options
context:
space:
mode:
authorgluk256 <gluk256@users.noreply.github.com>2017-04-27 03:05:48 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-04-27 03:05:48 +0800
commit95f0bd0acf301bf8415747c4ff050e8a4dfdc864 (patch)
tree13edad970fb30a8e12151b2ec1a443b0ad970d2b /whisper/mailserver
parent8dce4c283dda3a8e10aa30dadab05a8c0dd9e19d (diff)
downloadgo-tangerine-95f0bd0acf301bf8415747c4ff050e8a4dfdc864.tar
go-tangerine-95f0bd0acf301bf8415747c4ff050e8a4dfdc864.tar.gz
go-tangerine-95f0bd0acf301bf8415747c4ff050e8a4dfdc864.tar.bz2
go-tangerine-95f0bd0acf301bf8415747c4ff050e8a4dfdc864.tar.lz
go-tangerine-95f0bd0acf301bf8415747c4ff050e8a4dfdc864.tar.xz
go-tangerine-95f0bd0acf301bf8415747c4ff050e8a4dfdc864.tar.zst
go-tangerine-95f0bd0acf301bf8415747c4ff050e8a4dfdc864.zip
whisper: message format refactoring (#14335)
* whisper: salt removed from AES encryption * whisper: padding format updated * whisper: padding test added * whisper: padding refactored, tests fixed * whisper: padding test updated * whisper: wnode bugfix * whisper: send/receive protocol updated * whisper: minor update * whisper: bugfix in test * whisper: updated parameter names and comments * whisper: functions renamed * whisper: minor refactoring
Diffstat (limited to 'whisper/mailserver')
-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)