MCPcopy
hub / github.com/canopy-network/canopy / ethDataToMsg

Function ethDataToMsg

fsm/ethereum.go:170–183  ·  view source on GitHub ↗

ethDataToMsg() converts the ethereum tx data (message proto bytes) to a message

(messageType string, transaction *lib.Transaction, msg lib.MessageI, data []byte, callback func())

Source from the content-addressed store, hash-verified

168
169// ethDataToMsg() converts the ethereum tx data (message proto bytes) to a message
170func ethDataToMsg(messageType string, transaction *lib.Transaction, msg lib.MessageI, data []byte, callback func()) (lib.MessageI, lib.ErrorI) {
171 // set the message type
172 transaction.MessageType = messageType
173 // convert the data after the selector to a message
174 if err := lib.Unmarshal(data[4:], msg); err != nil {
175 return nil, err
176 }
177 // execute the callback
178 if callback != nil {
179 callback()
180 }
181 // sanity check the message
182 return msg, msg.Check()
183}
184
185// VerifyRLPBytes() implements special 'signature verification logic' that allows a MessageSend to be authenticated using a signed RLP transaction
186func (s *StateMachine) VerifyRLPBytes(tx *lib.Transaction) lib.ErrorI {

Callers 1

rlpToMessageFunction · 0.85

Calls 2

UnmarshalFunction · 0.92
CheckMethod · 0.65

Tested by

no test coverage detected