mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
e0eee87bf4
* first node test * adding in configuration flags for code coverage * adding line to remove file on unit test * adding new test for compressed field trie but is currently broken * changing limit on trie * adding new trie length coverage * adding in test for empty copy of trie * adding more trie tests * adding new field trie * adding more field trie tests * adding clarity to chunking equation * fixing linting * clarifying function for limit * updating native state settings to improve ease of future unit tests * improving unit test * fixing unit tests * adding more tests and fixing linting * adding more coverage and removing unused file * increasing node coverage * adding new test for checking config for booleans * fixing db test * fixing linting * adding signing root test * fixing linting * removing accidently created beacondata * switching not non native state * reverting back to proto use for spec test * reverting back to proto for some tests * turning off native state on some tests * switching more to proto state * rolling back disablenativestate * switching to native state in the state-native package for tests * fixing linting * fixing deepsource complaint * fixing some tests to native state and removing some unused flag checks * convert to native state * fixing linting * issues are being triggered by deleting the db this way so reverting change in hopes of changing this * rolling back testing util * rolling back some tests from native state * rolling back db deletion * test switching native state off after test runs * fixing hasher test * fixing altair and bellatrix hashers for native state * Update beacon-chain/node/node_test.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update validator/rpc/auth_token_test.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * fixing imports * adding altair proof test Co-authored-by: Radosław Kapka <rkapka@wp.pl>
28 lines
1023 B
Go
28 lines
1023 B
Go
package state_native
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/config/features"
|
|
types "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
|
ethpb "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/v3/testing/require"
|
|
)
|
|
|
|
func TestBeaconState_RotateAttestations(t *testing.T) {
|
|
features.Init(&features.Flags{EnableNativeState: true})
|
|
st, err := InitializeFromProtoPhase0(ðpb.BeaconState{
|
|
Slot: 1,
|
|
CurrentEpochAttestations: []*ethpb.PendingAttestation{{Data: ðpb.AttestationData{Slot: 456}}},
|
|
PreviousEpochAttestations: []*ethpb.PendingAttestation{{Data: ðpb.AttestationData{Slot: 123}}},
|
|
})
|
|
require.NoError(t, err)
|
|
|
|
require.NoError(t, st.RotateAttestations())
|
|
s, ok := st.(*BeaconState)
|
|
require.Equal(t, true, ok)
|
|
require.Equal(t, 0, len(s.currentEpochAttestationsVal()))
|
|
require.Equal(t, types.Slot(456), s.previousEpochAttestationsVal()[0].Data.Slot)
|
|
features.Init(&features.Flags{EnableNativeState: false})
|
|
}
|