swarm: rename SwarmNet to SimplePss Signed-off-by: p4u <p4u@dabax.net>
p4u p4u@dabax.net
Mon, 25 Feb 2019 16:54:59 +0100
2 files changed,
9 insertions(+),
9 deletions(-)
M
cmd/pssTest/psstest.go
→
cmd/pssTest/psstest.go
@@ -15,7 +15,7 @@ fmt.Println("Use <sym|asym> <key>")
return } - sn := new(swarm.SwarmNet) + sn := new(swarm.SimplePss) err := sn.Init() if err != nil { fmt.Printf("%v\n", err)
M
net/swarm/swarm.go
→
net/swarm/swarm.go
@@ -125,7 +125,7 @@ Delivery (chan pssMsg)
Address string } -type SwarmNet struct { +type SimplePss struct { Node *node.Node NodeConfig *node.Config EnodeID string@@ -139,7 +139,7 @@ Hive *network.Hive
Ports *swarmPorts } -func (sn *SwarmNet) SetLog(level string) error { +func (sn *SimplePss) SetLog(level string) error { // ensure good log formats for terminal // handle verbosity flag loglevel, err := log.LvlFromString(level)@@ -153,7 +153,7 @@ log.Root().SetHandler(h)
return nil } -func (sn *SwarmNet) PrintStats() { +func (sn *SimplePss) PrintStats() { // statistics thread go func() { for {@@ -169,15 +169,15 @@ }
}() } -func (sn *SwarmNet) SetDatadir(datadir string) { +func (sn *SimplePss) SetDatadir(datadir string) { sn.Datadir = datadir } -func (sn *SwarmNet) SetKey(key *ecdsa.PrivateKey) { +func (sn *SimplePss) SetKey(key *ecdsa.PrivateKey) { sn.Key = key } -func (sn *SwarmNet) Init() error { +func (sn *SimplePss) Init() error { var err error if len(sn.Datadir) < 1 { usr, err := user.Current()@@ -269,7 +269,7 @@ pssAddress = []byte(addr)
return pssAddress } -func (sn *SwarmNet) PssSub(subType, key, topic, address string) error { +func (sn *SimplePss) PssSub(subType, key, topic, address string) error { pssTopic := strTopic(topic) pssAddress := strAddress(address) if subType == "sym" {@@ -299,7 +299,7 @@ log.Info(fmt.Sprintf("Subscribed to [%s] topic %s", subType, pssTopic.String()))
return nil } -func (sn *SwarmNet) PssPub(subType, key, topic, msg, address string) error { +func (sn *SimplePss) PssPub(subType, key, topic, msg, address string) error { var err error dstAddr := strAddress(address) dstTopic := strTopic(topic)