github.com/prysmaticlabs/prysm@v1.4.4/spectest/shared/phase0/epoch_processing/eth1_data_reset.go (about) 1 package epoch_processing 2 3 import ( 4 "path" 5 "testing" 6 7 "github.com/prysmaticlabs/prysm/beacon-chain/core/epoch" 8 iface "github.com/prysmaticlabs/prysm/beacon-chain/state/interface" 9 "github.com/prysmaticlabs/prysm/shared/testutil/require" 10 "github.com/prysmaticlabs/prysm/spectest/utils" 11 ) 12 13 // RunEth1DataResetTests executes "epoch_processing/eth1_data_reset" tests. 14 func RunEth1DataResetTests(t *testing.T, config string) { 15 require.NoError(t, utils.SetConfig(t, config)) 16 17 testFolders, testsFolderPath := utils.TestFolders(t, config, "phase0", "epoch_processing/eth1_data_reset/pyspec_tests") 18 for _, folder := range testFolders { 19 t.Run(folder.Name(), func(t *testing.T) { 20 folderPath := path.Join(testsFolderPath, folder.Name()) 21 RunEpochOperationTest(t, folderPath, processEth1DataResetWrapper) 22 }) 23 } 24 } 25 26 func processEth1DataResetWrapper(t *testing.T, state iface.BeaconState) (iface.BeaconState, error) { 27 state, err := epoch.ProcessEth1DataReset(state) 28 require.NoError(t, err, "Could not process final updates") 29 return state, nil 30 }