-
Notifications
You must be signed in to change notification settings - Fork 31
/
querier.go
94 lines (80 loc) · 3.59 KB
/
querier.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package types
import (
sdk "github.com/Finschia/finschia-sdk/types"
)
// querier keys
const (
QueryParams = "params"
QueryValidatorOutstandingRewards = "validator_outstanding_rewards"
QueryValidatorCommission = "validator_commission"
QueryValidatorSlashes = "validator_slashes"
QueryDelegationRewards = "delegation_rewards"
QueryDelegatorTotalRewards = "delegator_total_rewards"
QueryDelegatorValidators = "delegator_validators"
QueryWithdrawAddr = "withdraw_addr"
QueryCommunityPool = "community_pool"
)
// params for query 'custom/distr/validator_outstanding_rewards'
type QueryValidatorOutstandingRewardsParams struct {
ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
}
// creates a new instance of QueryValidatorOutstandingRewardsParams
func NewQueryValidatorOutstandingRewardsParams(validatorAddr sdk.ValAddress) QueryValidatorOutstandingRewardsParams {
return QueryValidatorOutstandingRewardsParams{
ValidatorAddress: validatorAddr,
}
}
// params for query 'custom/distr/validator_commission'
type QueryValidatorCommissionParams struct {
ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
}
// creates a new instance of QueryValidatorCommissionParams
func NewQueryValidatorCommissionParams(validatorAddr sdk.ValAddress) QueryValidatorCommissionParams {
return QueryValidatorCommissionParams{
ValidatorAddress: validatorAddr,
}
}
// params for query 'custom/distr/validator_slashes'
type QueryValidatorSlashesParams struct {
ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
StartingHeight uint64 `json:"starting_height" yaml:"starting_height"`
EndingHeight uint64 `json:"ending_height" yaml:"ending_height"`
}
// creates a new instance of QueryValidatorSlashesParams
func NewQueryValidatorSlashesParams(validatorAddr sdk.ValAddress, startingHeight uint64, endingHeight uint64) QueryValidatorSlashesParams {
return QueryValidatorSlashesParams{
ValidatorAddress: validatorAddr,
StartingHeight: startingHeight,
EndingHeight: endingHeight,
}
}
// params for query 'custom/distr/delegation_rewards'
type QueryDelegationRewardsParams struct {
DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"`
ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"`
}
// creates a new instance of QueryDelegationRewardsParams
func NewQueryDelegationRewardsParams(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) QueryDelegationRewardsParams {
return QueryDelegationRewardsParams{
DelegatorAddress: delegatorAddr,
ValidatorAddress: validatorAddr,
}
}
// params for query 'custom/distr/delegator_total_rewards' and 'custom/distr/delegator_validators'
type QueryDelegatorParams struct {
DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"`
}
// creates a new instance of QueryDelegationRewardsParams
func NewQueryDelegatorParams(delegatorAddr sdk.AccAddress) QueryDelegatorParams {
return QueryDelegatorParams{
DelegatorAddress: delegatorAddr,
}
}
// params for query 'custom/distr/withdraw_addr'
type QueryDelegatorWithdrawAddrParams struct {
DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"`
}
// NewQueryDelegatorWithdrawAddrParams creates a new instance of QueryDelegatorWithdrawAddrParams.
func NewQueryDelegatorWithdrawAddrParams(delegatorAddr sdk.AccAddress) QueryDelegatorWithdrawAddrParams {
return QueryDelegatorWithdrawAddrParams{DelegatorAddress: delegatorAddr}
}