[#1437] node: Fix contextcheck linter

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-10-21 16:27:28 +03:00
parent 6921a89061
commit 7429553266
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0
209 changed files with 1068 additions and 1036 deletions

View file

@ -1,6 +1,7 @@
package netmap
import (
"context"
"errors"
"fmt"
@ -24,7 +25,7 @@ func (a *AddPeerPrm) SetNodeInfo(nodeInfo netmap.NodeInfo) {
// AddPeer registers peer in FrostFS network through
// Netmap contract call.
func (c *Client) AddPeer(p AddPeerPrm) error {
func (c *Client) AddPeer(ctx context.Context, p AddPeerPrm) error {
method := addPeerMethod
if c.client.WithNotary() && c.client.IsAlpha() {
@ -39,7 +40,7 @@ func (c *Client) AddPeer(p AddPeerPrm) error {
prm.SetArgs(p.nodeInfo.Marshal())
prm.InvokePrmOptional = p.InvokePrmOptional
if _, err := c.client.Invoke(prm); err != nil {
if _, err := c.client.Invoke(ctx, prm); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", method, err)
}
return nil
@ -47,7 +48,7 @@ func (c *Client) AddPeer(p AddPeerPrm) error {
// ForceRemovePeer marks the given peer as offline via a notary control transaction.
// If vub > 0, vub will be used as valid until block value.
func (c *Client) ForceRemovePeer(nodeInfo netmap.NodeInfo, vub uint32) (uint32, error) {
func (c *Client) ForceRemovePeer(ctx context.Context, nodeInfo netmap.NodeInfo, vub uint32) (uint32, error) {
if !c.client.WithNotary() {
return 0, errFailedToRemovePeerWithoutNotary
}
@ -57,7 +58,7 @@ func (c *Client) ForceRemovePeer(nodeInfo netmap.NodeInfo, vub uint32) (uint32,
prm.SetControlTX(true)
prm.SetVUB(vub)
vub, err := c.UpdatePeerState(prm)
vub, err := c.UpdatePeerState(ctx, prm)
if err != nil {
return 0, fmt.Errorf("updating peer state: %v", err)
}