aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/topic.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/topic.go
parent2ef3815af41c7a12dd798416b4a5ae74c09706c8 (diff)
downloaddexon-367c329b88617a2831a9fe20f7b47bb6ab7e255d.tar.gz
dexon-367c329b88617a2831a9fe20f7b47bb6ab7e255d.tar.zst
dexon-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/topic.go')
-rw-r--r--whisper/whisperv6/topic.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/whisper/whisperv6/topic.go b/whisper/whisperv6/topic.go
index bf5da01e3..4dd8f283c 100644
--- a/whisper/whisperv6/topic.go
+++ b/whisper/whisperv6/topic.go
@@ -23,11 +23,13 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
)
-// Topic represents a cryptographically secure, probabilistic partial
+// TopicType represents a cryptographically secure, probabilistic partial
// classifications of a message, determined as the first (left) 4 bytes of the
// SHA3 hash of some arbitrary data given by the original author of the message.
type TopicType [TopicLength]byte
+// BytesToTopic converts from the byte array representation of a topic
+// into the TopicType type.
func BytesToTopic(b []byte) (t TopicType) {
sz := TopicLength
if x := len(b); x < TopicLength {