aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/export_tx_test.go
diff options
context:
space:
mode:
authorAaron Buchwald <aaron.buchwald56@gmail.com>2020-10-06 16:12:56 -0400
committerAaron Buchwald <aaron.buchwald56@gmail.com>2020-10-06 16:12:56 -0400
commita5b80ffc01821becffbe4f36d937f778c911af5f (patch)
tree801b7448bac78cb61ad12a2748796e55d7d0cdd6 /plugin/evm/export_tx_test.go
parentd833a96a315eaf3385316c6cfc89a2c7b5f32c73 (diff)
Add semantic verification tests for import tx
Diffstat (limited to 'plugin/evm/export_tx_test.go')
-rw-r--r--plugin/evm/export_tx_test.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugin/evm/export_tx_test.go b/plugin/evm/export_tx_test.go
index 40670ff..319c6dd 100644
--- a/plugin/evm/export_tx_test.go
+++ b/plugin/evm/export_tx_test.go
@@ -13,7 +13,7 @@ import (
)
func TestExportTxVerifyNil(t *testing.T) {
- var exportTx UnsignedExportTx
+ var exportTx *UnsignedExportTx
if err := exportTx.Verify(testXChainID, NewContext(), testTxFee, testAvaxAssetID); err == nil {
t.Fatal("Verify should have failed due to nil transaction")
}
@@ -116,6 +116,17 @@ func TestExportTxVerify(t *testing.T) {
exportTx.ExportedOutputs = []*avax.TransferableOutput{exportedOuts[1], exportedOuts[0]}
// Test Unsorted outputs Errors
if err := exportTx.Verify(testXChainID, ctx, testTxFee, testAvaxAssetID); err == nil {
- t.Fatal("ExportTx should have failed verification due to no exported outputs")
+ t.Fatal("ExportTx should have failed verification due to no unsorted exported outputs")
+ }
+
+ exportTx.syntacticallyVerified = false
+ exportTx.ExportedOutputs = []*avax.TransferableOutput{exportedOuts[0], nil}
+ // Test invalid exported output
+ if err := exportTx.Verify(testXChainID, ctx, testTxFee, testAvaxAssetID); err == nil {
+ t.Fatal("ExportTx should have failed verification due to invalid output")
}
}
+
+func TestExportTxSemanticVerify(t *testing.T) {
+
+}