diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-04-21 16:43:11 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-04-28 15:49:04 +0800 |
commit | 7f48eb8737878e352a65475382532db26f9fbc52 (patch) | |
tree | 7db869690505978a4f111b996e7357572f64211c /whisper/envelope_test.go | |
parent | 19bc4624eaefc2c8201260e7afa1a5893159bffc (diff) | |
download | dexon-7f48eb8737878e352a65475382532db26f9fbc52.tar.gz dexon-7f48eb8737878e352a65475382532db26f9fbc52.tar.zst dexon-7f48eb8737878e352a65475382532db26f9fbc52.zip |
whisper, xeth/whisper: surface TTL and hash to the API
Diffstat (limited to 'whisper/envelope_test.go')
-rw-r--r-- | whisper/envelope_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/whisper/envelope_test.go b/whisper/envelope_test.go index ed1f08365..3117284f1 100644 --- a/whisper/envelope_test.go +++ b/whisper/envelope_test.go @@ -3,6 +3,7 @@ package whisper import ( "bytes" "testing" + "time" ) func TestEnvelopeOpen(t *testing.T) { @@ -26,9 +27,12 @@ func TestEnvelopeOpen(t *testing.T) { if bytes.Compare(opened.Payload, message.Payload) != 0 { t.Fatalf("payload mismatch: have 0x%x, want 0x%x", opened.Payload, message.Payload) } - if opened.Sent != message.Sent { + if opened.Sent.Unix() != message.Sent.Unix() { t.Fatalf("send time mismatch: have %d, want %d", opened.Sent, message.Sent) } + if opened.TTL/time.Second != DefaultTTL/time.Second { + t.Fatalf("message TTL mismatch: have %v, want %v", opened.TTL, DefaultTTL) + } if opened.Hash != envelope.Hash() { t.Fatalf("message hash mismatch: have 0x%x, want 0x%x", opened.Hash, envelope.Hash()) |