-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_feed.go
49 lines (42 loc) · 1.6 KB
/
edit_feed.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
package oracle
import (
. "github.com/bianjieai/chain-parser/common-parser/modules"
models "github.com/bianjieai/chain-parser/common-parser/types"
. "github.com/bianjieai/chain-parser/irismod-parser/modules"
)
type DocMsgEditFeed struct {
FeedName string `bson:"feed_name" yaml:"feed_name"`
LatestHistory int64 `bson:"latest_history" yaml:"latest_history"`
Description string `bson:"description"`
Creator string `bson:"creator"`
Providers []string `bson:"providers"`
Timeout int64 `bson:"timeout"`
ServiceFeeCap []models.Coin `bson:"service_fee_cap" yaml:"service_fee_cap"`
RepeatedFrequency int64 `bson:"repeated_frequency" yaml:"repeated_frequency"`
ResponseThreshold uint32 `bson:"response_threshold" yaml:"response_threshold"`
}
func (m *DocMsgEditFeed) GetType() string {
return TxTypeEditFeed
}
func (m *DocMsgEditFeed) BuildMsg(v interface{}) {
msg := v.(*MsgEditFeed)
m.FeedName = msg.FeedName
m.LatestHistory = int64(msg.LatestHistory)
m.Description = msg.Description
m.Creator = msg.Creator
m.Providers = msg.GetProviders()
m.Timeout = msg.Timeout
m.ServiceFeeCap = models.BuildDocCoins(msg.ServiceFeeCap)
m.RepeatedFrequency = int64(msg.RepeatedFrequency)
m.ResponseThreshold = msg.ResponseThreshold
}
func (m *DocMsgEditFeed) HandleTxMsg(v SdkMsg) MsgDocInfo {
var addrs []string
msg := v.(*MsgEditFeed)
addrs = append(addrs, msg.Creator)
addrs = append(addrs, msg.GetProviders()...)
handler := func() (Msg, []string) {
return m, addrs
}
return CreateMsgDocInfo(v, handler)
}