diff options
author | Aaron Buchwald <[email protected]> | 2020-10-06 16:12:56 -0400 |
---|---|---|
committer | Aaron Buchwald <[email protected]> | 2020-10-06 16:12:56 -0400 |
commit | a5b80ffc01821becffbe4f36d937f778c911af5f (patch) | |
tree | 801b7448bac78cb61ad12a2748796e55d7d0cdd6 /plugin/evm/import_tx.go | |
parent | d833a96a315eaf3385316c6cfc89a2c7b5f32c73 (diff) |
Add semantic verification tests for import tx
Diffstat (limited to 'plugin/evm/import_tx.go')
-rw-r--r-- | plugin/evm/import_tx.go | 5 |
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} |