-
Notifications
You must be signed in to change notification settings - Fork 43
/
querier.go
112 lines (94 loc) · 3.52 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Defines the prefix of each query path
const (
QueryParameters = "parameters"
QueryExchangeRate = "exchangeRate"
QueryExchangeRates = "exchangeRates"
QueryActives = "actives"
QueryFeederDelegation = "feederDelegation"
QueryMissCounter = "missCounter"
QueryAggregatePrevote = "aggregatePrevote"
QueryAggregatePrevotes = "aggregatePrevotes"
QueryAggregateVote = "aggregateVote"
QueryAggregateVotes = "aggregateVotes"
QueryVoteTargets = "voteTargets"
QueryTobinTax = "tobinTax"
QueryTobinTaxes = "tobinTaxes"
)
// QueryExchangeRateParams defines the params for the following queries:
// - 'custom/oracle/exchange_rate'
type QueryExchangeRateParams struct {
Denom string
}
// NewQueryExchangeRateParams returns params for exchange_rate query
func NewQueryExchangeRateParams(denom string) QueryExchangeRateParams {
return QueryExchangeRateParams{denom}
}
// QueryPrevotesParams defines the params for the following queries:
// - 'custom/oracle/prevotes'
type QueryPrevotesParams struct {
Voter sdk.ValAddress
Denom string
}
// NewQueryPrevotesParams returns params for exchange_rate prevotes query
func NewQueryPrevotesParams(voter sdk.ValAddress, denom string) QueryPrevotesParams {
return QueryPrevotesParams{voter, denom}
}
// QueryVotesParams defines the params for the following queries:
// - 'custom/oracle/votes'
type QueryVotesParams struct {
Voter sdk.ValAddress
Denom string
}
// NewQueryVotesParams returns params for exchange_rate votes query
func NewQueryVotesParams(voter sdk.ValAddress, denom string) QueryVotesParams {
return QueryVotesParams{voter, denom}
}
// QueryFeederDelegationParams defeins the params for the following queries:
// - 'custom/oracle/feederDelegation'
type QueryFeederDelegationParams struct {
Validator sdk.ValAddress
}
// NewQueryFeederDelegationParams returns params for feeder delegation query
func NewQueryFeederDelegationParams(validator sdk.ValAddress) QueryFeederDelegationParams {
return QueryFeederDelegationParams{validator}
}
// QueryMissCounterParams defines the params for the following queries:
// - 'custom/oracle/missCounter'
type QueryMissCounterParams struct {
Validator sdk.ValAddress
}
// NewQueryMissCounterParams returns params for feeder delegation query
func NewQueryMissCounterParams(validator sdk.ValAddress) QueryMissCounterParams {
return QueryMissCounterParams{validator}
}
// QueryAggregatePrevoteParams defines the params for the following queries:
// - 'custom/oracle/aggregatePrevote'
type QueryAggregatePrevoteParams struct {
Validator sdk.ValAddress
}
// NewQueryAggregatePrevoteParams returns params for feeder delegation query
func NewQueryAggregatePrevoteParams(validator sdk.ValAddress) QueryAggregatePrevoteParams {
return QueryAggregatePrevoteParams{validator}
}
// QueryAggregateVoteParams defines the params for the following queries:
// - 'custom/oracle/aggregateVote'
type QueryAggregateVoteParams struct {
Validator sdk.ValAddress
}
// NewQueryAggregateVoteParams returns params for feeder delegation query
func NewQueryAggregateVoteParams(validator sdk.ValAddress) QueryAggregateVoteParams {
return QueryAggregateVoteParams{validator}
}
// QueryTobinTaxParams defines the params for the following queries:
// - 'custom/oracle/tobinTax'
type QueryTobinTaxParams struct {
Denom string
}
// NewQueryTobinTaxParams returns params for tobin tax query
func NewQueryTobinTaxParams(denom string) QueryTobinTaxParams {
return QueryTobinTaxParams{denom}
}