Add comments to the methods

This commit is contained in:
Igor Mandrigin 2018-10-04 14:18:56 +02:00
parent 75752de2e0
commit c40e8cfd37

View File

@ -240,6 +240,8 @@ func (api *PublicWhisperAPI) Post(ctx context.Context, req NewMessage) (hexutil.
return api.PostRaw(ctx, env, req.TargetPeer) 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) { func (api *PublicWhisperAPI) CreateEnvelope(ctx context.Context, req NewMessage) (*Envelope, error) {
var ( var (
symKeyGiven = len(req.SymKeyID) > 0 symKeyGiven = len(req.SymKeyID) > 0
@ -307,6 +309,8 @@ func (api *PublicWhisperAPI) CreateEnvelope(ctx context.Context, req NewMessage)
return env, nil 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) { func (api *PublicWhisperAPI) PostRaw(ctx context.Context, env *Envelope, targetPeer string) (hexutil.Bytes, error) {
var result []byte var result []byte
// send to specific node (skip PoW check) // send to specific node (skip PoW check)