MCPcopy Create free account
hub / github.com/chain/txvm / AddOutput

Method AddOutput

protocol/txbuilder/template.go:266–279  ·  view source on GitHub ↗

AddOutput adds an Output to the template.

(quorum int, pubkeys []ed25519.PublicKey, amount int64, assetID bc.Hash, refData, tags []byte)

Source from the content-addressed store, hash-verified

264
265// AddOutput adds an Output to the template.
266func (tpl *Template) AddOutput(quorum int, pubkeys []ed25519.PublicKey, amount int64, assetID bc.Hash, refData, tags []byte) *Output {
267 out := &Output{
268 Quorum: quorum,
269 Pubkeys: pubkeys,
270 Amount: amount,
271 AssetID: assetID,
272 Refdata: i10rjson.HexBytes(refData),
273 TokenTags: i10rjson.HexBytes(tags),
274 Index: tpl.index,
275 }
276 tpl.index++
277 tpl.Outputs = append(tpl.Outputs, out)
278 return out
279}
280
281// AddRetirement adds a Retirement to the template.
282func (tpl *Template) AddRetirement(amount int64, assetID bc.Hash, refData []byte) *Retirement {

Callers 6

TestTxBuilderFunction · 0.95
TestResultsFunction · 0.95
TestSigBitsFunction · 0.95
TestMultisigFunction · 0.95
mainFunction · 0.95
TestResultFunction · 0.80

Calls

no outgoing calls

Tested by 5

TestTxBuilderFunction · 0.76
TestResultsFunction · 0.76
TestSigBitsFunction · 0.76
TestMultisigFunction · 0.76
TestResultFunction · 0.64