[#1008] ir/netmap: Call Register method on peer approval
After https://github.com/nspcc-dev/neofs-contract/issues/154 alphabet nodes should call `Register` method for approval of the notary notifications spawned by `AddPeer` method. Call `register` method for peer approval in Netmap processor. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
89eca449b6
commit
3d5eb2a396
1 changed files with 6 additions and 1 deletions
|
@ -88,6 +88,11 @@ func (np *Processor) processAddPeer(ev netmapEvent.AddPeer) {
|
||||||
prm := netmapclient.AddPeerPrm{}
|
prm := netmapclient.AddPeerPrm{}
|
||||||
prm.SetNodeInfo(nodeInfo)
|
prm.SetNodeInfo(nodeInfo)
|
||||||
|
|
||||||
|
// In notary environments we call Register method instead of AddPeer.
|
||||||
|
// It differs from AddPeer only by name, so we can do this in the same form.
|
||||||
|
// See https://github.com/nspcc-dev/neofs-contract/issues/154.
|
||||||
|
const methodAddPeerNotary = "register"
|
||||||
|
|
||||||
if nr := ev.NotaryRequest(); nr != nil {
|
if nr := ev.NotaryRequest(); nr != nil {
|
||||||
// create new notary request with the original nonce
|
// create new notary request with the original nonce
|
||||||
err = np.netmapClient.Morph().NotaryInvoke(
|
err = np.netmapClient.Morph().NotaryInvoke(
|
||||||
|
@ -95,7 +100,7 @@ func (np *Processor) processAddPeer(ev netmapEvent.AddPeer) {
|
||||||
0,
|
0,
|
||||||
nr.MainTransaction.Nonce,
|
nr.MainTransaction.Nonce,
|
||||||
nil,
|
nil,
|
||||||
netmapEvent.AddPeerNotaryEvent,
|
methodAddPeerNotary,
|
||||||
nodeInfoBinary,
|
nodeInfoBinary,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue