mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 05:27:19 +00:00
enable pool test
This commit is contained in:
parent
42b84026c2
commit
95f240d597
@ -2,11 +2,9 @@ package commands
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/holiman/uint256"
|
||||
"github.com/ledgerwatch/erigon-lib/gointerfaces/sentry"
|
||||
"github.com/ledgerwatch/erigon-lib/gointerfaces/txpool"
|
||||
"github.com/ledgerwatch/erigon-lib/kv/kvcache"
|
||||
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/filters"
|
||||
@ -16,50 +14,19 @@ import (
|
||||
"github.com/ledgerwatch/erigon/common/u256"
|
||||
"github.com/ledgerwatch/erigon/core"
|
||||
"github.com/ledgerwatch/erigon/core/types"
|
||||
"github.com/ledgerwatch/erigon/eth/protocols/eth"
|
||||
"github.com/ledgerwatch/erigon/params"
|
||||
"github.com/ledgerwatch/erigon/rlp"
|
||||
"github.com/ledgerwatch/erigon/turbo/stages"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestTxPoolContent(t *testing.T) {
|
||||
t.Skipf("will restore now")
|
||||
m, require := stages.Mock(t), require.New(t)
|
||||
chain, err := core.GenerateChain(m.ChainConfig, m.Genesis, m.Engine, m.DB, 1, func(i int, b *core.BlockGen) {
|
||||
b.SetCoinbase(common.Address{1})
|
||||
}, false /* intemediateHashes */)
|
||||
require.NoError(err)
|
||||
{ // Do 1 step to start txPool
|
||||
|
||||
// Send NewBlock message
|
||||
b, err := rlp.EncodeToBytes(ð.NewBlockPacket{
|
||||
Block: chain.TopBlock,
|
||||
TD: big.NewInt(1), // This is ignored anyway
|
||||
})
|
||||
err = m.InsertChain(chain)
|
||||
require.NoError(err)
|
||||
m.ReceiveWg.Add(1)
|
||||
for _, err = range m.Send(&sentry.InboundMessage{Id: sentry.MessageId_NEW_BLOCK_66, Data: b, PeerId: m.PeerId}) {
|
||||
require.NoError(err)
|
||||
}
|
||||
// Send all the headers
|
||||
b, err = rlp.EncodeToBytes(ð.BlockHeadersPacket66{
|
||||
RequestId: 1,
|
||||
BlockHeadersPacket: chain.Headers,
|
||||
})
|
||||
require.NoError(err)
|
||||
m.ReceiveWg.Add(1)
|
||||
for _, err = range m.Send(&sentry.InboundMessage{Id: sentry.MessageId_BLOCK_HEADERS_66, Data: b, PeerId: m.PeerId}) {
|
||||
require.NoError(err)
|
||||
}
|
||||
m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed
|
||||
|
||||
initialCycle := true
|
||||
highestSeenHeader := chain.TopBlock.NumberU64()
|
||||
if err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, highestSeenHeader, m.Notifications, initialCycle, m.UpdateHead, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
ctx, conn := rpcdaemontest.CreateTestGrpcConn(t, m)
|
||||
txPool := txpool.NewTxpoolClient(conn)
|
||||
|
Loading…
Reference in New Issue
Block a user