4 "github.com/vapor/protocol/bc"
7 // CrossChainInput satisfies the TypedInput interface and represents a cross-chain transaction.
8 type CrossChainInput struct {
9 SpendCommitmentSuffix []byte // The unconsumed suffix of the spend commitment
10 Arguments [][]byte // Witness
14 AssetDefinition []byte
15 IssuanceProgram []byte
18 // NewCrossChainInput create a new CrossChainInput struct.
19 // The source is created/issued by trusted federation and hence there is no need
21 func NewCrossChainInput(arguments [][]byte, sourceID bc.Hash, assetID bc.AssetID, amount, sourcePos, vmVersion uint64, assetDefinition, issuanceProgram []byte) *TxInput {
22 sc := SpendCommitment{
23 AssetAmount: bc.AssetAmount{
28 SourcePosition: sourcePos,
33 TypedInput: &CrossChainInput{
37 AssetDefinition: assetDefinition,
38 IssuanceProgram: issuanceProgram,
43 // InputType is the interface function for return the input type.
44 func (si *CrossChainInput) InputType() uint8 { return CrossChainInputType }