mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
36 lines
931 B
Go
36 lines
931 B
Go
package state_native
|
|
|
|
import (
|
|
"github.com/OffchainLabs/prysm/v7/beacon-chain/state/state-native/types"
|
|
ethpb "github.com/OffchainLabs/prysm/v7/proto/prysm/v1alpha1"
|
|
"github.com/OffchainLabs/prysm/v7/runtime/version"
|
|
)
|
|
|
|
// SetCurrentSyncCommittee for the beacon state.
|
|
func (b *BeaconState) SetCurrentSyncCommittee(val *ethpb.SyncCommittee) error {
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
if b.version == version.Phase0 {
|
|
return errNotSupported("SetCurrentSyncCommittee", b.version)
|
|
}
|
|
|
|
b.currentSyncCommittee = val
|
|
b.markFieldAsDirty(types.CurrentSyncCommittee)
|
|
return nil
|
|
}
|
|
|
|
// SetNextSyncCommittee for the beacon state.
|
|
func (b *BeaconState) SetNextSyncCommittee(val *ethpb.SyncCommittee) error {
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
if b.version == version.Phase0 {
|
|
return errNotSupported("SetNextSyncCommittee", b.version)
|
|
}
|
|
|
|
b.nextSyncCommittee = val
|
|
b.markFieldAsDirty(types.NextSyncCommittee)
|
|
return nil
|
|
}
|