forked from TrueCloudLab/frostfs-node
Add Inner Ring code
This commit is contained in:
parent
dadfd90dcd
commit
b7b5079934
400 changed files with 11420 additions and 8690 deletions
34
pkg/morph/client/netmap/update_state.go
Normal file
34
pkg/morph/client/netmap/update_state.go
Normal file
|
@ -0,0 +1,34 @@
|
|||
package netmap
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// UpdateStateArgs groups the arguments
|
||||
// of update state invocation call.
|
||||
type UpdateStateArgs struct {
|
||||
key []byte // peer public key
|
||||
|
||||
state int64 // new peer state
|
||||
}
|
||||
|
||||
// SetPublicKey sets peer public key
|
||||
// in a binary format.
|
||||
func (u *UpdateStateArgs) SetPublicKey(v []byte) {
|
||||
u.key = v
|
||||
}
|
||||
|
||||
// SetState sets the new peer state.
|
||||
func (u *UpdateStateArgs) SetState(v int64) {
|
||||
u.state = v
|
||||
}
|
||||
|
||||
// UpdateState invokes the call of update state method
|
||||
// of NeoFS Netmap contract.
|
||||
func (c *Client) UpdateState(args UpdateStateArgs) error {
|
||||
return errors.Wrapf(c.client.Invoke(
|
||||
c.addPeerMethod,
|
||||
args.key,
|
||||
args.state,
|
||||
), "could not invoke method (%s)", c.updateStateMethod)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue