X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;ds=sidebyside;f=claim%2Fbytom%2Fprotocolbc%2Ftypes%2Fspend.go;fp=claim%2Fbytom%2Fprotocolbc%2Ftypes%2Fspend.go;h=0000000000000000000000000000000000000000;hb=54373c1a3efe0e373ec1605840a4363e4b246c46;hp=8642d35a925965d3a6bdb4b2f7a16cc1413c9778;hpb=ee01d543fdfe1fd0a4d548965c66f7923ea7b062;p=bytom%2Fvapor.git diff --git a/claim/bytom/protocolbc/types/spend.go b/claim/bytom/protocolbc/types/spend.go deleted file mode 100644 index 8642d35a..00000000 --- a/claim/bytom/protocolbc/types/spend.go +++ /dev/null @@ -1,36 +0,0 @@ -package types - -import ( - "github.com/vapor/protocol/bc" -) - -// SpendInput satisfies the TypedInput interface and represents a spend transaction. -type SpendInput struct { - SpendCommitmentSuffix []byte // The unconsumed suffix of the output commitment - Arguments [][]byte // Witness - SpendCommitment -} - -// NewSpendInput create a new SpendInput struct. -func NewSpendInput(arguments [][]byte, sourceID bc.Hash, assetID bc.AssetID, amount, sourcePos uint64, controlProgram []byte) *TxInput { - sc := SpendCommitment{ - AssetAmount: bc.AssetAmount{ - AssetId: &assetID, - Amount: amount, - }, - SourceID: sourceID, - SourcePosition: sourcePos, - VMVersion: 1, - ControlProgram: controlProgram, - } - return &TxInput{ - AssetVersion: 1, - TypedInput: &SpendInput{ - SpendCommitment: sc, - Arguments: arguments, - }, - } -} - -// InputType is the interface function for return the input type. -func (si *SpendInput) InputType() uint8 { return SpendInputType }