OSDN Git Service

rename (#465)
[bytom/vapor.git] / blockchain / txbuilder / finalize.go
index 270bb3b..3a6ef25 100644 (file)
@@ -4,13 +4,13 @@ import (
        "bytes"
        "context"
 
-       "github.com/vapor/common/arithmetic"
-       cfg "github.com/vapor/config"
-       "github.com/vapor/errors"
-       "github.com/vapor/math/checked"
-       "github.com/vapor/protocol"
-       "github.com/vapor/protocol/bc/types"
-       "github.com/vapor/protocol/vm"
+       "github.com/bytom/vapor/common/arithmetic"
+       cfg "github.com/bytom/vapor/config"
+       "github.com/bytom/vapor/errors"
+       "github.com/bytom/vapor/math/checked"
+       "github.com/bytom/vapor/protocol"
+       "github.com/bytom/vapor/protocol/bc/types"
+       "github.com/bytom/vapor/protocol/vm"
 )
 
 var (
@@ -24,8 +24,6 @@ var (
        ErrOrphanTx = errors.New("finalize can't find transaction input utxo")
        // ErrExtTxFee means transaction fee exceed max limit
        ErrExtTxFee = errors.New("transaction fee exceed max limit")
-       // ErrNoGasInput means transaction has no gas input
-       ErrNoGasInput = errors.New("transaction has no gas input")
 )
 
 // FinalizeTx validates a transaction signature template,
@@ -42,10 +40,6 @@ func FinalizeTx(ctx context.Context, c *protocol.Chain, tx *types.Tx) error {
                return err
        }
 
-       if err := checkGasInputIDs(tx); err != nil {
-               return err
-       }
-
        // This part is use for prevent tx size  is 0
        data, err := tx.TxData.MarshalText()
        if err != nil {
@@ -131,17 +125,3 @@ func checkTxSighashCommitment(tx *types.Tx) error {
 
        return lastError
 }
-
-func checkGasInputIDs(tx *types.Tx) error {
-       for _, inp := range tx.Inputs {
-               switch inp.InputType() {
-               case types.CrossChainInputType:
-                       return nil
-               }
-       }
-
-       if len(tx.GasInputIDs) == 0 {
-               return ErrNoGasInput
-       }
-       return nil
-}