MCPcopy Create free account
hub / github.com/chain/Core / mustWriteForHash

Function mustWriteForHash

protocol/bc/entry.go:74–79  ·  view source on GitHub ↗

mustWriteForHash serializes the object c to the writer w, from which presumably a hash can be extracted. This function may panic with an error from the underlying writer, and may produce errors of its own if passed objects whose hash-serialization formats are not specified. It MUST NOT produce erro

(w io.Writer, c interface{})

Source from the content-addressed store, hash-verified

72// hash-serialization formats are not specified. It MUST NOT produce
73// errors in other cases.
74func mustWriteForHash(w io.Writer, c interface{}) {
75 err := writeForHash(w, c)
76 if err != nil {
77 panic(err)
78 }
79}
80
81func writeForHash(w io.Writer, c interface{}) error {
82 switch v := c.(type) {

Callers 9

writeForHashMethod · 0.85
writeForHashMethod · 0.85
writeForHashMethod · 0.85
writeForHashMethod · 0.85
writeForHashMethod · 0.85
writeForHashMethod · 0.85
writeForHashMethod · 0.85
writeForHashMethod · 0.85
writeForHashMethod · 0.85

Calls 1

writeForHashFunction · 0.85

Tested by

no test coverage detected