Skip to content

Commit c014d89

Browse files
committed
Unexport Params.Validate to maintain patch release semantics
1 parent d53e38b commit c014d89

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gossipsub.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ type GossipSubParams struct {
241241
IDontWantMessageTTL int
242242
}
243243

244-
func (params *GossipSubParams) Validate() error {
244+
func (params *GossipSubParams) validate() error {
245245
if !(params.Dlo <= params.D && params.D <= params.Dhi) {
246246
return fmt.Errorf("param D=%d must be between Dlo=%d and Dhi=%d", params.D, params.Dlo, params.Dhi)
247247
}
@@ -461,7 +461,7 @@ func WithDirectConnectTicks(t uint64) Option {
461461
// config to be set when instantiating the gossipsub router.
462462
func WithGossipSubParams(cfg GossipSubParams) Option {
463463
return func(ps *PubSub) error {
464-
if err := cfg.Validate(); err != nil {
464+
if err := cfg.validate(); err != nil {
465465
return err
466466
}
467467
gs, ok := ps.rt.(*GossipSubRouter)

gossipsub_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestGossipSubParamsValidate(t *testing.T) {
5252
params := DefaultGossipSubParams()
5353
params.Dhi = 1
5454
params.Dscore = 10
55-
if params.Validate() == nil {
55+
if params.validate() == nil {
5656
t.Fatal("Params should be invalid")
5757
}
5858
}

0 commit comments

Comments
 (0)