2022-09-29 22:20:09 +00:00
|
|
|
package fork
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/lightclient/clparams"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestMainnetFork(t *testing.T) {
|
|
|
|
beaconCfg := clparams.BeaconConfigs[clparams.MainnetNetwork]
|
|
|
|
genesisCfg := clparams.GenesisConfigs[clparams.MainnetNetwork]
|
|
|
|
digest, err := ComputeForkDigest(&beaconCfg, &genesisCfg)
|
|
|
|
require.NoError(t, err)
|
2022-10-07 20:37:08 +00:00
|
|
|
full, err := ComputeForkId(&beaconCfg, &genesisCfg)
|
|
|
|
require.NoError(t, err)
|
2022-09-29 22:20:09 +00:00
|
|
|
require.Equal(t, digest, [4]byte{74, 38, 197, 139})
|
2022-10-07 20:37:08 +00:00
|
|
|
require.Equal(t, full, []byte{0x4a, 0x26, 0xc5, 0x8b, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff})
|
2022-09-29 22:20:09 +00:00
|
|
|
}
|