timeRange uint64
rollbacks []func()
callbacks []func() error
- referenceData []byte
}
// AddInput add inputs of transactions
// AddOutput add outputs of transactions
func (b *TemplateBuilder) AddOutput(o *types.TxOutput) error {
- if o.Amount > math.MaxInt64 {
- return errors.WithDetailf(ErrBadAmount, "amount %d exceeds maximum value 2^63", o.Amount)
+ if o.AssetAmount().Amount > math.MaxInt64 {
+ return errors.WithDetailf(ErrBadAmount, "amount %d exceeds maximum value 2^63", o.AssetAmount().Amount)
}
b.outputs = append(b.outputs, o)
return nil
}
-func (b *TemplateBuilder) SetReferenceData(referenceData []byte) {
- b.referenceData = referenceData
-}
-
// InputCount return number of input in the template builder
func (b *TemplateBuilder) InputCount() int {
return len(b.inputs)
tx.Inputs = append(tx.Inputs, in)
}
- tx.ReferenceData = b.referenceData
-
tpl.Transaction = types.NewTx(*tx)
tpl.Fee = CalculateTxFee(tpl.Transaction)
return tpl, tx, nil