2022-10-08 14:15:44 +00:00
|
|
|
/*
|
|
|
|
Copyright 2022 Erigon-Lightclient contributors
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-09-29 22:20:09 +00:00
|
|
|
package fork
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-10-29 19:51:32 +00:00
|
|
|
"github.com/ledgerwatch/erigon/cl/clparams"
|
2022-09-29 22:20:09 +00:00
|
|
|
"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)
|
2023-01-23 23:03:48 +00:00
|
|
|
_, err = ComputeForkId(&beaconCfg, &genesisCfg)
|
2022-10-07 20:37:08 +00:00
|
|
|
require.NoError(t, err)
|
2023-04-13 15:09:13 +00:00
|
|
|
require.Equal(t, [4]byte{0xbb, 0xa4, 0xda, 0x96}, digest)
|
2022-09-29 22:20:09 +00:00
|
|
|
}
|