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
-}