WriteWitnessCommitmentTo writes the "Transaction Witness Commitment" to w, consisting of the version, runlimit, and program in a tuple, encoded according to standard txvm convention, hashed together with the txid. The only errors returned are those from w.
(w io.Writer)
| 258 | // |
| 259 | // The only errors returned are those from w. |
| 260 | func (tx *Tx) WriteWitnessCommitmentTo(w io.Writer) (int, error) { |
| 261 | // See $I10R/docs/future/protocol/specifications/blockchain.md#transaction-witness-commitment |
| 262 | // for the definition of the transaction witness commitment. |
| 263 | n, err := tx.ID.WriteTo(w) |
| 264 | if err != nil { |
| 265 | return int(n), err |
| 266 | } |
| 267 | n2, err := tx.writeWitnessHashTo(w) |
| 268 | if err != nil { |
| 269 | return int(n) + n2, err |
| 270 | } |
| 271 | return int(n) + n2, nil |
| 272 | } |
| 273 | |
| 274 | // The only errors returned are those from w. |
| 275 | func (tx *Tx) writeWitnessHashTo(w io.Writer) (int, error) { |