Tuple executes fn, passing in a TupleBuilder that exposes pushdata operations. All operations performed on the TupleBuilder during fn are shadowed to b. When fn completes, Tuple writes to b instructions to construct a tuple of the pushed data.
(fn func(*TupleBuilder))
| 79 | // When fn completes, Tuple writes to b instructions to |
| 80 | // construct a tuple of the pushed data. |
| 81 | func (b *Builder) Tuple(fn func(*TupleBuilder)) *Builder { |
| 82 | tb := TupleBuilder{b: b} |
| 83 | fn(&tb) |
| 84 | b.PushdataInt64(tb.count) |
| 85 | b.Op(op.Tuple) |
| 86 | return b |
| 87 | } |
| 88 | |
| 89 | // TupleBuilder wraps a Builder, exposing only pushdata |
| 90 | // operations. |