OSDN Git Service

Merge pull request #201 from Bytom/v0.1
[bytom/vapor.git] / claim / bytom / protocolbc / types / spend.go
diff --git a/claim/bytom/protocolbc/types/spend.go b/claim/bytom/protocolbc/types/spend.go
deleted file mode 100644 (file)
index 8642d35..0000000
+++ /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 }