Commit 757b90e 1 parent de58dd3 commit 757b90e Copy full SHA for 757b90e
File tree 3 files changed +13
-6
lines changed
processors/netmap/nodevalidation/structure
3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ import (
24
24
"github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap"
25
25
nodevalidator "github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap/nodevalidation"
26
26
availabilityvalidator "github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap/nodevalidation/availability"
27
- addrvalidator "github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap/nodevalidation/maddress"
28
27
statevalidation "github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap/nodevalidation/state"
28
+ addrvalidator "github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap/nodevalidation/structure"
29
29
"github.com/nspcc-dev/neofs-node/pkg/innerring/processors/reputation"
30
30
"github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement"
31
31
auditSettlement "github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/audit"
Original file line number Diff line number Diff line change 1
- package maddress
1
+ package structure
2
2
3
3
import (
4
4
"fmt"
@@ -14,5 +14,12 @@ func (v *Validator) VerifyAndUpdate(n *netmap.NodeInfo) error {
14
14
return fmt .Errorf ("could not verify multiaddress: %w" , err )
15
15
}
16
16
17
- return nil
17
+ attrM := make (map [string ]struct {}, n .NumberOfAttributes ())
18
+ n .IterateAttributes (func (key , _ string ) {
19
+ if _ , alreadyHave := attrM [key ]; alreadyHave {
20
+ err = fmt .Errorf ("repeating node attribute: '%s'" , key )
21
+ }
22
+ })
23
+
24
+ return err
18
25
}
Original file line number Diff line number Diff line change 1
- package maddress
1
+ package structure
2
2
3
- // Validator is an utility that verifies node
4
- // multiaddress .
3
+ // Validator is a utility that verifies announced node
4
+ // structure .
5
5
//
6
6
// For correct operation, the Validator must be created
7
7
// using the constructor (New). After successful creation,
You can’t perform that action at this time.
0 commit comments