diff options
author | Aaron Buchwald <[email protected]> | 2020-09-23 02:03:43 -0400 |
---|---|---|
committer | Aaron Buchwald <[email protected]> | 2020-09-23 02:03:43 -0400 |
commit | febbf65d34101980d159a1f47b65848183082db8 (patch) | |
tree | 8988aee967d72035eab570b69cb1fead9dc9f711 | |
parent | 6cc9d3c61ee803f37cbc6e65799797c0dc51e9e5 (diff) |
Improve error messages
-rw-r--r-- | plugin/evm/import_tx.go | 2 | ||||
-rw-r--r-- | plugin/evm/vm.go | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/plugin/evm/import_tx.go b/plugin/evm/import_tx.go index 4d7f219..2b8882f 100644 --- a/plugin/evm/import_tx.go +++ b/plugin/evm/import_tx.go @@ -64,6 +64,8 @@ func (tx *UnsignedImportTx) Verify( return errWrongChainID case len(tx.ImportedInputs) == 0: return errNoImportInputs + case len(tx.Outs) == 0: + return errNoImportOutputs case tx.NetworkID != ctx.NetworkID: return errWrongNetworkID case !ctx.ChainID.Equals(tx.BlockchainID): diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go index 64ae42e..3ae3b12 100644 --- a/plugin/evm/vm.go +++ b/plugin/evm/vm.go @@ -107,10 +107,11 @@ var ( errNoFunds = errors.New("no spendable funds were found") errWrongChainID = errors.New("tx has wrong chain ID") errInsufficientFunds = errors.New("insufficient funds") - errNoExportOutputs = errors.New("no export outputs") - errExportOutputsNotSortedAndUnique = errors.New("export outputs are not sorted and unique") - errOutputsNotSorted = errors.New("outputs not sorted") - errNoExportInputs = errors.New("no inputs to export") + errNoExportOutputs = errors.New("tx has no export outputs") + errExportOutputsNotSortedAndUnique = errors.New("tx export outputs are not sorted and unique") + errOutputsNotSorted = errors.New("tx outputs not sorted") + errNoImportOutputs = errors.New("tx has no outputs to import") + errNoExportInputs = errors.New("tx has no inputs to export") errInputsNotSortedAndUnique = errors.New("inputs not sorted and unique") errOverflowExport = errors.New("overflow when computing export amount + txFee") errInvalidNonce = errors.New("invalid nonce") |