OSDN Git Service

add cancel vote (#172)
[bytom/vapor.git] / protocol / bc / veto_input.go
1 package bc
2
3 import "io"
4
5 func (VetoInput) typ() string { return "vetoInput1" }
6 func (s *VetoInput) writeForHash(w io.Writer) {
7         mustWriteForHash(w, s.SpentOutputId)
8 }
9
10 // SetDestination will link the spend to the output
11 func (s *VetoInput) SetDestination(id *Hash, val *AssetAmount, pos uint64) {
12         s.WitnessDestination = &ValueDestination{
13                 Ref:      id,
14                 Value:    val,
15                 Position: pos,
16         }
17 }
18
19 // NewVetoInput creates a new VetoInput.
20 func NewVetoInput(spentOutputID *Hash, ordinal uint64) *VetoInput {
21         return &VetoInput{
22                 SpentOutputId: spentOutputID,
23                 Ordinal:       ordinal,
24         }
25 }