MCPcopy Create free account
hub / github.com/chain/Core / Spend

Method Spend

protocol/bc/tx.go:61–71  ·  view source on GitHub ↗
(id Hash)

Source from the content-addressed store, hash-verified

59}
60
61func (tx *Tx) Spend(id Hash) (*Spend, error) {
62 e, ok := tx.Entries[id]
63 if !ok || e == nil {
64 return nil, errors.Wrapf(ErrMissingEntry, "id %x", id.Bytes())
65 }
66 sp, ok := e.(*Spend)
67 if !ok {
68 return nil, errors.Wrapf(ErrEntryType, "entry %x has unexpected type %T", id.Bytes(), e)
69 }
70 return sp, nil
71}
72
73func (tx *Tx) Issuance(id Hash) (*Issuance, error) {
74 e, ok := tx.Entries[id]

Callers 5

txSpendFunction · 0.80
buildSigProgramFunction · 0.80
TestInferConstraintsFunction · 0.80
prevoutDBKeysFunction · 0.80

Calls 1

BytesMethod · 0.45

Tested by 2

txSpendFunction · 0.64
TestInferConstraintsFunction · 0.64