Skip to content

Commit

Permalink
fix aggregator test
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasArrachea committed Oct 18, 2024
1 parent a7824da commit fae8ffd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package aggregator

import (
"context"
"fmt"
"math/big"
"sync"
"time"
Expand Down Expand Up @@ -125,7 +124,7 @@ func NewAggregator(c *config.Config) (*Aggregator, error) {
},
})
if err != nil {
fmt.Println("Error creating taskResponseType")
c.Logger.Error("Error creating taskResponseType")
return sdktypes.TaskResponseDigest{}, err
}
arguments := abi.Arguments{
Expand Down
4 changes: 1 addition & 3 deletions aggregator/rpc_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ func TestProcessSignedTaskResponse(t *testing.T) {
NumberToSquare: NUMBER_TO_SQUARE,
}, *MOCK_OPERATOR_KEYPAIR)
assert.Nil(t, err)
signedTaskResponseDigest, err := core.GetTaskResponseDigest(&signedTaskResponse.TaskResponse)
assert.Nil(t, err)

// TODO(samlaf): is this the right way to test writing to external service?
// or is there some wisdom to "don't mock 3rd party code"?
// see https://hynek.me/articles/what-to-mock-in-5-mins/
mockBlsAggServ.EXPECT().ProcessNewSignature(context.Background(), TASK_INDEX, signedTaskResponseDigest,
mockBlsAggServ.EXPECT().ProcessNewSignature(context.Background(), TASK_INDEX, signedTaskResponse.TaskResponse,
&signedTaskResponse.BlsSignature, signedTaskResponse.OperatorId)
err = aggregator.ProcessSignedTaskResponse(signedTaskResponse, nil)
assert.Nil(t, err)
Expand Down

0 comments on commit fae8ffd

Please sign in to comment.