forked from TrueCloudLab/frostfs-node
[#1437] node: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
6921a89061
commit
7429553266
209 changed files with 1068 additions and 1036 deletions
|
@ -1,6 +1,7 @@
|
|||
package netmap
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client"
|
||||
|
@ -8,12 +9,12 @@ import (
|
|||
|
||||
// NewEpoch updates FrostFS epoch number through
|
||||
// Netmap contract call.
|
||||
func (c *Client) NewEpoch(epoch uint64) error {
|
||||
func (c *Client) NewEpoch(ctx context.Context, epoch uint64) error {
|
||||
prm := client.InvokePrm{}
|
||||
prm.SetMethod(newEpochMethod)
|
||||
prm.SetArgs(epoch)
|
||||
|
||||
_, err := c.client.Invoke(prm)
|
||||
_, err := c.client.Invoke(ctx, prm)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not invoke method (%s): %w", newEpochMethod, err)
|
||||
}
|
||||
|
@ -24,14 +25,14 @@ func (c *Client) NewEpoch(epoch uint64) error {
|
|||
// control notary transaction internally to ensure all
|
||||
// nodes produce the same transaction with high probability.
|
||||
// If vub > 0, vub will be used as valid until block value.
|
||||
func (c *Client) NewEpochControl(epoch uint64, vub uint32) (uint32, error) {
|
||||
func (c *Client) NewEpochControl(ctx context.Context, epoch uint64, vub uint32) (uint32, error) {
|
||||
prm := client.InvokePrm{}
|
||||
prm.SetMethod(newEpochMethod)
|
||||
prm.SetArgs(epoch)
|
||||
prm.SetControlTX(true)
|
||||
prm.SetVUB(vub)
|
||||
|
||||
res, err := c.client.Invoke(prm)
|
||||
res, err := c.client.Invoke(ctx, prm)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("could not invoke method (%s): %w", newEpochMethod, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue