Skip to content

Commit

Permalink
polygon/heimdall: remove old duplicate heimdall component (#11214)
Browse files Browse the repository at this point in the history
part 2 of #11186
  • Loading branch information
taratorio authored Jul 18, 2024
1 parent 086e770 commit 50b09ad
Show file tree
Hide file tree
Showing 14 changed files with 224 additions and 3,593 deletions.
15 changes: 15 additions & 0 deletions polygon/heimdall/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,26 @@
package heimdall

import (
"math/big"
"testing"
"time"

libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon/crypto"
"github.com/ledgerwatch/erigon/polygon/heimdall/heimdalltest"
)

func TestCheckpointJsonMarshall(t *testing.T) {
heimdalltest.AssertJsonMarshalUnmarshal(t, makeCheckpoint(10, 100))
}

func makeCheckpoint(start uint64, len uint) *Checkpoint {
return &Checkpoint{
Fields: WaypointFields{
StartBlock: new(big.Int).SetUint64(start),
EndBlock: new(big.Int).SetUint64(start + uint64(len) - 1),
RootHash: libcommon.BytesToHash(crypto.Keccak256([]byte("ROOT"))),
Timestamp: uint64(time.Now().Unix()),
},
}
}
Loading

0 comments on commit 50b09ad

Please sign in to comment.