Skip to content

Commit 2549636

Browse files
committed
Updated mocks. Linted. Fixed test
1 parent 1354aa7 commit 2549636

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ generate-mocks: install-mock-generators
156156
mockery --name '.*' --dir=engine/execution/computation/computer --case=underscore --output="./engine/execution/computation/computer/mock" --outpkg="mock"
157157
mockery --name '.*' --dir=engine/execution/state --case=underscore --output="./engine/execution/state/mock" --outpkg="mock"
158158
mockery --name '.*' --dir=engine/collection --case=underscore --output="./engine/collection/mock" --outpkg="mock"
159-
mockery --name '.*' --dir=engine/common --case=underscore --output="./engine/common/mock" --outpkg="mock"
159+
mockery --name 'complianceCore' --dir=engine/common/follower --exported --case=underscore --output="./engine/common/follower/mock" --outpkg="mock"
160160
mockery --name '.*' --dir=engine/common/follower/cache --case=underscore --output="./engine/common/follower/cache/mock" --outpkg="mock"
161161
mockery --name '.*' --dir=engine/consensus --case=underscore --output="./engine/consensus/mock" --outpkg="mock"
162162
mockery --name '.*' --dir=engine/consensus/approvals --case=underscore --output="./engine/consensus/approvals/mock" --outpkg="mock"

engine/common/follower/compliance_engine_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/stretchr/testify/suite"
1313

1414
"github.com/onflow/flow-go/consensus/hotstuff/model"
15-
commonmock "github.com/onflow/flow-go/engine/common/mock"
15+
followermock "github.com/onflow/flow-go/engine/common/follower/mock"
1616
"github.com/onflow/flow-go/model/flow"
1717
"github.com/onflow/flow-go/model/messages"
1818
"github.com/onflow/flow-go/module/irrecoverable"
@@ -37,7 +37,7 @@ type EngineSuite struct {
3737
con *mocknetwork.Conduit
3838
me *module.Local
3939
headers *storage.Headers
40-
core *commonmock.FollowerCore
40+
core *followermock.ComplianceCore
4141

4242
ctx irrecoverable.SignalerContext
4343
cancel context.CancelFunc
@@ -52,7 +52,7 @@ func (s *EngineSuite) SetupTest() {
5252
s.me = module.NewLocal(s.T())
5353
s.headers = storage.NewHeaders(s.T())
5454

55-
s.core = commonmock.NewFollowerCore(s.T())
55+
s.core = followermock.NewComplianceCore(s.T())
5656
s.core.On("Start", mock.Anything).Return().Once()
5757
unittest.ReadyDoneify(s.core)
5858

@@ -195,7 +195,7 @@ func (s *EngineSuite) TestProcessFinalizedBlock() {
195195
// lower than finalized height
196196
metricsMock := module.NewEngineMetrics(s.T())
197197
metricsMock.On("MessageReceived", mock.Anything, metrics.MessageSyncedBlocks).Return().Once()
198-
metricsMock.On("MessageHandled", mock.Anything, metrics.MessageBlockProposal).Run(func(_ mock.Arguments) {
198+
metricsMock.On("MessageHandled", mock.Anything, metrics.MessageSyncedBlocks).Run(func(_ mock.Arguments) {
199199
close(done)
200200
}).Return().Once()
201201
s.engine.engMetrics = metricsMock

engine/common/mock/follower_core.go renamed to engine/common/follower/mock/compliance_core.go

Lines changed: 12 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

state/protocol/state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ type FollowerState interface {
7171
// All blocks are validated in full, including payload validation, prior to insertion. Only valid blocks are inserted.
7272
type ParticipantState interface {
7373
FollowerState
74-
74+
7575
// Extend introduces the block with the given ID into the persistent
7676
// protocol state without modifying the current finalized state. It allows
7777
// us to execute fork-aware queries against ambiguous protocol state, while

0 commit comments

Comments
 (0)