OSDN Git Service

feat: add processIssuing (#152)
[bytom/vapor.git] / vendor / github.com / bytom / protocol / bc / output.go
diff --git a/vendor/github.com/bytom/protocol/bc/output.go b/vendor/github.com/bytom/protocol/bc/output.go
new file mode 100644 (file)
index 0000000..3a29178
--- /dev/null
@@ -0,0 +1,24 @@
+package bc
+
+import "io"
+
+// Output is the result of a transfer of value. The value it contains
+// may be accessed by a later Spend entry (if that entry can satisfy
+// the Output's ControlProgram). Output satisfies the Entry interface.
+//
+// (Not to be confused with the deprecated type TxOutput.)
+
+func (Output) typ() string { return "output1" }
+func (o *Output) writeForHash(w io.Writer) {
+       mustWriteForHash(w, o.Source)
+       mustWriteForHash(w, o.ControlProgram)
+}
+
+// NewOutput creates a new Output.
+func NewOutput(source *ValueSource, controlProgram *Program, ordinal uint64) *Output {
+       return &Output{
+               Source:         source,
+               ControlProgram: controlProgram,
+               Ordinal:        ordinal,
+       }
+}