mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 03:51:29 +00:00
d17996f8b0
* 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
31 lines
1.0 KiB
Go
31 lines
1.0 KiB
Go
package state_native
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/v4/config/params"
|
|
"github.com/prysmaticlabs/prysm/v4/runtime/version"
|
|
)
|
|
|
|
func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) {
|
|
switch b.version {
|
|
case version.Bellatrix, version.Capella:
|
|
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, version.Capella:
|
|
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)
|
|
}
|