(id Hash)
| 35 | ) |
| 36 | |
| 37 | func (tx *Tx) TimeRange(id Hash) (*TimeRange, error) { |
| 38 | e, ok := tx.Entries[id] |
| 39 | if !ok || e == nil { |
| 40 | return nil, errors.Wrapf(ErrMissingEntry, "id %x", id.Bytes()) |
| 41 | } |
| 42 | tr, ok := e.(*TimeRange) |
| 43 | if !ok { |
| 44 | return nil, errors.Wrapf(ErrEntryType, "entry %x has unexpected type %T", id.Bytes(), e) |
| 45 | } |
| 46 | return tr, nil |
| 47 | } |
| 48 | |
| 49 | func (tx *Tx) Output(id Hash) (*Output, error) { |
| 50 | e, ok := tx.Entries[id] |
no test coverage detected