whisper: rlp test updated

This commit is contained in:
Vlad 2017-01-13 16:19:44 +01:00
parent 03ef121919
commit 556992d503
2 changed files with 6 additions and 2 deletions

View file

@ -330,13 +330,13 @@ func TestRlpEncode(t *testing.T) {
t.Fatalf("wrapped with zero key, seed: %d.", seed)
}
rlpEncoded, err := rlp.EncodeToBytes(env)
raw, err := rlp.EncodeToBytes(env)
if err != nil {
t.Fatalf("RLP encode failed: %s.", err)
}
var decoded Envelope
err = decoded.DecodeBytes(rlpEncoded)
rlp.DecodeBytes(raw, &decoded)
if err != nil {
t.Fatalf("RLP decode failed: %s.", err)
}

View file

@ -142,6 +142,10 @@ func (w *Whisper) SendP2PMessage(peerID []byte, envelope *Envelope) error {
return p2p.Send(p.ws, p2pCode, envelope)
}
func (w *Whisper) SendP2PDirect(peer *Peer, envelope *Envelope) error {
return p2p.Send(peer.ws, p2pCode, envelope)
}
// NewIdentity generates a new cryptographic identity for the client, and injects
// it into the known identities for message decryption.
func (w *Whisper) NewIdentity() *ecdsa.PrivateKey {