OSDN Git Service

Merge pull request #201 from Bytom/v0.1
[bytom/vapor.git] / vendor / github.com / bytom / protocol / bc / retirement.go
diff --git a/vendor/github.com/bytom/protocol/bc/retirement.go b/vendor/github.com/bytom/protocol/bc/retirement.go
new file mode 100644 (file)
index 0000000..de1e827
--- /dev/null
@@ -0,0 +1,20 @@
+package bc
+
+import "io"
+
+// Retirement is for the permanent removal of some value from a
+// blockchain. The value it contains can never be obtained by later
+// entries. Retirement satisfies the Entry interface.
+
+func (Retirement) typ() string { return "retirement1" }
+func (r *Retirement) writeForHash(w io.Writer) {
+       mustWriteForHash(w, r.Source)
+}
+
+// NewRetirement creates a new Retirement.
+func NewRetirement(source *ValueSource, ordinal uint64) *Retirement {
+       return &Retirement{
+               Source:  source,
+               Ordinal: ordinal,
+       }
+}