pull/1675/head
chao 5 years ago
parent 33ea6aa348
commit 0e205b6356
  1. 2
      staking/types/delegation.go
  2. 21
      staking/types/validator.go

@ -65,7 +65,7 @@ func (d Delegation) GetDelegatorAddr() common.Address { return d.DelegatorAddres
// GetValidatorAddr returns ValidatorAddr
func (d Delegation) GetValidatorAddr() common.Address { return d.ValidatorAddress }
// GetShares returns shares of a delegation
// GetAmount returns amount of a delegation
func (d Delegation) GetAmount() *big.Int { return d.Amount }
// String returns a human readable string representation of a Delegation.

@ -110,9 +110,20 @@ func (d Description) EnsureLength() (Description, error) {
return d, nil
}
func (v Validator) GetAddress() common.Address { return v.Address }
func (v Validator) IsActive() bool { return v.Active }
func (v Validator) GetName() string { return v.Description.Name }
func (v Validator) GetStake() *big.Int { return v.Stake }
func (v Validator) GetCommissionRate() Dec { return v.Commission.Rate }
// GetAddress returns address
func (v Validator) GetAddress() common.Address { return v.Address }
// IsActive checks whether validator is active
func (v Validator) IsActive() bool { return v.Active }
// GetName returns the name of validator in the description
func (v Validator) GetName() string { return v.Description.Name }
// GetStake returns the total staking amount
func (v Validator) GetStake() *big.Int { return v.Stake }
// GetCommissionRate returns the commission rate of the validator
func (v Validator) GetCommissionRate() Dec { return v.Commission.Rate }
// GetMinSelfDelegation returns the minimum amount the validator must stake
func (v Validator) GetMinSelfDelegation() *big.Int { return v.MinSelfDelegation }

Loading…
Cancel
Save