Materialize returns the transaction's program and ID. If the transaction ID cannot be computed because the transaction is not finalized or because of an error, the last return value will be a non-nil error.
()
| 414 | // transaction is not finalized or because of an error, |
| 415 | // the last return value will be a non-nil error. |
| 416 | func (tpl *Template) Materialize() (txid bc.Hash, prog []byte, err error) { |
| 417 | if tpl.materialization == nil { |
| 418 | tpl.materialization, err = tpl.materializeTx() |
| 419 | if err != nil { |
| 420 | return txid, prog, err |
| 421 | } |
| 422 | } |
| 423 | return tpl.materialization.tx.ID, tpl.materialization.tx.Program, nil |
| 424 | } |
| 425 | |
| 426 | // Dematerialize clears any previous materialization. |
| 427 | // This is helpful when a change to the template has been made, |