whisper, xeth/whisper: surface TTL and hash to the API

This commit is contained in:
Péter Szilágyi
2015-04-21 11:43:11 +03:00
parent 19bc4624ea
commit 7f48eb8737
5 changed files with 25 additions and 6 deletions

View File

@ -4,6 +4,7 @@ import (
"bytes"
"crypto/elliptic"
"testing"
"time"
"github.com/ethereum/go-ethereum/crypto"
)
@ -25,6 +26,9 @@ func TestMessageSimpleWrap(t *testing.T) {
if bytes.Compare(msg.Payload, payload) != 0 {
t.Fatalf("payload mismatch after wrapping: have 0x%x, want 0x%x", msg.Payload, payload)
}
if msg.TTL/time.Second != DefaultTTL/time.Second {
t.Fatalf("message TTL mismatch: have %v, want %v", msg.TTL, DefaultTTL)
}
}
// Tests whether a message can be signed, and wrapped in plain-text.