Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polygon/heimdall: remove old duplicate heimdall component #11214

Merged
merged 8 commits into from
Jul 18, 2024
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
Loading