-
Notifications
You must be signed in to change notification settings - Fork 368
/
querier.go
52 lines (45 loc) · 1.46 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
package types
const (
// QueryGetAuction is the query path for querying one auction
QueryGetAuction = "auction"
// QueryGetAuctions is the query path for querying all auctions
QueryGetAuctions = "auctions"
// QueryGetParams is the query path for querying the global auction params
QueryGetParams = "params"
)
// QueryAuctionParams params for query /auction/auction
type QueryAuctionParams struct {
AuctionID uint64
}
// QueryAllAuctionParams is the params for an auctions query
type QueryAllAuctionParams struct {
Page int `json:"page" yaml:"page"`
Limit int `json:"limit" yaml:"limit"`
Type string `json:"type" yaml:"type"`
Denom string `json:"denom" yaml:"denom"`
Phase string `json:"phase" yaml:"phase"`
}
// NewQueryAllAuctionParams creates a new QueryAllAuctionParams
func NewQueryAllAuctionParams(page, limit int, aucType, aucDenom, aucPhase string) QueryAllAuctionParams {
return QueryAllAuctionParams{
Page: page,
Limit: limit,
Type: aucType,
Denom: aucDenom,
Phase: aucPhase,
}
}
// AuctionWithPhase augmented type for collateral auctions which includes auction phase for querying
type AuctionWithPhase struct {
Auction Auction `json:"auction" yaml:"auction"`
Type string `json:"type" yaml:"type"`
Phase string `json:"phase" yaml:"phase"`
}
// NewAuctionWithPhase returns new AuctionWithPhase
func NewAuctionWithPhase(a Auction) AuctionWithPhase {
return AuctionWithPhase{
Auction: a,
Type: a.GetType(),
Phase: a.GetPhase(),
}
}