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

Method Scan

protocol/bc/block.go:108–116  ·  view source on GitHub ↗

Scan fulfills the sql.Scanner interface.

(val interface{})

Source from the content-addressed store, hash-verified

106
107// Scan fulfills the sql.Scanner interface.
108func (b *Block) Scan(val interface{}) error {
109 driverBuf, ok := val.([]byte)
110 if !ok {
111 return errors.New("Scan must receive a byte slice")
112 }
113 buf := make([]byte, len(driverBuf))
114 copy(buf[:], driverBuf)
115 return b.FromBytes(buf)
116}
117
118// Value fulfills the sql.driver.Valuer interface.
119func (b *Block) Value() (driver.Value, error) {

Callers

nothing calls this directly

Calls 2

FromBytesMethod · 0.95
NewFunction · 0.92

Tested by

no test coverage detected