4 "github.com/vapor/protocol/bc"
7 // CrossChainInput satisfies the TypedInput interface and represents a cross-chain transaction.
8 type CrossChainInput struct {
10 SpendCommitmentSuffix []byte // The unconsumed suffix of the spend commitment
11 Arguments [][]byte // Witness
15 // NewCrossChainInput create a new CrossChainInput struct.
16 // The source is created/issued by trusted federation and hence there is no need
18 func NewCrossChainInput(arguments [][]byte, sourceID bc.Hash, assetID bc.AssetID, amount, sourcePos uint64, controlProgram, assetDefinition []byte) *TxInput {
19 sc := SpendCommitment{
20 AssetAmount: bc.AssetAmount{
25 SourcePosition: sourcePos,
27 ControlProgram: controlProgram,
31 TypedInput: &CrossChainInput{
32 AssetDefinition: assetDefinition,
39 // InputType is the interface function for return the input type.
40 func (si *CrossChainInput) InputType() uint8 { return CrossChainInputType }