From c40e8cfd37200c1a13594a4fa495fe98e47fb021 Mon Sep 17 00:00:00 2001 From: Igor Mandrigin Date: Thu, 4 Oct 2018 14:18:56 +0200 Subject: [PATCH] Add comments to the methods --- whisperv6/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/whisperv6/api.go b/whisperv6/api.go index 4b8fc06..5653095 100644 --- a/whisperv6/api.go +++ b/whisperv6/api.go @@ -240,6 +240,8 @@ func (api *PublicWhisperAPI) Post(ctx context.Context, req NewMessage) (hexutil. return api.PostRaw(ctx, env, req.TargetPeer) } +// CreateEnvelope creates, signs and returns an envelope. +// returns the envelope in case of success func (api *PublicWhisperAPI) CreateEnvelope(ctx context.Context, req NewMessage) (*Envelope, error) { var ( symKeyGiven = len(req.SymKeyID) > 0 @@ -307,6 +309,8 @@ func (api *PublicWhisperAPI) CreateEnvelope(ctx context.Context, req NewMessage) return env, nil } +// PostRaw posts the existing envelope to the network +// returns the hash of the message on success func (api *PublicWhisperAPI) PostRaw(ctx context.Context, env *Envelope, targetPeer string) (hexutil.Bytes, error) { var result []byte // send to specific node (skip PoW check)