github.com/bytom/bytom@v1.1.2-0.20221014091027-bbcba3df6075/protocol/bc/original_output.go (about)

     1  package bc
     2  
     3  import "io"
     4  
     5  // OriginalOutput is the result of a transfer of value. The value it contains
     6  // may be accessed by a later Spend entry (if that entry can satisfy
     7  // the Output's ControlProgram). OriginalOutput satisfies the Entry interface.
     8  
     9  func (OriginalOutput) typ() string { return "originalOutput1" }
    10  func (o *OriginalOutput) writeForHash(w io.Writer) {
    11  	mustWriteForHash(w, o.Source)
    12  	mustWriteForHash(w, o.ControlProgram)
    13  	mustWriteForHash(w, o.StateData)
    14  }
    15  
    16  // NewOriginalOutput creates a new OriginalOutput.
    17  func NewOriginalOutput(source *ValueSource, controlProgram *Program, stateData [][]byte, ordinal uint64) *OriginalOutput {
    18  	return &OriginalOutput{
    19  		Source:         source,
    20  		ControlProgram: controlProgram,
    21  		Ordinal:        ordinal,
    22  		StateData:      stateData,
    23  	}
    24  }