-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
43 lines (37 loc) · 2.08 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package v0_18
import (
"github.com/furyaxyz/fuxchain/x/staking/legacy/v0_11"
"time"
"github.com/furyaxyz/fuxchain/x/staking/legacy/v0_10"
sdk "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/types"
)
var DefaultMinSelfDelegation = sdk.NewDec(10000)
type (
// GenesisState - all staking state that must be provided at genesis
GenesisState struct {
Params Params `json:"params" yaml:"params"`
LastTotalPower sdk.Int `json:"last_total_power" yaml:"last_total_power"`
LastValidatorPowers []v0_10.LastValidatorPower `json:"last_validator_powers" yaml:"last_validator_powers"`
Validators []v0_10.ValidatorExported `json:"validators" yaml:"validators"`
Delegators []v0_10.Delegator `json:"delegators" yaml:"delegators"`
UnbondingDelegations []v0_10.UndelegationInfo `json:"unbonding_delegations" yaml:"unbonding_delegations"`
AllShares []v0_11.SharesExported `json:"all_shares" yaml:"all_shares"`
ProxyDelegatorKeys []v0_10.ProxyDelegatorKeyExported `json:"proxy_delegator_keys" yaml:"proxy_delegator_keys"`
Exported bool `json:"exported" yaml:"exported"`
}
// Params defines the high level settings for staking
Params struct {
// time duration of unbonding
UnbondingTime time.Duration `json:"unbonding_time" yaml:"unbonding_time"`
// note: we need to be a bit careful about potential overflow here, since this is user-determined
// maximum number of validators (max uint16 = 65535)
MaxValidators uint16 `json:"max_bonded_validators" yaml:"max_bonded_validators"`
// epoch for validator update
Epoch uint16 `json:"epoch" yaml:"epoch"`
MaxValsToAddShares uint16 `json:"max_validators_to_add_shares" yaml:"max_validators_to_add_shares"`
// limited amount of delegate
MinDelegation sdk.Dec `json:"min_delegation" yaml:"min_delegation"`
// validator's self declared minimum self delegation
MinSelfDelegation sdk.Dec `json:"min_self_delegation" yaml:"min_self_delegation"`
}
)