4 "github.com/vapor/protocol/bc/types/bytom"
7 // SpendInput satisfies the TypedInput interface and represents a spend transaction.
8 type SpendInput struct {
9 SpendCommitmentSuffix []byte // The unconsumed suffix of the output commitment
10 Arguments [][]byte // Witness
14 // NewSpendInput create a new SpendInput struct.
15 func NewSpendInput(arguments [][]byte, sourceID bytom.Hash, assetID bytom.AssetID, amount, sourcePos uint64, controlProgram []byte) *TxInput {
16 sc := SpendCommitment{
17 AssetAmount: bytom.AssetAmount{
22 SourcePosition: sourcePos,
24 ControlProgram: controlProgram,
28 TypedInput: &SpendInput{
35 // InputType is the interface function for return the input type.
36 func (si *SpendInput) InputType() uint8 { return SpendInputType }