prysm-pulse/beacon-chain/state/state-native/setters_sync_committee.go
terencechain d17996f8b0
Update to V4 🚀 (#12134)
* 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
2023-03-17 18:52:56 +00:00

36 lines
934 B
Go

package state_native
import (
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state/state-native/types"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v4/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
}