-
Notifications
You must be signed in to change notification settings - Fork 176
/
querier.go
86 lines (71 loc) · 2.81 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
package types
import (
hmTypes "github.com/maticnetwork/heimdall/types"
)
// DONTCOVER
// Query endpoints supported by the slashing querier
const (
QueryParameters = "parameters"
QuerySigningInfo = "signingInfo"
QuerySigningInfos = "signingInfos"
QuerySlashingInfo = "slashingInfo"
QuerySlashingInfos = "slashingInfos"
QuerySlashingInfoBytes = "slashingInfoBytes"
QueryTickSlashingInfos = "tickSlashingInfos"
QuerySlashingSequence = "slashing-sequence"
QueryTickCount = "tick-count"
)
// QuerySigningInfoParams defines the params for the following queries:
// - 'custom/slashing/signingInfo'
type QuerySigningInfoParams struct {
ValidatorID hmTypes.ValidatorID
}
// NewQuerySigningInfoParams creates a new QuerySigningInfoParams instance
func NewQuerySigningInfoParams(valID hmTypes.ValidatorID) QuerySigningInfoParams {
return QuerySigningInfoParams{valID}
}
// QuerySigningInfosParams defines the params for the following queries:
// - 'custom/slashing/signingInfos'
type QuerySigningInfosParams struct {
Page, Limit int
}
// NewQuerySigningInfosParams creates a new QuerySigningInfosParams instance
func NewQuerySigningInfosParams(page, limit int) QuerySigningInfosParams {
return QuerySigningInfosParams{page, limit}
}
// QuerySlashingInfoParams defines the params for the following queries:
// - 'custom/slashing/slashingInfo'
type QuerySlashingInfoParams struct {
ValidatorID hmTypes.ValidatorID
}
// NewQuerySlashingInfoParams creates a new QuerySlashingInfoParams instance
func NewQuerySlashingInfoParams(valID hmTypes.ValidatorID) QuerySlashingInfoParams {
return QuerySlashingInfoParams{valID}
}
// QuerySlashingInfosParams defines the params for the following queries:
// - 'custom/slashing/slashingInfos'
type QuerySlashingInfosParams struct {
Page, Limit int
}
// NewQuerySlashingInfosParams creates a new QuerySlashingInfosParams instance
func NewQuerySlashingInfosParams(page, limit int) QuerySlashingInfosParams {
return QuerySlashingInfosParams{page, limit}
}
// QueryTickSlashingInfosParams defines the params for the following queries:
// - 'custom/slashing/tick_slash_infos'
type QueryTickSlashingInfosParams struct {
Page, Limit int
}
// NewQueryTickSlashingInfosParams creates a new QueryTickSlashingInfosParams instance
func NewQueryTickSlashingInfosParams(page, limit int) QueryTickSlashingInfosParams {
return QueryTickSlashingInfosParams{page, limit}
}
// QuerySlashingSequenceParams defines the params for querying an account Sequence.
type QuerySlashingSequenceParams struct {
TxHash string
LogIndex uint64
}
// NewQuerySlashingSequenceParams creates a new instance of QuerySlashingSequenceParams.
func NewQuerySlashingSequenceParams(txHash string, logIndex uint64) QuerySlashingSequenceParams {
return QuerySlashingSequenceParams{TxHash: txHash, LogIndex: logIndex}
}