MCPcopy Create free account
hub / github.com/33cn/chain33 / NewMessage

Function NewMessage

queue/queue.go:312–320  ·  view source on GitHub ↗

NewMessage new message

(id int64, topic string, ty int64, data interface{})

Source from the content-addressed store, hash-verified

310
311// NewMessage new message
312func NewMessage(id int64, topic string, ty int64, data interface{}) (msg *Message) {
313 msg = &Message{}
314 msg.ID = id
315 msg.Ty = ty
316 msg.Data = data
317 msg.Topic = topic
318 msg.chReply = make(chan *Message, 1)
319 return msg
320}
321
322// NewMessageCallback reply block
323func NewMessageCallback(id int64, topic string, ty int64, data interface{}, callback func(msg *Message)) (msg *Message) {

Callers 15

TestExecutorErrAPIEnvFunction · 0.92
testProcMainSeqMsgFunction · 0.92
TestFinalizerFunction · 0.92
resetEngineMethod · 0.92
resetMethod · 0.92
consensusMsgFunction · 0.92
testBlockReqFunction · 0.92
testMempoolReqFunction · 0.92
initMockBlockchainFunction · 0.92
Test_broadcastMsgFunction · 0.92
TestSnowmanFunction · 0.92
NewMessageMethod · 0.92

Calls

no outgoing calls

Tested by 12

TestExecutorErrAPIEnvFunction · 0.74
testProcMainSeqMsgFunction · 0.74
TestFinalizerFunction · 0.74
testBlockReqFunction · 0.74
testMempoolReqFunction · 0.74
initMockBlockchainFunction · 0.74
Test_broadcastMsgFunction · 0.74
TestSnowmanFunction · 0.74
NewMessageMethod · 0.74
TestMessage_ReplyErrFunction · 0.56
BenchmarkChanSub2Function · 0.56
BenchmarkChanSub3Function · 0.56