2021-11-22 17:37:55 +00:00
|
|
|
package v3
|
|
|
|
|
|
|
|
import (
|
2022-08-16 12:20:13 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
|
2021-11-22 17:37:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// SetCurrentSyncCommittee for the beacon state.
|
|
|
|
func (b *BeaconState) SetCurrentSyncCommittee(val *ethpb.SyncCommittee) error {
|
|
|
|
if !b.hasInnerState() {
|
|
|
|
return ErrNilInnerState
|
|
|
|
}
|
|
|
|
b.lock.Lock()
|
|
|
|
defer b.lock.Unlock()
|
|
|
|
|
|
|
|
b.state.CurrentSyncCommittee = val
|
|
|
|
b.markFieldAsDirty(currentSyncCommittee)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNextSyncCommittee for the beacon state.
|
|
|
|
func (b *BeaconState) SetNextSyncCommittee(val *ethpb.SyncCommittee) error {
|
|
|
|
if !b.hasInnerState() {
|
|
|
|
return ErrNilInnerState
|
|
|
|
}
|
|
|
|
b.lock.Lock()
|
|
|
|
defer b.lock.Unlock()
|
|
|
|
|
|
|
|
b.state.NextSyncCommittee = val
|
|
|
|
b.markFieldAsDirty(nextSyncCommittee)
|
|
|
|
return nil
|
|
|
|
}
|