"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 (
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,
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 {
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
-}