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

Method WriteTo

protocol/bc/legacy/transaction.go:206–213  ·  view source on GitHub ↗

WriteTo writes tx to w.

(w io.Writer)

Source from the content-addressed store, hash-verified

204
205// WriteTo writes tx to w.
206func (tx *TxData) WriteTo(w io.Writer) (int64, error) {
207 ew := errors.NewWriter(w)
208 err := tx.writeTo(ew, serRequired)
209 if err != nil {
210 return ew.Written(), ew.Err()
211 }
212 return ew.Written(), ew.Err()
213}
214
215func (tx *TxData) writeTo(w io.Writer, serflags byte) error {
216 _, err := w.Write([]byte{serflags})

Callers 1

MarshalTextMethod · 0.95

Calls 3

writeToMethod · 0.95
WrittenMethod · 0.95
ErrMethod · 0.95

Tested by

no test coverage detected