-
Notifications
You must be signed in to change notification settings - Fork 181
/
querier.go
80 lines (71 loc) · 2.54 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
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// query endpoints supported by the staking Querier
const (
QueryValidators = "validators"
QueryValidator = "validator"
QueryUnbondingDelegation = "unbondingDelegation"
QueryPool = "pool"
QueryParameters = "parameters"
QueryAddress = "address"
QueryForAddress = "validatorAddress"
QueryForAccAddress = "validatorAccAddress"
QueryProxy = "proxy"
QueryValidatorAllShares = "validatorAllShares"
QueryDelegator = "delegator"
)
// QueryDelegatorParams defines the params for the following queries:
// - 'custom/staking/delegatorDelegations'
// - 'custom/staking/delegatorUnbondingDelegations'
// - 'custom/staking/delegatorValidators'
type QueryDelegatorParams struct {
DelegatorAddr sdk.AccAddress
}
// NewQueryDelegatorParams creates a new instance of QueryDelegatorParams
func NewQueryDelegatorParams(delegatorAddr sdk.AccAddress) QueryDelegatorParams {
return QueryDelegatorParams{
DelegatorAddr: delegatorAddr,
}
}
// QueryValidatorParams defines the params for the following queries:
// - 'custom/staking/validator'
// - 'custom/staking/validatorDelegations'
// - 'custom/staking/validatorUnbondingDelegations'
// - 'custom/staking/validatorRedelegations'
type QueryValidatorParams struct {
ValidatorAddr sdk.ValAddress
}
// NewQueryValidatorParams creates a new instance of QueryValidatorParams
func NewQueryValidatorParams(validatorAddr sdk.ValAddress) QueryValidatorParams {
return QueryValidatorParams{
ValidatorAddr: validatorAddr,
}
}
//// QueryBondsParams defines the params for the following queries:
//// - 'custom/staking/delegation'
//// - 'custom/staking/unbondingDelegation'
//// - 'custom/staking/delegatorValidator'
//type QueryBondsParams struct {
// DelegatorAddr sdk.AccAddress
// ValidatorAddr sdk.ValAddress
//}
//
//// NewQueryBondsParams creates a new instance of QueryBondsParams
//func NewQueryBondsParams(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) QueryBondsParams {
// return QueryBondsParams{
// DelegatorAddr: delegatorAddr,
// ValidatorAddr: validatorAddr,
// }
//}
// QueryValidatorsParams defines the params for the following queries:
// - 'custom/staking/validators'
type QueryValidatorsParams struct {
Page, Limit int
Status string
}
// NewQueryValidatorsParams creates a new instance of QueryValidatorsParams
func NewQueryValidatorsParams(page, limit int, status string) QueryValidatorsParams {
return QueryValidatorsParams{page, limit, status}
}