Slash() and ForceUnbond() are functions of ValidatorSet, not Validator

This commit is contained in:
Christopher Goes
2018-05-28 21:55:52 +02:00
parent 66b4461543
commit 366d8f9323
4 changed files with 18 additions and 25 deletions
+7 -8
View File
@@ -17,14 +17,11 @@ const (
// validator for a delegated proof of stake system
type Validator interface {
GetStatus() BondStatus // status of the validator
GetOwner() Address // owner address to receive/return validators coins
GetPubKey() crypto.PubKey // validation pubkey
GetPower() Rat // validation power
GetBondHeight() int64 // height in which the validator became active
Slash(Context, int64, Rat) // slash the validator and delegators of the validator
// for an offense at a specified height by a specified fraction
ForceUnbond(Context, int64) // force unbond the validator, including a duration which must pass before they can rebond
GetStatus() BondStatus // status of the validator
GetOwner() Address // owner address to receive/return validators coins
GetPubKey() crypto.PubKey // validation pubkey
GetPower() Rat // validation power
GetBondHeight() int64 // height in which the validator became active
}
// validator which fulfills abci validator interface for use in Tendermint
@@ -48,6 +45,8 @@ type ValidatorSet interface {
Validator(Context, Address) Validator // get a particular validator by owner address
ValidatorByPubKey(Context, crypto.PubKey) Validator // get a particular validator by public key
TotalPower(Context) Rat // total power of the validator set
Slash(Context, crypto.PubKey, int64, Rat) // slash the validator and delegators of the validator, specifying offence height & slash fraction
ForceUnbond(Context, crypto.PubKey, int64) // force unbond the validator, including a duration which must pass before they can rebond
}
//_______________________________________________________________________________