mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/pss: Fix test in notify
This commit is contained in:
parent
be084fc4f4
commit
bc2a4b866f
3 changed files with 5 additions and 5 deletions
|
|
@ -486,7 +486,7 @@ func (api *HandshakeAPI) Handshake(pubkeyid string, topic Topic, sync bool, flus
|
|||
|
||||
// Activate handshake functionality on a topic
|
||||
func (api *HandshakeAPI) AddHandshake(topic Topic) error {
|
||||
api.ctrl.deregisterFuncs[topic] = api.ctrl.pss.Register(&topic, &handler{f: api.ctrl.handler})
|
||||
api.ctrl.deregisterFuncs[topic] = api.ctrl.pss.Register(&topic, NewHandler(api.ctrl.handler))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ func NewController(ps *pss.Pss) *Controller {
|
|||
notifiers: make(map[string]*notifier),
|
||||
subscriptions: make(map[string]*subscription),
|
||||
}
|
||||
ctrl.pss.Register(&controlTopic, ctrl.Handler)
|
||||
ctrl.pss.Register(&controlTopic, pss.NewHandler(ctrl.Handler))
|
||||
return ctrl
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ func (c *Controller) handleNotifyWithKeyMsg(msg *Msg) error {
|
|||
// \TODO keep track of and add actual address
|
||||
updaterAddr := pss.PssAddress([]byte{})
|
||||
c.pss.SetSymmetricKey(symkey, topic, &updaterAddr, true)
|
||||
c.pss.Register(&topic, c.Handler)
|
||||
c.pss.Register(&topic, pss.NewHandler(c.Handler))
|
||||
return c.subscriptions[msg.namestring].handler(msg.namestring, msg.Payload[:len(msg.Payload)-symKeyLength])
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ func TestStart(t *testing.T) {
|
|||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
|
||||
defer cancel()
|
||||
rmsgC := make(chan *pss.APIMsg)
|
||||
rightSub, err := rightRpc.Subscribe(ctx, "pss", rmsgC, "receive", controlTopic)
|
||||
rightSub, err := rightRpc.Subscribe(ctx, "pss", rmsgC, "receive", controlTopic, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ func TestStart(t *testing.T) {
|
|||
t.Fatalf("expected payload length %d, have %d", len(updateMsg)+symKeyLength, len(dMsg.Payload))
|
||||
}
|
||||
|
||||
rightSubUpdate, err := rightRpc.Subscribe(ctx, "pss", rmsgC, "receive", rsrcTopic)
|
||||
rightSubUpdate, err := rightRpc.Subscribe(ctx, "pss", rmsgC, "receive", rsrcTopic, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue