mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
d17996f8b0
* Update V3 from V4 * Fix build v3 -> v4 * Update ssz * Update beacon_chain.pb.go * Fix formatter import * Update update-mockgen.sh comment to v4 * Fix conflicts. Pass build and tests * Fix test
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package state_native
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state/state-native/types"
|
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
|
"github.com/prysmaticlabs/prysm/v4/runtime/version"
|
|
"github.com/prysmaticlabs/prysm/v4/testing/require"
|
|
)
|
|
|
|
func TestSetNextWithdrawalIndex(t *testing.T) {
|
|
s := BeaconState{
|
|
version: version.Capella,
|
|
nextWithdrawalIndex: 3,
|
|
dirtyFields: make(map[types.FieldIndex]bool),
|
|
}
|
|
require.NoError(t, s.SetNextWithdrawalIndex(5))
|
|
require.Equal(t, uint64(5), s.nextWithdrawalIndex)
|
|
require.Equal(t, true, s.dirtyFields[types.NextWithdrawalIndex])
|
|
}
|
|
|
|
func TestSetNextWithdrawalValidatorIndex(t *testing.T) {
|
|
s := BeaconState{
|
|
version: version.Capella,
|
|
nextWithdrawalValidatorIndex: 3,
|
|
dirtyFields: make(map[types.FieldIndex]bool),
|
|
}
|
|
require.NoError(t, s.SetNextWithdrawalValidatorIndex(5))
|
|
require.Equal(t, primitives.ValidatorIndex(5), s.nextWithdrawalValidatorIndex)
|
|
require.Equal(t, true, s.dirtyFields[types.NextWithdrawalValidatorIndex])
|
|
}
|