-
Notifications
You must be signed in to change notification settings - Fork 28
/
events.go
46 lines (42 loc) · 1.79 KB
/
events.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
package types
// service module event types
const (
EventTypeCreateContext = "create_context"
EventTypePauseContext = "pause_context"
EventTypeCompleteContext = "complete_context"
EventTypeNewBatch = "new_batch"
EventTypeNewBatchRequest = "new_batch_request"
EventTypeNewBatchRequestProvider = "new_batch_request_provider"
EventTypeCompleteBatch = "complete_batch"
EventTypeServiceSlash = "service_slash"
EventTypeNoExchangeRate = "no_exchange_rate"
AttributeValueCategory = ModuleName
AttributeKeyAuthor = "author"
AttributeKeyServiceName = "service_name"
AttributeKeyProvider = "provider"
AttributeKeyConsumer = "consumer"
AttributeKeyRequestContextID = "request_context_id"
AttributeKeyRequestContextState = "request_context_state"
AttributeKeyRequests = "requests"
AttributeKeyRequestID = "request_id"
AttributeKeyServiceFee = "service_fee"
AttributeKeyRequestHeight = "request_height"
AttributeKeyExpirationHeight = "expiration_height"
AttributeKeySlashedCoins = "slashed_coins"
AttributeKeyPriceDenom = "price_denom"
)
type BatchState struct {
BatchCounter uint64 `json:"batch_counter"`
State RequestContextBatchState `json:"state"`
BatchResponseThreshold uint32 `json:"batch_response_threshold"`
BatchRequestCount uint32 `json:"batch_request_count"`
BatchResponseCount uint32 `json:"batch_response_count"`
}
// ActionTag appends action and all tagKeys
func ActionTag(action string, tagKeys ...string) string {
tag := action
for _, key := range tagKeys {
tag = tag + "." + key
}
return tag
}