MCPcopy Create free account
hub / github.com/chain/Core / Build

Method Build

core/txbuilder/actions.go:64–78  ·  view source on GitHub ↗
(ctx context.Context, b *TemplateBuilder)

Source from the content-addressed store, hash-verified

62}
63
64func (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
80func DecodeSetTxRefDataAction(data []byte) (Action, error) {
81 a := new(setTxRefDataAction)

Callers

nothing calls this directly

Calls 3

MissingFieldsErrorFunction · 0.85
AddOutputMethod · 0.80
IsZeroMethod · 0.45

Tested by

no test coverage detected