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

Method Materialize

protocol/txbuilder/template.go:416–424  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

414// transaction is not finalized or because of an error,
415// the last return value will be a non-nil error.
416func (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,

Callers 1

SignMethod · 0.95

Calls 1

materializeTxMethod · 0.95

Tested by

no test coverage detected