5 // Spend accesses the value in a prior Output for transfer
6 // elsewhere. It satisfies the Entry interface.
8 // (Not to be confused with the deprecated type SpendInput.)
10 func (Spend) typ() string { return "spend1" }
11 func (s *Spend) writeForHash(w io.Writer) {
12 mustWriteForHash(w, s.SpentOutputId)
13 mustWriteForHash(w, s.Data)
14 mustWriteForHash(w, s.ExtHash)
17 func (s *Spend) SetDestination(id *Hash, val *AssetAmount, pos uint64) {
18 s.WitnessDestination = &ValueDestination{
25 // NewSpend creates a new Spend.
26 func NewSpend(spentOutputID *Hash, data *Hash, ordinal uint64) *Spend {
28 SpentOutputId: spentOutputID,
34 func (s *Spend) SetAnchored(id *Hash) {
35 s.WitnessAnchoredId = id