status-go/peers/verifier/verifier_test.go

19 lines
373 B
Go
Raw Normal View History

package verifier
import (
"context"
"testing"
"github.com/stretchr/testify/require"
2020-01-02 09:10:19 +00:00
"github.com/ethereum/go-ethereum/p2p/enode"
)
func TestLocalVerifierForNodeIDTypes(t *testing.T) {
nodeID := enode.ID{1}
v := NewLocalVerifier([]enode.ID{{1}})
require.True(t, v.VerifyNode(context.TODO(), nodeID))
require.False(t, v.VerifyNode(context.TODO(), enode.ID{2}))
}