Merge pull request #1751 from nspcc-dev/microfixes

core: microfixes
This commit is contained in:
Roman Khimov 2021-02-17 14:20:01 +03:00 committed by GitHub
commit 69458a9945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 114 additions and 70 deletions

View file

@ -2,8 +2,10 @@ package core
import (
"errors"
"fmt"
"math/big"
"math/rand"
"strings"
"testing"
"time"
@ -439,10 +441,6 @@ func TestVerifyTx(t *testing.T) {
err := bc.PoolTx(tx2)
require.True(t, errors.Is(err, ErrMemPoolConflict))
})
t.Run("NotEnoughWitnesses", func(t *testing.T) {
tx := bc.newTestTx(h, testScript)
checkErr(t, ErrTxInvalidWitnessNum, tx)
})
t.Run("InvalidWitnessHash", func(t *testing.T) {
tx := bc.newTestTx(h, testScript)
require.NoError(t, accs[0].SignTx(tx))
@ -1199,7 +1197,6 @@ func TestIsTxStillRelevant(t *testing.T) {
require.NoError(t, bc.AddBlock(bc.newBlock()))
require.True(t, bc.IsTxStillRelevant(tx3, nil, false))
})
/* // neo-project/neo#2289
t.Run("contract witness check fails", func(t *testing.T) {
src := fmt.Sprintf(`package verify
import (
@ -1230,7 +1227,6 @@ func TestIsTxStillRelevant(t *testing.T) {
require.NoError(t, bc.AddBlock(bc.newBlock()))
require.False(t, bc.IsTxStillRelevant(tx, mp, false))
})
*/
}
func TestMemPoolRemoval(t *testing.T) {