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

Method AddIssuance

protocol/txbuilder/template.go:224–241  ·  view source on GitHub ↗

AddIssuance adds an Issuance to the template.

(version int, blockchainID []byte, assetTag []byte, quorum int, keyHashes [][]byte, path [][]byte, pubkeys []ed25519.PublicKey, amount int64, refData, nonce []byte)

Source from the content-addressed store, hash-verified

222
223// AddIssuance adds an Issuance to the template.
224func (tpl *Template) AddIssuance(version int, blockchainID []byte, assetTag []byte, quorum int, keyHashes [][]byte, path [][]byte, pubkeys []ed25519.PublicKey, amount int64, refData, nonce []byte) *Issuance {
225 iss := &Issuance{
226 Version: version,
227 BlockchainID: blockchainID,
228 Quorum: quorum,
229 KeyHashes: asHexBytes(keyHashes),
230 Path: asHexBytes(path),
231 Pubkeys: pubkeys,
232 Amount: amount,
233 AssetTag: assetTag,
234 Refdata: i10rjson.HexBytes(refData),
235 Nonce: nonce,
236 Index: tpl.index,
237 }
238 tpl.index++
239 tpl.Issuances = append(tpl.Issuances, iss)
240 return iss
241}
242
243// AddInput adds an Input to the template.
244func (tpl *Template) AddInput(quorum int, keyHashes [][]byte, path [][]byte, pubkeys []ed25519.PublicKey, amount int64, assetID bc.Hash, anchor, inputRefdata []byte, version int) *Input {

Callers 5

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

Calls 1

asHexBytesFunction · 0.85

Tested by 4

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