Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
avalkov committed Jan 6, 2025
1 parent 8ceff9a commit b0e57c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions consensus/bor/heimdall/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ func TestFetchMilestoneFromMockHeimdall(t *testing.T) {
handler := &HttpHandlerFake{}
handler.handleFetchMilestone = func(w http.ResponseWriter, _ *http.Request) {
err := json.NewEncoder(w).Encode(milestone.MilestoneResponse{
Height: "0",
Result: milestone.Milestone{
Proposer: common.Address{},
StartBlock: big.NewInt(0),
EndBlock: big.NewInt(512),
StartBlock: 0,
EndBlock: 512,
Hash: common.Hash{},
BorChainID: "15001",
Timestamp: 0,
Expand Down
8 changes: 4 additions & 4 deletions eth/handler_bor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func fetchMilestoneTest(t *testing.T, heimdall *mockHeimdall, bor *bor.Bor, hand

// Check if we have expected result
require.Equal(t, err, nil)
require.Equal(t, milestones[len(milestones)-1].EndBlock.Uint64(), num)
require.Equal(t, milestones[len(milestones)-1].EndBlock, num)
require.Equal(t, milestones[len(milestones)-1].Hash, hash)
}

Expand Down Expand Up @@ -176,14 +176,14 @@ func createMockCheckpoints(count int) []*checkpoint.Checkpoint {
func createMockMilestones(count int) []*milestone.Milestone {
var (
milestones []*milestone.Milestone = make([]*milestone.Milestone, count)
startBlock int64 = 257 // any number can be used
startBlock uint64 = 257 // any number can be used
)

for i := 0; i < count; i++ {
milestones[i] = &milestone.Milestone{
Proposer: common.Address{},
StartBlock: big.NewInt(startBlock),
EndBlock: big.NewInt(startBlock + 255),
StartBlock: startBlock,
EndBlock: startBlock + 255,
Hash: common.Hash{},
BorChainID: "137",
Timestamp: uint64(time.Now().Unix()),
Expand Down

0 comments on commit b0e57c5

Please sign in to comment.