mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-15 14:38:20 +00:00
6406afc6cf
* Native beacon state: v3 * nogo_config * remove duplicated bazel rule * gzl * fix unnecessary assignment * review Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package v3
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/go-bitfield"
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// SetJustificationBits for the beacon state.
|
|
func (b *BeaconState) SetJustificationBits(val bitfield.Bitvector4) error {
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
b.justificationBits = val
|
|
b.markFieldAsDirty(justificationBits)
|
|
return nil
|
|
}
|
|
|
|
// SetPreviousJustifiedCheckpoint for the beacon state.
|
|
func (b *BeaconState) SetPreviousJustifiedCheckpoint(val *ethpb.Checkpoint) error {
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
b.previousJustifiedCheckpoint = val
|
|
b.markFieldAsDirty(previousJustifiedCheckpoint)
|
|
return nil
|
|
}
|
|
|
|
// SetCurrentJustifiedCheckpoint for the beacon state.
|
|
func (b *BeaconState) SetCurrentJustifiedCheckpoint(val *ethpb.Checkpoint) error {
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
b.currentJustifiedCheckpoint = val
|
|
b.markFieldAsDirty(currentJustifiedCheckpoint)
|
|
return nil
|
|
}
|
|
|
|
// SetFinalizedCheckpoint for the beacon state.
|
|
func (b *BeaconState) SetFinalizedCheckpoint(val *ethpb.Checkpoint) error {
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
b.finalizedCheckpoint = val
|
|
b.markFieldAsDirty(finalizedCheckpoint)
|
|
return nil
|
|
}
|