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

Function SignMsg

consensus/vbft/utils.go:46–54  ·  view source on GitHub ↗
(account *account.Account, msg ConsensusMsg)

Source from the content-addressed store, hash-verified

44)
45
46func SignMsg(account *account.Account, msg ConsensusMsg) ([]byte, error) {
47
48 data, err := msg.Serialize()
49 if err != nil {
50 return nil, fmt.Errorf("failed to marshal msg when signing: %s", err)
51 }
52
53 return signature.Sign(account, data)
54}
55
56func hashData(data []byte) common.Uint256 {
57 t := sha256.Sum256(data)

Callers 1

TestSignMsgFunction · 0.85

Calls 3

SignFunction · 0.92
ErrorfMethod · 0.80
SerializeMethod · 0.65

Tested by 1

TestSignMsgFunction · 0.68