aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/api.go
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2018-01-26 19:45:10 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-26 19:45:10 +0800
commit367c329b88617a2831a9fe20f7b47bb6ab7e255d (patch)
treeea18962e98de8dd30a2907d8ff0e88de0dc1ffe8 /whisper/whisperv6/api.go
parent2ef3815af41c7a12dd798416b4a5ae74c09706c8 (diff)
downloadgo-tangerine-367c329b88617a2831a9fe20f7b47bb6ab7e255d.tar
go-tangerine-367c329b88617a2831a9fe20f7b47bb6ab7e255d.tar.gz
go-tangerine-367c329b88617a2831a9fe20f7b47bb6ab7e255d.tar.bz2
go-tangerine-367c329b88617a2831a9fe20f7b47bb6ab7e255d.tar.lz
go-tangerine-367c329b88617a2831a9fe20f7b47bb6ab7e255d.tar.xz
go-tangerine-367c329b88617a2831a9fe20f7b47bb6ab7e255d.tar.zst
go-tangerine-367c329b88617a2831a9fe20f7b47bb6ab7e255d.zip
whisper: remove linter warnings (#15972)
* whisper: fixes warnings from the code linter * whisper: more non-API-breaking changes The remaining lint errors are because of auto-generated files and one is because an exported function has a non- exported return type. Changing this would break the API, and will be part of another commit for easier reversal. * whisper: un-export NewSentMessage to please the linter This is an API change, which is why it's in its own commit. This change was initiated after the linter complained that the returned type wasn't exported. I chose to un-export the function instead of exporting the type, because that type is an implementation detail that I would like to change in the near future to make the code more readable and with an increased coverage. * whisper: update gencodec output after upgrading it to new lint standards
Diffstat (limited to 'whisper/whisperv6/api.go')
-rw-r--r--whisper/whisperv6/api.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go
index 2f6f671e9..6cbce26f0 100644
--- a/whisper/whisperv6/api.go
+++ b/whisper/whisperv6/api.go
@@ -36,6 +36,7 @@ const (
filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds
)
+// List of errors
var (
ErrSymAsym = errors.New("specify either a symmetric or an asymmetric key")
ErrInvalidSymmetricKey = errors.New("invalid symmetric key")
@@ -116,7 +117,7 @@ func (api *PublicWhisperAPI) SetMaxMessageSize(ctx context.Context, size uint32)
return true, api.w.SetMaxMessageSize(size)
}
-// SetMinPow sets the minimum PoW, and notifies the peers.
+// SetMinPoW sets the minimum PoW, and notifies the peers.
func (api *PublicWhisperAPI) SetMinPoW(ctx context.Context, pow float64) (bool, error) {
return true, api.w.SetMinimumPoW(pow)
}
@@ -174,7 +175,7 @@ func (api *PublicWhisperAPI) GetPublicKey(ctx context.Context, id string) (hexut
return crypto.FromECDSAPub(&key.PublicKey), nil
}
-// GetPublicKey returns the private key associated with the given key. The key is the hex
+// GetPrivateKey returns the private key associated with the given key. The key is the hex
// encoded representation of a key in the form specified in section 4.3.6 of ANSI X9.62.
func (api *PublicWhisperAPI) GetPrivateKey(ctx context.Context, id string) (hexutil.Bytes, error) {
key, err := api.w.GetPrivateKey(id)
@@ -291,7 +292,7 @@ func (api *PublicWhisperAPI) Post(ctx context.Context, req NewMessage) (bool, er
}
// encrypt and sent message
- whisperMsg, err := NewSentMessage(params)
+ whisperMsg, err := newSentMessage(params)
if err != nil {
return false, err
}