Skip to content

Commit

Permalink
fixup: fix for comment
Browse files Browse the repository at this point in the history
Signed-off-by: 170210 <j170210@icloud.com>
  • Loading branch information
170210 committed Mar 14, 2024
1 parent 01814c0 commit 06174d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions privval/internal/ip_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package internal

import (
"fmt"
"github.com/Finschia/ostracon/libs/log"
"net"
"strings"

"github.com/Finschia/ostracon/libs/log"
)

type IpFilter struct {
Expand All @@ -26,10 +26,6 @@ func (f *IpFilter) Filter(addr net.Addr) net.Addr {
return nil
}

func (f *IpFilter) String() string {
return strings.Join(f.allowList, ",")
}

func (f *IpFilter) isAllowedAddr(addr net.Addr) bool {
if len(f.allowList) == 0 {
return false
Expand Down
9 changes: 2 additions & 7 deletions privval/internal/ip_filter_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package internal

import (
"github.com/stretchr/testify/assert"
"net"
"strings"
"testing"

"github.com/stretchr/testify/assert"
)

type addrStub struct {
Expand Down Expand Up @@ -128,8 +128,3 @@ func TestIpFilterShouldSetAllowAddress(t *testing.T) {

assert.Equal(t, expected, cut.allowList)
}

func TestIpFilterStringShouldReturnsIP(t *testing.T) {
expected := []string{"127.0.0.1", "192.168.1.10"}
assert.Equal(t, strings.Join(expected, ","), NewIpFilter(expected, nil).String())
}

0 comments on commit 06174d1

Please sign in to comment.