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

Method Scan

protocol/bc/hash.go:92–101  ·  view source on GitHub ↗

Scan satisfies the driver.Scanner interface

(v interface{})

Source from the content-addressed store, hash-verified

90
91// Scan satisfies the driver.Scanner interface
92func (h *Hash) Scan(v interface{}) error {
93 var buf [32]byte
94 b, ok := v.([]byte)
95 if !ok {
96 return fmt.Errorf("Hash.Scan received unsupported type %T", v)
97 }
98 copy(buf[:], b)
99 *h = NewHash(buf)
100 return nil
101}
102
103// WriteTo satisfies the io.WriterTo interface.
104func (h Hash) WriteTo(w io.Writer) (int64, error) {

Callers 1

AssembleFunction · 0.45

Calls 1

NewHashFunction · 0.85

Tested by

no test coverage detected