mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
39893bbe30
* encapsulate beacon state specific spec parameters * edit build file * code review suggestion Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
31 lines
1022 B
Go
31 lines
1022 B
Go
package state_native
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/config/params"
|
|
"github.com/prysmaticlabs/prysm/runtime/version"
|
|
)
|
|
|
|
func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) {
|
|
switch b.version {
|
|
case version.Bellatrix:
|
|
return params.BeaconConfig().ProportionalSlashingMultiplierBellatrix, nil
|
|
case version.Altair:
|
|
return params.BeaconConfig().ProportionalSlashingMultiplierAltair, nil
|
|
case version.Phase0:
|
|
return params.BeaconConfig().ProportionalSlashingMultiplier, nil
|
|
}
|
|
return 0, errNotSupported("ProportionalSlashingMultiplier()", b.version)
|
|
}
|
|
|
|
func (b *BeaconState) InactivityPenaltyQuotient() (uint64, error) {
|
|
switch b.version {
|
|
case version.Bellatrix:
|
|
return params.BeaconConfig().InactivityPenaltyQuotientBellatrix, nil
|
|
case version.Altair:
|
|
return params.BeaconConfig().InactivityPenaltyQuotientAltair, nil
|
|
case version.Phase0:
|
|
return params.BeaconConfig().InactivityPenaltyQuotient, nil
|
|
}
|
|
return 0, errNotSupported("InactivityPenaltyQuotient()", b.version)
|
|
}
|