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

     1  package bc
     2  
     3  import "io"
     4  
     5  func (Coinbase) typ() string { return "coinbase1" }
     6  func (c *Coinbase) writeForHash(w io.Writer) {
     7  	mustWriteForHash(w, c.Arbitrary)
     8  }
     9  
    10  // SetDestination is support function for map tx
    11  func (c *Coinbase) SetDestination(id *Hash, val *AssetAmount, pos uint64) {
    12  	c.WitnessDestination = &ValueDestination{
    13  		Ref:      id,
    14  		Value:    val,
    15  		Position: pos,
    16  	}
    17  }
    18  
    19  // NewCoinbase creates a new Coinbase.
    20  func NewCoinbase(arbitrary []byte) *Coinbase {
    21  	return &Coinbase{Arbitrary: arbitrary}
    22  }