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

Method writeWitnessHashTo

protocol/bc/tx.go:275–286  ·  view source on GitHub ↗

The only errors returned are those from w.

(w io.Writer)

Source from the content-addressed store, hash-verified

273
274// The only errors returned are those from w.
275func (tx *Tx) writeWitnessHashTo(w io.Writer) (int, error) {
276 // See $I10R/docs/future/protocol/specifications/txvm.md#transaction-witness
277 // for the definition of the transaction witness and
278 // $I10R/docs/future/protocol/specifications/blockchain.md#transaction-witness-commitment
279 // for the definition of the transaction witness commitment.
280 h := txvm.VMHash("WitnessHash", txvm.Encode(txvm.Tuple{
281 txvm.Int(tx.Version),
282 txvm.Int(tx.Runlimit),
283 txvm.Bytes(tx.Program),
284 }))
285 return w.Write(h[:])
286}

Callers 1

Calls 5

VMHashFunction · 0.92
EncodeFunction · 0.92
IntTypeAlias · 0.92
BytesTypeAlias · 0.92
WriteMethod · 0.45

Tested by

no test coverage detected