MCPcopy Create free account
hub / github.com/DNAProject/DNA / pushSmartCodeEvent

Function pushSmartCodeEvent

http/websocket/server.go:72–92  ·  view source on GitHub ↗
(v interface{})

Source from the content-addressed store, hash-verified

70}
71
72func pushSmartCodeEvent(v interface{}) {
73 if ws == nil {
74 return
75 }
76 rs, ok := v.(types.SmartCodeEvent)
77 if !ok {
78 log.Errorf("[PushSmartCodeEvent]", "SmartCodeEvent err")
79 return
80 }
81 go func() {
82 switch object := rs.Result.(type) {
83 case *event.LogEventArgs:
84 contractAddrs, evts := bcomn.GetLogEvent(object)
85 pushEvent(contractAddrs, rs.TxHash.ToHexString(), rs.Error, rs.Action, evts)
86 case *event.ExecuteNotify:
87 contractAddrs, notify := bcomn.GetExecuteNotify(object)
88 pushEvent(contractAddrs, rs.TxHash.ToHexString(), rs.Error, rs.Action, notify)
89 default:
90 }
91 }()
92}
93
94func pushEvent(contractAddrs map[string]bool, txHash string, errcode int64, action string, result interface{}) {
95 if ws != nil {

Callers

nothing calls this directly

Calls 3

ErrorfFunction · 0.92
pushEventFunction · 0.70
ToHexStringMethod · 0.45

Tested by

no test coverage detected