mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
4f3762f1f7
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
32 lines
702 B
Go
32 lines
702 B
Go
package v2
|
|
|
|
import (
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// 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
|
|
}
|