forked from Kava-Labs/kava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
querier.go
62 lines (52 loc) · 1.4 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
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Query endpoints supported by the Querier
const (
QueryCommittees = "committees"
QueryCommittee = "committee"
QueryProposals = "proposals"
QueryProposal = "proposal"
QueryNextProposalID = "next-proposal-id"
QueryVotes = "votes"
QueryVote = "vote"
QueryTally = "tally"
QueryRawParams = "raw_params"
)
type QueryCommitteeParams struct {
CommitteeID uint64 `json:"committee_id" yaml:"committee_id"`
}
func NewQueryCommitteeParams(committeeID uint64) QueryCommitteeParams {
return QueryCommitteeParams{
CommitteeID: committeeID,
}
}
type QueryProposalParams struct {
ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"`
}
func NewQueryProposalParams(proposalID uint64) QueryProposalParams {
return QueryProposalParams{
ProposalID: proposalID,
}
}
type QueryVoteParams struct {
ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"`
Voter sdk.AccAddress `json:"voter" yaml:"voter"`
}
func NewQueryVoteParams(proposalID uint64, voter sdk.AccAddress) QueryVoteParams {
return QueryVoteParams{
ProposalID: proposalID,
Voter: voter,
}
}
type QueryRawParamsParams struct {
Subspace string
Key string
}
func NewQueryRawParamsParams(subspace, key string) QueryRawParamsParams {
return QueryRawParamsParams{
Subspace: subspace,
Key: key,
}
}