status-go/peers/verifier/verifier_test.go
Adam Babik 3b8c6c8260
Add interface to verify trusted MailServers (#1112)
The goal of this PR is to add an interface to verify MailServers. In this PR, MailServers are hardcoded in status-go. The next iteration will use a smart contract.
2018-07-25 16:48:02 +02:00

18 lines
396 B
Go

package verifier
import (
"context"
"testing"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/stretchr/testify/require"
)
func TestLocalVerifierForNodeIDTypes(t *testing.T) {
nodeID := discover.NodeID{1}
v := NewLocalVerifier([]discover.NodeID{{1}})
require.True(t, v.VerifyNode(context.TODO(), nodeID))
require.False(t, v.VerifyNode(context.TODO(), discover.NodeID{2}))
}