[#971] *: Add notification TX hash to neofs/netmap morph client calls

Add hash of the TX that generated notification
to neofs/netmap event structures. Adapt all
neofs/netmap wrapper calls to new structures.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-11-10 14:05:51 +03:00 committed by Alex Vanin
parent c25f5a86ae
commit bad739258e
19 changed files with 220 additions and 60 deletions

View file

@ -476,7 +476,10 @@ func (c *cfg) bootstrap() error {
ni := c.cfgNodeInfo.localInfo
ni.SetState(netmap.NodeStateOnline)
return c.cfgNetmap.wrapper.AddPeer(&ni)
prm := nmwrapper.AddPeerPrm{}
prm.SetNodeInfo(&ni)
return c.cfgNetmap.wrapper.AddPeer(prm)
}
// needBootstrap checks if local node should be registered in network on bootup.

View file

@ -9,6 +9,7 @@ import (
netmapGRPC "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/nspcc-dev/neofs-node/pkg/core/netmap"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap/wrapper"
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
netmapEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/netmap"
"github.com/nspcc-dev/neofs-node/pkg/network"
@ -283,10 +284,12 @@ func (c *cfg) SetNetmapStatus(st control.NetmapStatus) error {
c.cfgNetmap.reBoostrapTurnedOff.Store(true)
return c.cfgNetmap.wrapper.UpdatePeerState(
c.key.PublicKey().Bytes(),
apiState,
)
prm := wrapper.UpdatePeerPrm{}
prm.SetKey(c.key.PublicKey().Bytes())
prm.SetState(apiState)
return c.cfgNetmap.wrapper.UpdatePeerState(prm)
}
type netInfo struct {