Skip to content

Commit

Permalink
Simplify NewEdVerifier() to not return useless error (#5155)
Browse files Browse the repository at this point in the history
## Motivation
`signing.NewEdVierifier()` is infallible, it never really returns an error and its definition could be simplfied.

## Changes
Changed `signing.NewEdVierifier()` to not return an error.
  • Loading branch information
poszu committed Oct 15, 2023
1 parent 07ad461 commit a78b39d
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 116 deletions.
5 changes: 1 addition & 4 deletions activation/activation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,10 +928,7 @@ func TestBuilder_SignAtx(t *testing.T) {
atx := newAtx(t, tab.sig, challenge, nipost, 100, types.Address{})
require.NoError(t, SignAndFinalizeAtx(tab.signer, atx))

verifier, err := signing.NewEdVerifier()
require.NoError(t, err)

ok := verifier.Verify(signing.ATX, tab.nodeID, atx.SignedBytes(), atx.Signature)
ok := signing.NewEdVerifier().Verify(signing.ATX, tab.nodeID, atx.SignedBytes(), atx.Signature)
require.True(t, ok)
require.Equal(t, tab.nodeID, atx.SmesherID)
}
Expand Down
6 changes: 1 addition & 5 deletions activation/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ type testHandler struct {
func newTestHandler(tb testing.TB, goldenATXID types.ATXID) *testHandler {
lg := logtest.New(tb)
cdb := datastore.NewCachedDB(sql.InMemory(), lg)

verifier, err := signing.NewEdVerifier()
require.NoError(tb, err)

ctrl := gomock.NewController(tb)
mclock := NewMocklayerClock(ctrl)
mpub := pubsubmocks.NewMockPublisher(ctrl)
Expand All @@ -104,7 +100,7 @@ func newTestHandler(tb testing.TB, goldenATXID types.ATXID) *testHandler {
mbeacon := NewMockAtxReceiver(ctrl)
mtortoise := mocks.NewMockTortoise(ctrl)

atxHdlr := NewHandler(localID, cdb, verifier, mclock, mpub, mockFetch, 1, goldenATXID, mValidator, mbeacon, mtortoise, lg, PoetConfig{})
atxHdlr := NewHandler(localID, cdb, signing.NewEdVerifier(), mclock, mpub, mockFetch, 1, goldenATXID, mValidator, mbeacon, mtortoise, lg, PoetConfig{})
return &testHandler{
Handler: atxHdlr,

Expand Down
7 changes: 2 additions & 5 deletions beacon/beacon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,13 @@ func newTestDriver(tb testing.TB, cfg Config, p pubsub.Publisher) *testProtocolD
}
edSgn, err := signing.NewEdSigner()
require.NoError(tb, err)
edVerify, err := signing.NewEdVerifier()
require.NoError(tb, err)
minerID := edSgn.NodeID()
lg := logtest.New(tb).WithName(minerID.ShortString())
lg := logtest.New(tb)

tpd.mVerifier.EXPECT().Verify(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().Return(true)
tpd.mNonceFetcher.EXPECT().VRFNonce(gomock.Any(), gomock.Any()).AnyTimes().Return(types.VRFPostIndex(1), nil)

tpd.cdb = datastore.NewCachedDB(sql.InMemory(), lg)
tpd.ProtocolDriver = New(p, edSgn, edVerify, tpd.mVerifier, tpd.cdb, tpd.mClock,
tpd.ProtocolDriver = New(p, edSgn, signing.NewEdVerifier(), tpd.mVerifier, tpd.cdb, tpd.mClock,
WithConfig(cfg),
WithLogger(lg),
withWeakCoin(coinValueMock(tb, true)),
Expand Down
9 changes: 2 additions & 7 deletions blocks/certifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ func newTestCertifier(t *testing.T) *testCertifier {
db := datastore.NewCachedDB(sql.InMemory(), logtest.New(t))
signer, err := signing.NewEdSigner()
require.NoError(t, err)
edVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)
nid := signer.NodeID()
ctrl := gomock.NewController(t)
mo := hmocks.NewMockRolacle(ctrl)
mp := pubsubmock.NewMockPublisher(ctrl)
mc := mocks.NewMocklayerClock(ctrl)
mb := smocks.NewMockBeaconGetter(ctrl)
mtortoise := smocks.NewMockTortoise(ctrl)
c := NewCertifier(db, mo, nid, signer, edVerifier, mp, mc, mb, mtortoise,
c := NewCertifier(db, mo, nid, signer, signing.NewEdVerifier(), mp, mc, mb, mtortoise,
WithCertifierLogger(logtest.New(t)),
)
return &testCertifier{
Expand Down Expand Up @@ -607,17 +605,14 @@ func Test_CertifyIfEligible(t *testing.T) {
tc.mb.EXPECT().GetBeacon(b.LayerIndex.GetEpoch()).Return(types.RandomBeacon(), nil)
proof := types.RandomVrfSignature()

edVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

tc.mOracle.EXPECT().Proof(gomock.Any(), b.LayerIndex, eligibility.CertifyRound).Return(proof, nil)
tc.mOracle.EXPECT().CalcEligibility(gomock.Any(), b.LayerIndex, eligibility.CertifyRound, tc.cfg.CommitteeSize, tc.nodeID, proof).Return(defaultCnt, nil)
tc.mPub.EXPECT().Publish(gomock.Any(), pubsub.BlockCertify, gomock.Any()).DoAndReturn(
func(_ context.Context, _ string, got []byte) error {
var msg types.CertifyMessage
require.NoError(t, codec.Decode(got, &msg))

ok := edVerifier.Verify(signing.HARE, msg.SmesherID, msg.Bytes(), msg.Signature)
ok := signing.NewEdVerifier().Verify(signing.HARE, msg.SmesherID, msg.Bytes(), msg.Signature)
require.True(t, ok)
require.Equal(t, b.LayerIndex, msg.LayerID)
require.Equal(t, b.ID(), msg.BlockID)
Expand Down
4 changes: 1 addition & 3 deletions checkpoint/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ func TestRecover_SameRecoveryInfo(t *testing.T) {

func validateAndPreserveData(tb testing.TB, db *sql.Database, deps []*types.VerifiedActivationTx, proofs []*types.PoetProofMessage) {
lg := logtest.New(tb)
edVerifier, err := signing.NewEdVerifier()
require.NoError(tb, err)
poetDb := activation.NewPoetDb(db, lg)
ctrl := gomock.NewController(tb)
mclock := activation.NewMocklayerClock(ctrl)
Expand All @@ -230,7 +228,7 @@ func validateAndPreserveData(tb testing.TB, db *sql.Database, deps []*types.Veri
atxHandler := activation.NewHandler(
"",
cdb,
edVerifier,
signing.NewEdVerifier(),
mclock,
nil,
mfetch,
Expand Down
4 changes: 1 addition & 3 deletions common/types/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ func Test_CertifyMessage(t *testing.T) {
require.NoError(t, codec.Decode(data, &decoded))
require.Equal(t, msg, decoded)

pke, err := signing.NewEdVerifier()
require.NoError(t, err)
ok := pke.Verify(signing.HARE, decoded.SmesherID, msg.Bytes(), decoded.Signature)
ok := signing.NewEdVerifier().Verify(signing.HARE, decoded.SmesherID, msg.Bytes(), decoded.Signature)
require.True(t, ok)
}

Expand Down
8 changes: 2 additions & 6 deletions hare/algorithm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,9 @@ func buildBrokerWithLimit(tb testing.TB, testName string, limit int) *testBroker
mockStateQ := mocks.NewMockstateQuerier(ctrl)
mockSyncS := smocks.NewMockSyncStateProvider(ctrl)
mockMesh := mocks.NewMockmesh(ctrl)
edVerifier, err := signing.NewEdVerifier()
require.NoError(tb, err)
mpub := pubsubmocks.NewMockPublisher(ctrl)
return &testBroker{
Broker: newBroker(config.DefaultConfig(), mockMesh, edVerifier, &mockEligibilityValidator{valid: 1}, mockStateQ, mockSyncS,
Broker: newBroker(config.DefaultConfig(), mockMesh, signing.NewEdVerifier(), &mockEligibilityValidator{valid: 1}, mockStateQ, mockSyncS,
mpub, limit, logtest.New(tb).WithName(testName)),
mockMesh: mockMesh,
mockSyncS: mockSyncS,
Expand Down Expand Up @@ -348,8 +346,6 @@ func generateConsensusProcessWithConfig(tb testing.TB, cfg config.Config, inbox
oracle := eligibility.New(logger)
edSigner, err := signing.NewEdSigner()
require.NoError(tb, err)
edVerifier, err := signing.NewEdVerifier()
require.NoError(tb, err)
edPubkey := edSigner.PublicKey()
nid := types.BytesToNodeID(edPubkey.Bytes())
oracle.Register(true, nid)
Expand All @@ -372,7 +368,7 @@ func generateConsensusProcessWithConfig(tb testing.TB, cfg config.Config, inbox
oracle,
sq,
edSigner,
edVerifier,
signing.NewEdVerifier(),
NewEligibilityTracker(cfg.N),
types.BytesToNodeID(edPubkey.Bytes()),
noopPubSub(tb),
Expand Down
4 changes: 1 addition & 3 deletions hare/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ func createConsensusProcess(
output := make(chan report, 1)
wc := make(chan wcReport, 1)
oracle.Register(isHonest, sig.NodeID())
edVerifier, err := signing.NewEdVerifier()
require.NoError(tb, err)
c, et, err := broker.Register(ctx, layer)
require.NoError(tb, err)
mch := make(chan *types.MalfeasanceGossip, cfg.N)
Expand All @@ -204,7 +202,7 @@ func createConsensusProcess(
oracle,
broker.mockStateQ,
sig,
edVerifier,
signing.NewEdVerifier(),
et,
sig.NodeID(),
network,
Expand Down
4 changes: 1 addition & 3 deletions hare/flows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ func createTestHare(tb testing.TB, msh mesh, tcfg config.Config, clock *mockCloc
tb.Helper()
signer, err := signing.NewEdSigner()
require.NoError(tb, err)
edVerifier, err := signing.NewEdVerifier()
require.NoError(tb, err)

ctrl := gomock.NewController(tb)
patrol := mocks.NewMocklayerPatrol(ctrl)
Expand All @@ -153,7 +151,7 @@ func createTestHare(tb testing.TB, msh mesh, tcfg config.Config, clock *mockCloc
tcfg,
p2p,
signer,
edVerifier,
signing.NewEdVerifier(),
signer.NodeID(),
make(chan LayerOutput, 100),
mockSyncS,
Expand Down
5 changes: 1 addition & 4 deletions hare/hare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,14 @@ func TestHare_New(t *testing.T) {
signer, err := signing.NewEdSigner()
require.NoError(t, err)

edVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

logger := logtest.New(t).WithName(t.Name())
cfg := config.Config{N: 10, RoundDuration: 2 * time.Second, ExpectedLeaders: 5, LimitIterations: 1000, LimitConcurrent: 1000, Hdist: 20}
h := New(
datastore.NewCachedDB(sql.InMemory(), logtest.New(t)),
cfg,
noopPubSub(t),
signer,
edVerifier,
signing.NewEdVerifier(),
signer.NodeID(),
make(chan LayerOutput, 1),
smocks.NewMockSyncStateProvider(ctrl), smocks.NewMockBeaconGetter(ctrl),
Expand Down
12 changes: 3 additions & 9 deletions hare/messagevalidation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ func defaultValidator(tb testing.TB) *syntaxContextValidator {

signer, err := signing.NewEdSigner()
require.NoError(tb, err)
edVerifier, err := signing.NewEdVerifier()
require.NoError(tb, err)

return newSyntaxContextValidator(signer, edVerifier, lowThresh10, trueValidator,
return newSyntaxContextValidator(signer, signing.NewEdVerifier(), lowThresh10, trueValidator,
sq, truer{}, newPubGetter(), NewEligibilityTracker(lowThresh10), logtest.New(tb),
)
}
Expand Down Expand Up @@ -342,12 +340,10 @@ func (pg pubGetter) NodeID(m *Message) types.NodeID {
func TestMessageValidator_SyntacticallyValidateMessage(t *testing.T) {
signer, err := signing.NewEdSigner()
require.NoError(t, err)
edVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)
et := NewEligibilityTracker(100)
vfunc := func(m *Message) bool { return true }

sv := newSyntaxContextValidator(signer, edVerifier, 1, vfunc, nil, truer{}, newPubGetter(), et, logtest.New(t))
sv := newSyntaxContextValidator(signer, signing.NewEdVerifier(), 1, vfunc, nil, truer{}, newPubGetter(), et, logtest.New(t))
m := BuildPreRoundMsg(signer, NewDefaultEmptySet(), types.EmptyVrfSignature)
require.True(t, sv.SyntacticallyValidateMessage(context.Background(), m))
m = BuildPreRoundMsg(signer, NewSetFromValues(types.RandomProposalID()), types.EmptyVrfSignature)
Expand Down Expand Up @@ -387,15 +383,13 @@ func TestMessageValidator_validateSVPTypeB(t *testing.T) {
func TestMessageValidator_validateSVP(t *testing.T) {
signer, err := signing.NewEdSigner()
require.NoError(t, err)
edVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

ctrl := gomock.NewController(t)
mockStateQ := mocks.NewMockstateQuerier(ctrl)
mockStateQ.EXPECT().IsIdentityActiveOnConsensusView(gomock.Any(), gomock.Any(), gomock.Any()).Return(true, nil).AnyTimes()
et := NewEligibilityTracker(100)
vfunc := func(m *Message) bool { return true }
sv := newSyntaxContextValidator(signer, edVerifier, 1, vfunc, mockStateQ, truer{}, newPubGetter(), et, logtest.New(t))
sv := newSyntaxContextValidator(signer, signing.NewEdVerifier(), 1, vfunc, mockStateQ, truer{}, newPubGetter(), et, logtest.New(t))
m := buildProposalMsg(signer, NewSetFromValues(types.ProposalID{1}, types.ProposalID{2}, types.ProposalID{3}), types.EmptyVrfSignature)
s1 := NewSetFromValues(types.ProposalID{1})
m.Svp = buildSVP(preRound, s1)
Expand Down
4 changes: 1 addition & 3 deletions hare/statustracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,10 @@ func createIdentity(t *testing.T, db *sql.Database, sig *signing.EdSigner) {
}

func verifyMalfeasanceProof(t *testing.T, sig *signing.EdSigner, gossip *types.MalfeasanceGossip) {
edVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)
lg := logtest.New(t)
cdb := datastore.NewCachedDB(sql.InMemory(), lg)
createIdentity(t, cdb.Database, sig)
nodeID, err := malfeasance.Validate(context.Background(), lg, cdb, edVerifier, nil, gossip)
nodeID, err := malfeasance.Validate(context.Background(), lg, cdb, signing.NewEdVerifier(), nil, gossip)
require.NoError(t, err)
require.Equal(t, sig.NodeID(), nodeID)
}
Expand Down
4 changes: 1 addition & 3 deletions hare3/hare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ func (n *node) withPublisher() *node {

func (n *node) withHare() *node {
logger := logtest.New(n.t).Named(fmt.Sprintf("hare=%d", n.i))
verifier, err := signing.NewEdVerifier()
require.NoError(n.t, err)

n.nclock = &testNodeClock{
genesis: n.t.start,
Expand All @@ -210,7 +208,7 @@ func (n *node) withHare() *node {
tracer := newTestTracer(n.t)
n.tracer = tracer
n.patrol = layerpatrol.New()
n.hare = New(n.nclock, n.mpublisher, n.db, verifier, n.oracle, n.msyncer, n.patrol,
n.hare = New(n.nclock, n.mpublisher, n.db, signing.NewEdVerifier(), n.oracle, n.msyncer, n.patrol,
WithConfig(n.t.cfg),
WithLogger(logger.Zap()),
WithWallclock(n.clock),
Expand Down
36 changes: 9 additions & 27 deletions malfeasance/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ func TestHandler_HandleMalfeasanceProof_multipleATXs(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
lid := types.LayerID(11)
Expand Down Expand Up @@ -258,10 +256,8 @@ func TestHandler_HandleMalfeasanceProof_multipleBallots(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
lid := types.LayerID(11)
Expand Down Expand Up @@ -473,10 +469,8 @@ func TestHandler_HandleMalfeasanceProof_hareEquivocation(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
lid := types.LayerID(11)
Expand Down Expand Up @@ -703,10 +697,8 @@ func TestHandler_HandleMalfeasanceProof_validateHare(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
createIdentity(t, db, sig)
Expand Down Expand Up @@ -784,10 +776,8 @@ func TestHandler_CrossDomain(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
createIdentity(t, db, sig)
Expand Down Expand Up @@ -842,10 +832,8 @@ func TestHandler_HandleSyncedMalfeasanceProof_multipleATXs(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
createIdentity(t, db, sig)
Expand Down Expand Up @@ -899,10 +887,8 @@ func TestHandler_HandleSyncedMalfeasanceProof_multipleBallots(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
createIdentity(t, db, sig)
Expand Down Expand Up @@ -955,10 +941,8 @@ func TestHandler_HandleSyncedMalfeasanceProof_hareEquivocation(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
createIdentity(t, db, sig)
Expand Down Expand Up @@ -1014,10 +998,8 @@ func TestHandler_HandleSyncedMalfeasanceProof_wrongHash(t *testing.T) {
ctrl := gomock.NewController(t)
trt := malfeasance.NewMocktortoise(ctrl)
mcp := malfeasance.NewMockconsensusProtocol(ctrl)
sigVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)

h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, sigVerifier, trt)
h := malfeasance.NewHandler(datastore.NewCachedDB(db, lg), lg, "self", types.EmptyNodeID, mcp, signing.NewEdVerifier(), trt)
sig, err := signing.NewEdSigner()
require.NoError(t, err)
createIdentity(t, db, sig)
Expand Down
4 changes: 1 addition & 3 deletions mesh/mesh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,7 @@ func TestMesh_MaliciousBallots(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, malProof)
require.True(t, blts[1].IsMalicious())
edVerifier, err := signing.NewEdVerifier()
require.NoError(t, err)
nodeID, err := malfeasance.Validate(context.Background(), tm.logger, tm.cdb, edVerifier, nil, &types.MalfeasanceGossip{MalfeasanceProof: *malProof})
nodeID, err := malfeasance.Validate(context.Background(), tm.logger, tm.cdb, signing.NewEdVerifier(), nil, &types.MalfeasanceGossip{MalfeasanceProof: *malProof})
require.NoError(t, err)
require.Equal(t, sig.NodeID(), nodeID)
mal, err = identities.IsMalicious(tm.cdb, sig.NodeID())
Expand Down
Loading

0 comments on commit a78b39d

Please sign in to comment.