mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
fix : TestTransactionIndices, testBeaconSync
This commit is contained in:
parent
2b06029fb8
commit
2ad1e0f7e9
2 changed files with 4 additions and 3 deletions
|
|
@ -2798,6 +2798,8 @@ func TestTransactionIndices(t *testing.T) {
|
||||||
block.AddTx(tx)
|
block.AddTx(tx)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
borReceipts := make([]types.Receipts, len(receipts))
|
||||||
|
|
||||||
check := func(tail *uint64, chain *BlockChain) {
|
check := func(tail *uint64, chain *BlockChain) {
|
||||||
stored := rawdb.ReadTxIndexTail(chain.db)
|
stored := rawdb.ReadTxIndexTail(chain.db)
|
||||||
if tail == nil && stored != nil {
|
if tail == nil && stored != nil {
|
||||||
|
|
@ -2841,7 +2843,7 @@ func TestTransactionIndices(t *testing.T) {
|
||||||
for _, l := range limit {
|
for _, l := range limit {
|
||||||
frdir := t.TempDir()
|
frdir := t.TempDir()
|
||||||
ancientDb, _ := rawdb.NewDatabaseWithFreezer(rawdb.NewMemoryDatabase(), frdir, "", false)
|
ancientDb, _ := rawdb.NewDatabaseWithFreezer(rawdb.NewMemoryDatabase(), frdir, "", false)
|
||||||
_, _ = rawdb.WriteAncientBlocks(ancientDb, append([]*types.Block{gspec.ToBlock()}, blocks...), append([]types.Receipts{{}}, receipts...), []types.Receipts{nil}, big.NewInt(0))
|
_, _ = rawdb.WriteAncientBlocks(ancientDb, append([]*types.Block{gspec.ToBlock()}, blocks...), append([]types.Receipts{{}}, receipts...), append([]types.Receipts{{}}, borReceipts...), big.NewInt(0))
|
||||||
|
|
||||||
l := l
|
l := l
|
||||||
|
|
||||||
|
|
@ -2867,7 +2869,7 @@ func TestTransactionIndices(t *testing.T) {
|
||||||
ancientDb, _ := rawdb.NewDatabaseWithFreezer(rawdb.NewMemoryDatabase(), t.TempDir(), "", false)
|
ancientDb, _ := rawdb.NewDatabaseWithFreezer(rawdb.NewMemoryDatabase(), t.TempDir(), "", false)
|
||||||
defer ancientDb.Close()
|
defer ancientDb.Close()
|
||||||
|
|
||||||
_, _ = rawdb.WriteAncientBlocks(ancientDb, append([]*types.Block{gspec.ToBlock()}, blocks...), append([]types.Receipts{{}}, receipts...), []types.Receipts{nil}, big.NewInt(0))
|
_, _ = rawdb.WriteAncientBlocks(ancientDb, append([]*types.Block{gspec.ToBlock()}, blocks...), append([]types.Receipts{{}}, receipts...), append([]types.Receipts{{}}, borReceipts...), big.NewInt(0))
|
||||||
|
|
||||||
limit = []uint64{0, 64 /* drop stale */, 32 /* shorten history */, 64 /* extend history */, 0 /* restore all */}
|
limit = []uint64{0, 64 /* drop stale */, 32 /* shorten history */, 64 /* extend history */, 0 /* restore all */}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1899,7 +1899,6 @@ func TestBeaconSync66Snap(t *testing.T) {
|
||||||
|
|
||||||
func testBeaconSync(t *testing.T, protocol uint, mode SyncMode) {
|
func testBeaconSync(t *testing.T, protocol uint, mode SyncMode) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
t.Parallel()
|
|
||||||
//log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
//log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
||||||
|
|
||||||
var cases = []struct {
|
var cases = []struct {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue