aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/import_tx.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/import_tx.go
parentd833a96a315eaf3385316c6cfc89a2c7b5f32c73 (diff)
Add semantic verification tests for import tx
Diffstat (limited to 'plugin/evm/import_tx.go')
-rw-r--r--plugin/evm/import_tx.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/evm/import_tx.go b/plugin/evm/import_tx.go
index b848e61..ae6b540 100644
--- a/plugin/evm/import_tx.go
+++ b/plugin/evm/import_tx.go
@@ -98,6 +98,10 @@ func (tx *UnsignedImportTx) SemanticVerify(
return permError{err}
}
+ if len(stx.Creds) != len(tx.ImportedInputs) {
+ return permError{errSignatureInputsMismatch}
+ }
+
// do flow-checking
fc := avax.NewFlowChecker()
//fc.Produce(vm.ctx.AVAXAssetID, vm.txFee)
@@ -122,6 +126,7 @@ func (tx *UnsignedImportTx) SemanticVerify(
for i, in := range tx.ImportedInputs {
utxoIDs[i] = in.UTXOID.InputID().Bytes()
}
+ // allUTXOBytes is guaranteed to be the same length as utxoIDs
allUTXOBytes, err := vm.ctx.SharedMemory.Get(tx.SourceChain, utxoIDs)
if err != nil {
return tempError{err}