2021-05-31 11:50:11 +00:00
|
|
|
package wrapper
|
|
|
|
|
2021-11-10 10:44:19 +00:00
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
|
|
|
|
)
|
|
|
|
|
|
|
|
// UpdateIRPrm groups parameters of UpdateInnerRing
|
|
|
|
// invocation.
|
|
|
|
type UpdateIRPrm struct {
|
|
|
|
keys keys.PublicKeys
|
|
|
|
|
|
|
|
client.InvokePrmOptional
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetKeys sets new inner ring keys.
|
|
|
|
func (u *UpdateIRPrm) SetKeys(keys keys.PublicKeys) {
|
|
|
|
u.keys = keys
|
|
|
|
}
|
2021-05-31 11:50:11 +00:00
|
|
|
|
2021-07-21 09:24:14 +00:00
|
|
|
// UpdateInnerRing updates inner ring keys.
|
2021-11-10 10:44:19 +00:00
|
|
|
func (w *Wrapper) UpdateInnerRing(prm UpdateIRPrm) error {
|
|
|
|
args := netmap.UpdateIRPrm{}
|
|
|
|
|
|
|
|
args.SetKeys(prm.keys)
|
|
|
|
args.InvokePrmOptional = prm.InvokePrmOptional
|
|
|
|
|
|
|
|
return w.client.UpdateInnerRing(args)
|
2021-05-31 11:50:11 +00:00
|
|
|
}
|
2021-07-20 20:43:54 +00:00
|
|
|
|
|
|
|
// GetInnerRingList return current IR list.
|
|
|
|
func (w *Wrapper) GetInnerRingList() (keys.PublicKeys, error) {
|
|
|
|
return w.client.InnerRingList()
|
|
|
|
}
|