github.com/annchain/OG@v0.0.9/p2p/discv5/util.go (about)

     1  package discv5
     2  
     3  func topicsToStrings(topics []Topic) []string {
     4  	var topicsString []string
     5  	for _, v := range topics {
     6  		topicsString = append(topicsString, string(v))
     7  	}
     8  	return topicsString
     9  }
    10  
    11  func stringsToTopics(topicsString []string) Topics {
    12  	var topics []Topic
    13  	for _, v := range topicsString {
    14  		topics = append(topics, Topic(v))
    15  	}
    16  	return topics
    17  }