(ctx context.Context, b *TemplateBuilder)
| 62 | } |
| 63 | |
| 64 | func (a *controlProgramAction) Build(ctx context.Context, b *TemplateBuilder) error { |
| 65 | var missing []string |
| 66 | if len(a.Program) == 0 { |
| 67 | missing = append(missing, "control_program") |
| 68 | } |
| 69 | if a.AssetId.IsZero() { |
| 70 | missing = append(missing, "asset_id") |
| 71 | } |
| 72 | if len(missing) > 0 { |
| 73 | return MissingFieldsError(missing...) |
| 74 | } |
| 75 | |
| 76 | out := legacy.NewTxOutput(*a.AssetId, a.Amount, a.Program, a.ReferenceData) |
| 77 | return b.AddOutput(out) |
| 78 | } |
| 79 | |
| 80 | func DecodeSetTxRefDataAction(data []byte) (Action, error) { |
| 81 | a := new(setTxRefDataAction) |
nothing calls this directly
no test coverage detected