-
Notifications
You must be signed in to change notification settings - Fork 11
/
querier.go
44 lines (36 loc) · 883 Bytes
/
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
package types
import (
"github.com/celer-network/sgn/mainchain"
)
const (
QuerySubscription = "subscription"
QueryRequest = "request"
QueryEpoch = "epoch"
QueryParameters = "parameters"
)
type QuerySubscriptionParams struct {
EthAddress string
}
func NewQuerySubscriptionParams(addr string) QuerySubscriptionParams {
return QuerySubscriptionParams{
EthAddress: mainchain.FormatAddrHex(addr),
}
}
type QueryRequestParams struct {
ChannelId []byte
SimplexReceiver string
}
func NewQueryRequestParams(channelId []byte, simplexReceiver string) QueryRequestParams {
return QueryRequestParams{
ChannelId: channelId,
SimplexReceiver: mainchain.FormatAddrHex(simplexReceiver),
}
}
type QueryEpochParams struct {
EpochId int64
}
func NewQueryEpochParams(epochId int64) QueryEpochParams {
return QueryEpochParams{
EpochId: epochId,
}
}