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

Method Scan

protocol/bc/blockheader.go:63–71  ·  view source on GitHub ↗

Scan satisfies the database.sql.Scanner interface.

(val interface{})

Source from the content-addressed store, hash-verified

61
62// Scan satisfies the database.sql.Scanner interface.
63func (bh *BlockHeader) Scan(val interface{}) error {
64 driverBuf, ok := val.([]byte)
65 if !ok {
66 return errors.New("Scan must receive a byte slice")
67 }
68 buf := make([]byte, len(driverBuf))
69 copy(buf, driverBuf)
70 return proto.Unmarshal(buf, bh)
71}
72
73// Value satisfies the Valuer interface from database/sql/driver.
74func (bh *BlockHeader) Value() (driver.Value, error) {

Callers

nothing calls this directly

Calls 1

NewFunction · 0.92

Tested by

no test coverage detected