mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
core/txpool/blobpool: remove use of assert in tests
This commit is contained in:
parent
77efa170ac
commit
3c3df888dc
1 changed files with 11 additions and 7 deletions
|
|
@ -43,7 +43,6 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
"github.com/holiman/billy"
|
"github.com/holiman/billy"
|
||||||
"github.com/holiman/uint256"
|
"github.com/holiman/uint256"
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -1155,9 +1154,6 @@ func TestBlobCountLimit(t *testing.T) {
|
||||||
|
|
||||||
addr1 = crypto.PubkeyToAddress(key1.PublicKey)
|
addr1 = crypto.PubkeyToAddress(key1.PublicKey)
|
||||||
addr2 = crypto.PubkeyToAddress(key2.PublicKey)
|
addr2 = crypto.PubkeyToAddress(key2.PublicKey)
|
||||||
|
|
||||||
tx1 = makeMultiBlobTx(0, 1, 1000, 100, 7, key1)
|
|
||||||
tx2 = makeMultiBlobTx(0, 1, 800, 70, 8, key2)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
statedb, _ := state.New(types.EmptyRootHash, state.NewDatabaseForTesting())
|
statedb, _ := state.New(types.EmptyRootHash, state.NewDatabaseForTesting())
|
||||||
|
|
@ -1190,11 +1186,19 @@ func TestBlobCountLimit(t *testing.T) {
|
||||||
t.Fatalf("failed to create blob pool: %v", err)
|
t.Fatalf("failed to create blob pool: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
tx1 = makeMultiBlobTx(0, 1, 1000, 100, 7, key1)
|
||||||
|
tx2 = makeMultiBlobTx(0, 1, 800, 70, 8, key2)
|
||||||
|
)
|
||||||
|
|
||||||
// Attempt to add transactions.
|
// Attempt to add transactions.
|
||||||
errs := pool.Add([]*types.Transaction{tx1, tx2}, true)
|
errs := pool.Add([]*types.Transaction{tx1, tx2}, true)
|
||||||
assert.Equal(t, 2, len(errs))
|
if errs[0] != nil {
|
||||||
assert.NoError(t, errs[0])
|
t.Fatalf("expected tx with 7 blobs to succeed")
|
||||||
assert.EqualError(t, errs[1], "transaction blob limit exceeded: blob count 8, limit 7")
|
}
|
||||||
|
if !errors.Is(errs[1], txpool.ErrTxBlobLimitExceeded) {
|
||||||
|
t.Fatalf("expected tx with 8 blobs to fail, got: %v", errs[1])
|
||||||
|
}
|
||||||
|
|
||||||
verifyPoolInternals(t, pool)
|
verifyPoolInternals(t, pool)
|
||||||
pool.Close()
|
pool.Close()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue