mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 21:08:10 -05:00
* initialize genesis data asap at node start * add genesis validation tests with embedded state verification * Add test for hardcoded mainnet genesis validator root and time from init() function * Add test for UnmarshalState in encoding/ssz/detect/configfork.go * Add tests for genesis.Initialize * Move genesis/embedded to genesis/internal/embedded * Gazelle / BUILD fix * James feedback * Fix lint * Revert lock --------- Co-authored-by: Kasey <kasey@users.noreply.github.com> Co-authored-by: terence tsao <terence@prysmaticlabs.com> Co-authored-by: Preston Van Loon <preston@pvl.dev>
33 lines
564 B
Go
33 lines
564 B
Go
package embedded_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/OffchainLabs/prysm/v6/config/params"
|
|
"github.com/OffchainLabs/prysm/v6/genesis/internal/embedded"
|
|
)
|
|
|
|
func TestGenesisState(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
}{
|
|
{
|
|
name: params.MainnetName,
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
st, err := embedded.ByName(tt.name)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if st == nil {
|
|
t.Fatal("nil state")
|
|
}
|
|
if st.NumValidators() <= 0 {
|
|
t.Error("No validators present in state")
|
|
}
|
|
})
|
|
}
|
|
}
|