whisper: polish the messages, fix some bugs, tests

Bugs fixed:
  - Use randomly generated flags as the spec required.
  - During envelope opening check the first bit only for signature.
This commit is contained in:
Péter Szilágyi
2015-04-10 15:53:21 +03:00
parent 7e54a9c07f
commit 7d8ce53eca
6 changed files with 213 additions and 92 deletions

View File

@ -18,8 +18,8 @@ func TestEvent(t *testing.T) {
})
msg := NewMessage([]byte(fmt.Sprintf("Hello world. This is whisper-go. Incase you're wondering; the time is %v", time.Now())))
envelope, err := msg.Seal(DefaultPow, Opts{
Ttl: DefaultTtl,
envelope, err := msg.Wrap(DefaultPow, Options{
TTL: DefaultTimeToLive,
From: id,
To: &id.PublicKey,
})