(id Hash)
| 59 | } |
| 60 | |
| 61 | func (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 | |
| 73 | func (tx *Tx) Issuance(id Hash) (*Issuance, error) { |
| 74 | e, ok := tx.Entries[id] |