@@ -21,8 +21,8 @@ import (
2121 "github.com/onflow/flow-go/utils/unittest/fixtures"
2222)
2323
24- // CoreImplSuite is a test suite for testing the CoreImpl .
25- type CoreImplSuite struct {
24+ // CoreSuite is a test suite for testing the Core .
25+ type CoreSuite struct {
2626 suite.Suite
2727 execDataRequester * reqestermock.ExecutionDataRequester
2828 txResultErrMsgsRequester * txerrmsgsmock.Requester
@@ -37,24 +37,24 @@ type CoreImplSuite struct {
3737 latestPersistedSealedResult * storagemock.LatestPersistedSealedResult
3838}
3939
40- func TestCoreImplSuiteSuite (t * testing.T ) {
40+ func TestCoreSuiteSuite (t * testing.T ) {
4141 t .Parallel ()
42- suite .Run (t , new (CoreImplSuite ))
42+ suite .Run (t , new (CoreSuite ))
4343}
4444
45- func (c * CoreImplSuite ) SetupTest () {
45+ func (c * CoreSuite ) SetupTest () {
4646 t := c .T ()
4747
4848 c .execDataRequester = reqestermock .NewExecutionDataRequester (t )
4949 c .txResultErrMsgsRequester = txerrmsgsmock .NewRequester (t )
5050 c .txResultErrMsgsRequestTimeout = 100 * time .Millisecond
5151}
5252
53- // createTestCoreImpl creates a CoreImpl instance with mocked dependencies for testing.
53+ // createTestCore creates a Core instance with mocked dependencies for testing.
5454//
55- // Returns a configured CoreImpl ready for testing.
56- func (c * CoreImplSuite ) createTestCoreImpl (tf * testFixture ) * CoreImpl {
57- core , err := NewCoreImpl (
55+ // Returns a configured Core ready for testing.
56+ func (c * CoreSuite ) createTestCore (tf * testFixture ) * Core {
57+ core , err := NewCore (
5858 unittest .Logger (),
5959 tf .exeResult ,
6060 tf .block ,
@@ -130,12 +130,12 @@ func generateFixture(g *fixtures.GeneratorSuite) *testFixture {
130130 }
131131}
132132
133- func (c * CoreImplSuite ) TestCoreImpl_Constructor () {
133+ func (c * CoreSuite ) TestCore_Constructor () {
134134 block := unittest .BlockFixture ()
135135 executionResult := unittest .ExecutionResultFixture (unittest .WithBlock (block ))
136136
137137 c .Run ("happy path" , func () {
138- core , err := NewCoreImpl (
138+ core , err := NewCore (
139139 unittest .Logger (),
140140 executionResult ,
141141 block ,
@@ -156,7 +156,7 @@ func (c *CoreImplSuite) TestCoreImpl_Constructor() {
156156 })
157157
158158 c .Run ("block ID mismatch" , func () {
159- core , err := NewCoreImpl (
159+ core , err := NewCore (
160160 unittest .Logger (),
161161 executionResult ,
162162 unittest .BlockFixture (),
@@ -177,9 +177,9 @@ func (c *CoreImplSuite) TestCoreImpl_Constructor() {
177177 })
178178}
179179
180- // TestCoreImpl_Download tests the Download method retrieves execution data and transaction error
180+ // TestCore_Download tests the Download method retrieves execution data and transaction error
181181// messages.
182- func (c * CoreImplSuite ) TestCoreImpl_Download () {
182+ func (c * CoreSuite ) TestCore_Download () {
183183 ctx := context .Background ()
184184 g := fixtures .NewGeneratorSuite ()
185185
@@ -193,7 +193,7 @@ func (c *CoreImplSuite) TestCoreImpl_Download() {
193193
194194 c .Run ("successful download" , func () {
195195 tf := generateFixture (g )
196- core := c .createTestCoreImpl (tf )
196+ core := c .createTestCore (tf )
197197
198198 c .execDataRequester .On ("RequestExecutionData" , mock .Anything ).Return (tf .execData , nil ).Once ()
199199 c .txResultErrMsgsRequester .On ("Request" , mock .Anything ).Return (tf .txErrMsgs , nil ).Once ()
@@ -211,7 +211,7 @@ func (c *CoreImplSuite) TestCoreImpl_Download() {
211211
212212 c .Run ("execution data request error" , func () {
213213 tf := generateFixture (g )
214- core := c .createTestCoreImpl (tf )
214+ core := c .createTestCore (tf )
215215
216216 expectedErr := fmt .Errorf ("test execution data request error" )
217217
@@ -231,7 +231,7 @@ func (c *CoreImplSuite) TestCoreImpl_Download() {
231231
232232 c .Run ("transaction result error messages request error" , func () {
233233 tf := generateFixture (g )
234- core := c .createTestCoreImpl (tf )
234+ core := c .createTestCore (tf )
235235
236236 expectedErr := fmt .Errorf ("test tx error messages request error" )
237237
@@ -251,7 +251,7 @@ func (c *CoreImplSuite) TestCoreImpl_Download() {
251251
252252 c .Run ("context cancellation" , func () {
253253 tf := generateFixture (g )
254- core := c .createTestCoreImpl (tf )
254+ core := c .createTestCore (tf )
255255
256256 ctx , cancel := context .WithCancel (context .Background ())
257257 cancel ()
@@ -277,7 +277,7 @@ func (c *CoreImplSuite) TestCoreImpl_Download() {
277277
278278 c .Run ("txResultErrMsgsRequestTimeout expiration" , func () {
279279 tf := generateFixture (g )
280- core := c .createTestCoreImpl (tf )
280+ core := c .createTestCore (tf )
281281
282282 c .execDataRequester .On ("RequestExecutionData" , mock .Anything ).Return (tf .execData , nil ).Once ()
283283
@@ -304,7 +304,7 @@ func (c *CoreImplSuite) TestCoreImpl_Download() {
304304
305305 c .Run ("Download after Abandon returns an error" , func () {
306306 tf := generateFixture (g )
307- core := c .createTestCoreImpl (tf )
307+ core := c .createTestCore (tf )
308308
309309 core .Abandon ()
310310 c .Nil (core .workingData )
@@ -314,8 +314,8 @@ func (c *CoreImplSuite) TestCoreImpl_Download() {
314314 })
315315}
316316
317- // TestCoreImpl_Index tests the Index method which processes downloaded data.
318- func (c * CoreImplSuite ) TestCoreImpl_Index () {
317+ // TestCore_Index tests the Index method which processes downloaded data.
318+ func (c * CoreSuite ) TestCore_Index () {
319319 ctx := context .Background ()
320320 g := fixtures .NewGeneratorSuite ()
321321
@@ -324,7 +324,7 @@ func (c *CoreImplSuite) TestCoreImpl_Index() {
324324 c .txResultErrMsgsRequester .On ("Request" , mock .Anything ).Return (tf .txErrMsgs , nil )
325325
326326 c .Run ("successful indexing" , func () {
327- core := c .createTestCoreImpl (tf )
327+ core := c .createTestCore (tf )
328328
329329 err := core .Download (ctx )
330330 c .Require ().NoError (err )
@@ -347,7 +347,7 @@ func (c *CoreImplSuite) TestCoreImpl_Index() {
347347 })
348348
349349 c .Run ("indexer constructor error" , func () {
350- core := c .createTestCoreImpl (tf )
350+ core := c .createTestCore (tf )
351351 core .block = g .Blocks ().Fixture ()
352352
353353 err := core .Download (ctx )
@@ -359,7 +359,7 @@ func (c *CoreImplSuite) TestCoreImpl_Index() {
359359 })
360360
361361 c .Run ("failed to index block" , func () {
362- core := c .createTestCoreImpl (tf )
362+ core := c .createTestCore (tf )
363363
364364 err := core .Download (ctx )
365365 c .Require ().NoError (err )
@@ -372,7 +372,7 @@ func (c *CoreImplSuite) TestCoreImpl_Index() {
372372 })
373373
374374 c .Run ("failed to validate transaction result error messages" , func () {
375- core := c .createTestCoreImpl (tf )
375+ core := c .createTestCore (tf )
376376
377377 err := core .Download (ctx )
378378 c .Require ().NoError (err )
@@ -388,7 +388,7 @@ func (c *CoreImplSuite) TestCoreImpl_Index() {
388388 })
389389
390390 c .Run ("Index after Abandon returns an error" , func () {
391- core := c .createTestCoreImpl (tf )
391+ core := c .createTestCore (tf )
392392
393393 core .Abandon ()
394394 c .Nil (core .workingData )
@@ -398,16 +398,16 @@ func (c *CoreImplSuite) TestCoreImpl_Index() {
398398 })
399399
400400 c .Run ("Index before Download returns an error" , func () {
401- core := c .createTestCoreImpl (tf )
401+ core := c .createTestCore (tf )
402402
403403 err := core .Index ()
404404 c .ErrorContains (err , "downloading is not complete" )
405405 c .Nil (core .workingData .indexerData )
406406 })
407407}
408408
409- // TestCoreImpl_Persist tests the Persist method which persists indexed data to storages and database.
410- func (c * CoreImplSuite ) TestCoreImpl_Persist () {
409+ // TestCore_Persist tests the Persist method which persists indexed data to storages and database.
410+ func (c * CoreSuite ) TestCore_Persist () {
411411 t := c .T ()
412412 ctx := context .Background ()
413413 g := fixtures .NewGeneratorSuite ()
@@ -430,7 +430,7 @@ func (c *CoreImplSuite) TestCoreImpl_Persist() {
430430
431431 c .Run ("successful persistence of empty data" , func () {
432432 resetMocks ()
433- core := c .createTestCoreImpl (tf )
433+ core := c .createTestCore (tf )
434434
435435 err := core .Download (ctx )
436436 c .Require ().NoError (err )
@@ -484,7 +484,7 @@ func (c *CoreImplSuite) TestCoreImpl_Persist() {
484484 expectedErr := fmt .Errorf ("test persisting registers failure" )
485485
486486 resetMocks ()
487- core := c .createTestCoreImpl (tf )
487+ core := c .createTestCore (tf )
488488
489489 err := core .Download (ctx )
490490 c .Require ().NoError (err )
@@ -503,7 +503,7 @@ func (c *CoreImplSuite) TestCoreImpl_Persist() {
503503 expectedErr := fmt .Errorf ("test persisting events failure" )
504504
505505 resetMocks ()
506- core := c .createTestCoreImpl (tf )
506+ core := c .createTestCore (tf )
507507
508508 err := core .Download (ctx )
509509 c .Require ().NoError (err )
@@ -530,7 +530,7 @@ func (c *CoreImplSuite) TestCoreImpl_Persist() {
530530
531531 c .Run ("Persist after Abandon returns an error" , func () {
532532 resetMocks ()
533- core := c .createTestCoreImpl (tf )
533+ core := c .createTestCore (tf )
534534
535535 core .Abandon ()
536536 c .Nil (core .workingData )
@@ -541,7 +541,7 @@ func (c *CoreImplSuite) TestCoreImpl_Persist() {
541541
542542 c .Run ("Persist before Index returns an error" , func () {
543543 resetMocks ()
544- core := c .createTestCoreImpl (tf )
544+ core := c .createTestCore (tf )
545545 err := core .Persist ()
546546 c .ErrorContains (err , "indexing is not complete" )
547547 })
0 commit comments