prysm-pulse/beacon-chain/state/state-native/setters_withdrawal_test.go
2022-11-03 16:55:44 +00:00

27 lines
759 B
Go

package state_native
import (
"testing"
types "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v3/runtime/version"
"github.com/prysmaticlabs/prysm/v3/testing/require"
)
func TestSetNextWithdrawalIndex(t *testing.T) {
s := BeaconState{
version: version.Capella,
nextWithdrawalIndex: 3,
}
require.NoError(t, s.SetNextWithdrawalIndex(5))
require.Equal(t, uint64(5), s.nextWithdrawalIndex)
}
func TestSetLastWithdrawalValidatorIndex(t *testing.T) {
s := BeaconState{
version: version.Capella,
lastWithdrawalValidatorIndex: 3,
}
require.NoError(t, s.SetLastWithdrawalValidatorIndex(5))
require.Equal(t, types.ValidatorIndex(5), s.lastWithdrawalValidatorIndex)
}