From febbf65d34101980d159a1f47b65848183082db8 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 23 Sep 2020 02:03:43 -0400 Subject: Improve error messages --- plugin/evm/import_tx.go | 2 ++ plugin/evm/vm.go | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'plugin') 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") -- cgit v1.2.3-70-g09d2