@@ -15,6 +15,7 @@ import (
1515 arma_types "github.com/hyperledger/fabric-x-orderer/common/types"
1616 "github.com/hyperledger/fabric-x-orderer/core"
1717 "github.com/hyperledger/fabric-x-orderer/core/mocks"
18+ "github.com/hyperledger/fabric-x-orderer/node/consensus/state"
1819 "github.com/hyperledger/fabric-x-orderer/testutil"
1920 "github.com/stretchr/testify/require"
2021)
@@ -141,7 +142,7 @@ func TestPrimaryChangeToSecondary(t *testing.T) {
141142 batcher .Ledger = ledger
142143
143144 stateProvider := & mocks.FakeStateProvider {}
144- stateChan := make (chan * core .State )
145+ stateChan := make (chan * state .State )
145146 stateProvider .GetLatestStateChanReturns (stateChan )
146147 batcher .StateProvider = stateProvider
147148
@@ -158,8 +159,8 @@ func TestPrimaryChangeToSecondary(t *testing.T) {
158159 return stateProvider .GetLatestStateChanCallCount () == 1
159160 }, 10 * time .Second , 10 * time .Millisecond )
160161
161- stateChan <- & core .State {
162- Shards : []core .ShardTerm {
162+ stateChan <- & state .State {
163+ Shards : []state .ShardTerm {
163164 {
164165 Shard : 0 ,
165166 Term : 0 ,
@@ -173,8 +174,8 @@ func TestPrimaryChangeToSecondary(t *testing.T) {
173174
174175 require .NotZero (t , pool .NextRequestsCallCount ())
175176
176- stateChan <- & core .State {
177- Shards : []core .ShardTerm {
177+ stateChan <- & state .State {
178+ Shards : []state .ShardTerm {
178179 {
179180 Shard : 0 ,
180181 Term : 1 ,
@@ -223,7 +224,7 @@ func TestSecondaryChangeToPrimary(t *testing.T) {
223224 batcher .Ledger = ledger
224225
225226 stateProvider := & mocks.FakeStateProvider {}
226- stateChan := make (chan * core .State )
227+ stateChan := make (chan * state .State )
227228 stateProvider .GetLatestStateChanReturns (stateChan )
228229 batcher .StateProvider = stateProvider
229230
@@ -240,8 +241,8 @@ func TestSecondaryChangeToPrimary(t *testing.T) {
240241 return stateProvider .GetLatestStateChanCallCount () == 1
241242 }, 10 * time .Second , 10 * time .Millisecond )
242243
243- stateChan <- & core .State {
244- Shards : []core .ShardTerm {
244+ stateChan <- & state .State {
245+ Shards : []state .ShardTerm {
245246 {
246247 Shard : 0 ,
247248 Term : 0 ,
@@ -256,8 +257,8 @@ func TestSecondaryChangeToPrimary(t *testing.T) {
256257
257258 require .Zero (t , pool .NextRequestsCallCount ())
258259
259- stateChan <- & core .State {
260- Shards : []core .ShardTerm {
260+ stateChan <- & state .State {
261+ Shards : []state .ShardTerm {
261262 {
262263 Shard : 0 ,
263264 Term : 1 ,
@@ -319,7 +320,7 @@ func TestSecondaryChangeToSecondary(t *testing.T) {
319320 batcher .MemPool = pool
320321
321322 stateProvider := & mocks.FakeStateProvider {}
322- stateChan := make (chan * core .State )
323+ stateChan := make (chan * state .State )
323324 stateProvider .GetLatestStateChanReturns (stateChan )
324325 batcher .StateProvider = stateProvider
325326
@@ -329,8 +330,8 @@ func TestSecondaryChangeToSecondary(t *testing.T) {
329330 return stateProvider .GetLatestStateChanCallCount () == 1
330331 }, 10 * time .Second , 10 * time .Millisecond )
331332
332- stateChan <- & core .State {
333- Shards : []core .ShardTerm {
333+ stateChan <- & state .State {
334+ Shards : []state .ShardTerm {
334335 {
335336 Shard : 0 ,
336337 Term : 0 ,
@@ -343,8 +344,8 @@ func TestSecondaryChangeToSecondary(t *testing.T) {
343344 return ledger .AppendCallCount () == 1
344345 }, 10 * time .Second , 10 * time .Millisecond )
345346
346- stateChan <- & core .State {
347- Shards : []core .ShardTerm {
347+ stateChan <- & state .State {
348+ Shards : []state .ShardTerm {
348349 {
349350 Shard : 0 ,
350351 Term : 1 ,
@@ -404,7 +405,7 @@ func TestPrimaryChangeToPrimary(t *testing.T) {
404405 batcher .Ledger = ledger
405406
406407 stateProvider := & mocks.FakeStateProvider {}
407- stateChan := make (chan * core .State )
408+ stateChan := make (chan * state .State )
408409 stateProvider .GetLatestStateChanReturns (stateChan )
409410 batcher .StateProvider = stateProvider
410411
@@ -414,8 +415,8 @@ func TestPrimaryChangeToPrimary(t *testing.T) {
414415 return stateProvider .GetLatestStateChanCallCount () == 1
415416 }, 10 * time .Second , 10 * time .Millisecond )
416417
417- stateChan <- & core .State {
418- Shards : []core .ShardTerm {
418+ stateChan <- & state .State {
419+ Shards : []state .ShardTerm {
419420 {
420421 Shard : 0 ,
421422 Term : 0 ,
@@ -429,8 +430,8 @@ func TestPrimaryChangeToPrimary(t *testing.T) {
429430
430431 require .NotZero (t , pool .NextRequestsCallCount ())
431432
432- stateChan <- & core .State {
433- Shards : []core .ShardTerm {
433+ stateChan <- & state .State {
434+ Shards : []state .ShardTerm {
434435 {
435436 Shard : 0 ,
436437 Term : 4 ,
@@ -513,7 +514,7 @@ func TestPrimaryWaitingAndTermChange(t *testing.T) {
513514 batcher .Ledger = ledger
514515
515516 stateProvider := & mocks.FakeStateProvider {}
516- stateChan := make (chan * core .State )
517+ stateChan := make (chan * state .State )
517518 stateProvider .GetLatestStateChanReturns (stateChan )
518519 batcher .StateProvider = stateProvider
519520
@@ -526,8 +527,8 @@ func TestPrimaryWaitingAndTermChange(t *testing.T) {
526527
527528 batcher .Start ()
528529
529- stateChan <- & core .State {
530- Shards : []core .ShardTerm {
530+ stateChan <- & state .State {
531+ Shards : []state .ShardTerm {
531532 {
532533 Shard : 0 ,
533534 Term : 0 ,
@@ -543,8 +544,8 @@ func TestPrimaryWaitingAndTermChange(t *testing.T) {
543544 return pool .NextRequestsCallCount () == 10
544545 }, 10 * time .Second , 10 * time .Millisecond )
545546
546- stateChan <- & core .State {
547- Shards : []core .ShardTerm {
547+ stateChan <- & state .State {
548+ Shards : []state .ShardTerm {
548549 {
549550 Shard : 0 ,
550551 Term : 1 ,
@@ -593,7 +594,7 @@ func TestResubmitPending(t *testing.T) {
593594 batcher .Ledger = ledger
594595
595596 stateProvider := & mocks.FakeStateProvider {}
596- stateChan := make (chan * core .State )
597+ stateChan := make (chan * state .State )
597598 stateProvider .GetLatestStateChanReturns (stateChan )
598599 batcher .StateProvider = stateProvider
599600
@@ -610,8 +611,8 @@ func TestResubmitPending(t *testing.T) {
610611 return stateProvider .GetLatestStateChanCallCount () == 1
611612 }, 10 * time .Second , 10 * time .Millisecond )
612613
613- stateChan <- & core .State {
614- Shards : []core .ShardTerm {
614+ stateChan <- & state .State {
615+ Shards : []state .ShardTerm {
615616 {
616617 Shard : 0 ,
617618 Term : 0 ,
@@ -634,8 +635,8 @@ func TestResubmitPending(t *testing.T) {
634635 notMyBAF := arma_types .NewSimpleBatchAttestationFragment (batch .Shard (), batch .Primary (), batch .Seq (), batch .Digest (), arma_types .PartyID (batcherID + 1 ), nil , 0 , nil )
635636 myBAFWithOtherPrimary := arma_types .NewSimpleBatchAttestationFragment (batch .Shard (), batch .Primary ()+ 1 , batch .Seq (), batch .Digest (), arma_types .PartyID (batcherID ), nil , 0 , nil )
636637
637- stateChan <- & core .State {
638- Shards : []core .ShardTerm {
638+ stateChan <- & state .State {
639+ Shards : []state .ShardTerm {
639640 {
640641 Shard : 0 ,
641642 Term : 1 ,
0 commit comments