5 // crosschaininput is the result of a transfer of value. The value it contains
6 // comes from the main chain. It satisfies the Entry interface.
8 func (CrossChainInput) typ() string { return "crosschaininput1" }
10 func (cci *CrossChainInput) writeForHash(w io.Writer) {
11 mustWriteForHash(w, cci.MainchainOutputId)
12 mustWriteForHash(w, cci.AssetDefinition)
15 // SetDestination will link the CrossChainInput to the output
16 func (cci *CrossChainInput) SetDestination(id *Hash, val *AssetAmount, pos uint64) {
17 cci.WitnessDestination = &ValueDestination{
24 // NewCrossChainInput creates a new CrossChainInput.
25 func NewCrossChainInput(mainchainOutputID *Hash, prog *Program, ordinal uint64, assetDef *AssetDefinition, rawDefinitionByte []byte) *CrossChainInput {
26 return &CrossChainInput{
27 MainchainOutputId: mainchainOutputID,
30 AssetDefinition: assetDef,
31 RawDefinitionByte: rawDefinitionByte,