|
|
|
@ -11,7 +11,7 @@ import ( |
|
|
|
|
func TestIsEpochBlock(t *testing.T) { |
|
|
|
|
block1 := types.NewBlock(&types.Header{Number: big.NewInt(10)}, nil, nil) |
|
|
|
|
block2 := types.NewBlock(&types.Header{Number: big.NewInt(0)}, nil, nil) |
|
|
|
|
block3 := types.NewBlock(&types.Header{Number: big.NewInt(327680)}, nil, nil) |
|
|
|
|
block3 := types.NewBlock(&types.Header{Number: big.NewInt(344064)}, nil, nil) |
|
|
|
|
block4 := types.NewBlock(&types.Header{Number: big.NewInt(77)}, nil, nil) |
|
|
|
|
block5 := types.NewBlock(&types.Header{Number: big.NewInt(78)}, nil, nil) |
|
|
|
|
block6 := types.NewBlock(&types.Header{Number: big.NewInt(188)}, nil, nil) |
|
|
|
@ -57,11 +57,11 @@ func TestIsEpochBlock(t *testing.T) { |
|
|
|
|
true, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
for _, test := range tests { |
|
|
|
|
for i, test := range tests { |
|
|
|
|
ShardingSchedule = test.schedule |
|
|
|
|
r := IsEpochBlock(test.block) |
|
|
|
|
if r != test.expected { |
|
|
|
|
t.Errorf("expected: %v, got: %v\n", test.expected, r) |
|
|
|
|
t.Errorf("index: %v, expected: %v, got: %v\n", i, test.expected, r) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|