forked from TrueCloudLab/frostfs-node
[#1496] node/control: Await until SetNetmapStatus() persists
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
acd5babd86
commit
d82f0d1926
3 changed files with 9 additions and 11 deletions
|
@ -2,7 +2,6 @@ package netmap
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-contract/netmap"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client"
|
||||
|
@ -37,7 +36,7 @@ func (u *UpdatePeerPrm) SetMaintenance() {
|
|||
}
|
||||
|
||||
// UpdatePeerState changes peer status through Netmap contract call.
|
||||
func (c *Client) UpdatePeerState(ctx context.Context, p UpdatePeerPrm) (uint32, error) {
|
||||
func (c *Client) UpdatePeerState(ctx context.Context, p UpdatePeerPrm) (client.InvokeRes, error) {
|
||||
method := updateStateMethod
|
||||
|
||||
if c.client.WithNotary() && c.client.IsAlpha() {
|
||||
|
@ -56,9 +55,5 @@ func (c *Client) UpdatePeerState(ctx context.Context, p UpdatePeerPrm) (uint32,
|
|||
prm.SetArgs(int64(p.state), p.key)
|
||||
prm.InvokePrmOptional = p.InvokePrmOptional
|
||||
|
||||
res, err := c.client.Invoke(ctx, prm)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("could not invoke smart contract: %w", err)
|
||||
}
|
||||
return res.VUB, nil
|
||||
return c.client.Invoke(ctx, prm)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue