-
Notifications
You must be signed in to change notification settings - Fork 39
/
msg_type.go
34 lines (30 loc) · 1.5 KB
/
msg_type.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
package handlers
import (
"fmt"
)
const (
MSG_TYPE_CREATE_RESOURCE_NODE = "/stratos.register.v1.MsgCreateResourceNode"
MSG_TYPE_UPDATE_RESOURCE_NODE_DEPOSIT = "/stratos.register.v1.MsgUpdateResourceNodeDeposit"
MSG_TYPE_REMOVE_RESOURCE_NODE = "/stratos.register.v1.MsgRemoveResourceNode"
MSG_TYPE_CREATE_META_NODE = "/stratos.register.v1.MsgCreateMetaNode"
MSG_TYPE_UPDATE_META_NODE_DEPOSIT = "/stratos.register.v1.MsgUpdateMetaNodeDeposit"
MSG_TYPE_REMOVE_META_NODE = "/stratos.register.v1.MsgRemoveMetaNode"
MSG_TYPE_WITHDRAWN_META_NODE_REG_DEPOSIT = "/stratos.register.v1.MsgWithdrawMetaNodeRegistrationDeposit"
MSG_TYPE_META_NODE_REG_VOTE = "/stratos.register.v1.MsgMetaNodeRegistrationVote"
MSG_TYPE_PREPAY = "/stratos.sds.v1.MsgPrepay"
MSG_TYPE_FILE_UPLOAD = "/stratos.sds.v1.MsgFileUpload"
MSG_TYPE_VOLUME_REPORT = "/stratos.pot.v1.MsgVolumeReport"
MSG_TYPE_SLASHING_RESOURCE_NODE = "/stratos.pot.v1.MsgSlashingResourceNode"
MSG_TYPE_UPDATE_EFFECTIVE_DEPOSIT = "/stratos.register.v1.MsgUpdateEffectiveDeposit"
)
func GetEventAttribute(event, attribute string) string {
return fmt.Sprintf("%s.%s", event, attribute)
}
func GetEventAttributes(event string, attributes ...string) []string {
result := make([]string, 0)
for _, attr := range attributes {
fullAttr := fmt.Sprintf("%s.%s", event, attr)
result = append(result, fullAttr)
}
return result
}