2018-07-25 14:48:02 +00:00
|
|
|
package verifier
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
2018-11-14 07:03:58 +00:00
|
|
|
"github.com/ethereum/go-ethereum/p2p/enode"
|
2018-07-25 14:48:02 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestLocalVerifierForNodeIDTypes(t *testing.T) {
|
2018-11-14 07:03:58 +00:00
|
|
|
nodeID := enode.ID{1}
|
2018-07-25 14:48:02 +00:00
|
|
|
|
2018-11-14 07:03:58 +00:00
|
|
|
v := NewLocalVerifier([]enode.ID{{1}})
|
2018-07-25 14:48:02 +00:00
|
|
|
require.True(t, v.VerifyNode(context.TODO(), nodeID))
|
2018-11-14 07:03:58 +00:00
|
|
|
require.False(t, v.VerifyNode(context.TODO(), enode.ID{2}))
|
2018-07-25 14:48:02 +00:00
|
|
|
}
|