From affb9c79b05ce6610c4b397fc6998df23cf599bd Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Wed, 23 Sep 2020 15:41:05 -0400 Subject: remove requirement for evm inputs and outputs to be sorted and unique --- plugin/evm/export_tx.go | 3 --- plugin/evm/export_tx_test.go | 15 --------------- plugin/evm/import_tx.go | 3 --- 3 files changed, 21 deletions(-) (limited to 'plugin/evm') diff --git a/plugin/evm/export_tx.go b/plugin/evm/export_tx.go index b76e312..5a8494a 100644 --- a/plugin/evm/export_tx.go +++ b/plugin/evm/export_tx.go @@ -71,9 +71,6 @@ func (tx *UnsignedExportTx) Verify( return err } } - if !IsSortedAndUniqueEVMInputs(tx.Ins) { - return errInputsNotSortedAndUnique - } for _, out := range tx.ExportedOutputs { if err := out.Verify(); err != nil { diff --git a/plugin/evm/export_tx_test.go b/plugin/evm/export_tx_test.go index 2af123f..b17f719 100644 --- a/plugin/evm/export_tx_test.go +++ b/plugin/evm/export_tx_test.go @@ -121,24 +121,9 @@ func TestExportTxVerify(t *testing.T) { exportTx.syntacticallyVerified = false exportTx.ExportedOutputs = exportedOuts - inputs := exportTx.Ins exportTx.Ins = nil // Test No Exported Outputs Errors if err := exportTx.Verify(testXChainID, ctx, testTxFee, testAvaxAssetID); err == nil { t.Fatal("ExportTx should have failed verification due to no inputs") } - - exportTx.syntacticallyVerified = false - exportTx.Ins = []EVMInput{inputs[1], inputs[0]} - // Test unsorted EVM Inputs Errors - if err := exportTx.Verify(testXChainID, ctx, testTxFee, testAvaxAssetID); err == nil { - t.Fatal("ExportTx should have failed verification due to unsorted inputs") - } - - exportTx.syntacticallyVerified = false - exportTx.Ins = []EVMInput{inputs[0], inputs[0]} - // Test non-unique EVM Inputs Errors - if err := exportTx.Verify(testXChainID, ctx, testTxFee, testAvaxAssetID); err == nil { - t.Fatal("ExportTx should have failed verification due to non-unique inputs") - } } diff --git a/plugin/evm/import_tx.go b/plugin/evm/import_tx.go index 2b8882f..00e133b 100644 --- a/plugin/evm/import_tx.go +++ b/plugin/evm/import_tx.go @@ -77,9 +77,6 @@ func (tx *UnsignedImportTx) Verify( return err } } - if !IsSortedAndUniqueEVMOutputs(tx.Outs) { - return errExportOutputsNotSortedAndUnique - } for _, in := range tx.ImportedInputs { if err := in.Verify(); err != nil { -- cgit v1.2.3-70-g09d2