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

     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  }