frostfs-node/pkg/innerring/processors/netmap/nodevalidation/maddress/calls.go
Pavel Karpy 53b7e05b65 [#622] pkg/innerring: Add multiaddress validator
Add multiaddress validator that calls
`network.VerifyAddress`.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-22 12:12:45 +03:00

18 lines
380 B
Go

package maddress
import (
"fmt"
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
"github.com/nspcc-dev/neofs-node/pkg/network"
)
// VerifyAndUpdate calls network.VerifyAddress.
func (v *Validator) VerifyAndUpdate(n *netmap.NodeInfo) error {
err := network.VerifyMultiAddress(n)
if err != nil {
return fmt.Errorf("could not verify multiaddress: %w", err)
}
return nil
}