@ -992,19 +992,20 @@ func TestScMarkProcessed(t *testing.T) {
{
{
name : "processed an unreceived block" ,
name : "processed an unreceived block" ,
fields : scTestParams {
fields : scTestParams {
peers : map [ string ] * scPeer { "P1" : { height : 2 , state : peerStateReady } } ,
allB : [ ] int64 { 1 , 2 } ,
pending : map [ int64 ] p2p . ID { 2 : "P1" } ,
pendingTime : map [ int64 ] time . Time { 2 : now } ,
received : map [ int64 ] p2p . ID { 1 : "P1" } } ,
height : 2 ,
peers : map [ string ] * scPeer { "P1" : { height : 4 , state : peerStateReady } } ,
allB : [ ] int64 { 2 } ,
pending : map [ int64 ] p2p . ID { 2 : "P1" } ,
pendingTime : map [ int64 ] time . Time { 2 : now } ,
targetPending : 1 ,
} ,
args : args { height : 2 } ,
args : args { height : 2 } ,
wantFields : scTestParams {
wantFields : scTestParams {
peers : map [ string ] * scPeer { "P1" : { height : 2 , state : peerStateReady } } ,
allB : [ ] int64 { 1 , 2 } ,
pending : map [ int64 ] p2p . ID { 2 : "P1" } ,
pendingTime : map [ int64 ] time . Time { 2 : now } ,
received : map [ int64 ] p2p . ID { 1 : "P1" } } ,
wantErr : true ,
height : 3 ,
peers : map [ string ] * scPeer { "P1" : { height : 4 , state : peerStateReady } } ,
allB : [ ] int64 { 3 } ,
targetPending : 1 ,
} ,
} ,
} ,
{
{
name : "mark processed success" ,
name : "mark processed success" ,
@ -1571,7 +1572,7 @@ func TestScHandleBlockProcessed(t *testing.T) {
name : "empty scheduler" ,
name : "empty scheduler" ,
fields : scTestParams { height : 6 } ,
fields : scTestParams { height : 6 } ,
args : args { event : processed6FromP1 } ,
args : args { event : processed6FromP1 } ,
wantEvent : scSchedulerFail { reason : fmt . Errorf ( "some error" ) } ,
wantEvent : noOpEvent { } ,
} ,
} ,
{
{
name : "processed block we don't have" ,
name : "processed block we don't have" ,
@ -1583,7 +1584,7 @@ func TestScHandleBlockProcessed(t *testing.T) {
pendingTime : map [ int64 ] time . Time { 6 : now } ,
pendingTime : map [ int64 ] time . Time { 6 : now } ,
} ,
} ,
args : args { event : processed6FromP1 } ,
args : args { event : processed6FromP1 } ,
wantEvent : scSchedulerFail { reason : fmt . Errorf ( "some error" ) } ,
wantEvent : noOpEvent { } ,
} ,
} ,
{
{
name : "processed block ok, we processed all blocks" ,
name : "processed block ok, we processed all blocks" ,