mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 22:43:47 +00:00
fix ci, lint
This commit is contained in:
parent
55a9ecec41
commit
debb38853d
4 changed files with 18 additions and 8 deletions
|
|
@ -1108,6 +1108,7 @@ func (pool *TxPool) scheduleReorgLoop() {
|
||||||
if curDone == nil && launchNextRun {
|
if curDone == nil && launchNextRun {
|
||||||
fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", n, time.Since(now))
|
fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", n, time.Since(now))
|
||||||
n++
|
n++
|
||||||
|
|
||||||
now = time.Now()
|
now = time.Now()
|
||||||
// Run the background reorg and announcements
|
// Run the background reorg and announcements
|
||||||
go pool.runReorg(nextDone, reset, dirtyAccounts, queuedEvents)
|
go pool.runReorg(nextDone, reset, dirtyAccounts, queuedEvents)
|
||||||
|
|
|
||||||
|
|
@ -2713,6 +2713,8 @@ func defaultTxPoolRapidConfig() txPoolRapidConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSmallTxPool(t *testing.T) {
|
func TestSmallTxPool(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
t.Skip("a red test to be fixed")
|
t.Skip("a red test to be fixed")
|
||||||
|
|
||||||
cfg := defaultTxPoolRapidConfig()
|
cfg := defaultTxPoolRapidConfig()
|
||||||
|
|
@ -2730,6 +2732,8 @@ func TestSmallTxPool(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBigTxPool(t *testing.T) {
|
func TestBigTxPool(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
t.Skip("a red test to be fixed")
|
t.Skip("a red test to be fixed")
|
||||||
|
|
||||||
cfg := defaultTxPoolRapidConfig()
|
cfg := defaultTxPoolRapidConfig()
|
||||||
|
|
@ -2739,6 +2743,8 @@ func TestBigTxPool(t *testing.T) {
|
||||||
|
|
||||||
//nolint:gocognit
|
//nolint:gocognit
|
||||||
func testPoolBatchInsert(t *testing.T, cfg txPoolRapidConfig) {
|
func testPoolBatchInsert(t *testing.T, cfg txPoolRapidConfig) {
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
const debug = false
|
const debug = false
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ func TestBorFilters(t *testing.T) {
|
||||||
hash4 = common.BytesToHash([]byte("topic4"))
|
hash4 = common.BytesToHash([]byte("topic4"))
|
||||||
db = NewMockDatabase(ctrl)
|
db = NewMockDatabase(ctrl)
|
||||||
|
|
||||||
sprint = params.TestChainConfig.Bor.Sprint
|
testBorConfig = params.TestChainConfig.Bor
|
||||||
)
|
)
|
||||||
|
|
||||||
backend := NewMockBackend(ctrl)
|
backend := NewMockBackend(ctrl)
|
||||||
|
|
@ -74,7 +74,7 @@ func TestBorFilters(t *testing.T) {
|
||||||
// Block 1
|
// Block 1
|
||||||
backend.expectBorReceiptsFromMock([]*common.Hash{nil, &hash1, &hash2, &hash3, &hash4})
|
backend.expectBorReceiptsFromMock([]*common.Hash{nil, &hash1, &hash2, &hash3, &hash4})
|
||||||
|
|
||||||
filter := NewBorBlockLogsRangeFilter(backend, sprint, 0, 18, []common.Address{addr}, [][]common.Hash{{hash1, hash2, hash3, hash4}})
|
filter := NewBorBlockLogsRangeFilter(backend, testBorConfig, 0, 18, []common.Address{addr}, [][]common.Hash{{hash1, hash2, hash3, hash4}})
|
||||||
logs, err := filter.Logs(context.Background())
|
logs, err := filter.Logs(context.Background())
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -88,7 +88,7 @@ func TestBorFilters(t *testing.T) {
|
||||||
// Block 2
|
// Block 2
|
||||||
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash3})
|
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash3})
|
||||||
|
|
||||||
filter = NewBorBlockLogsRangeFilter(backend, sprint, 990, 999, []common.Address{addr}, [][]common.Hash{{hash3}})
|
filter = NewBorBlockLogsRangeFilter(backend, testBorConfig, 990, 999, []common.Address{addr}, [][]common.Hash{{hash3}})
|
||||||
logs, _ = filter.Logs(context.Background())
|
logs, _ = filter.Logs(context.Background())
|
||||||
|
|
||||||
if len(logs) != 1 {
|
if len(logs) != 1 {
|
||||||
|
|
@ -102,7 +102,7 @@ func TestBorFilters(t *testing.T) {
|
||||||
// Block 3
|
// Block 3
|
||||||
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, &hash3})
|
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, &hash3})
|
||||||
|
|
||||||
filter = NewBorBlockLogsRangeFilter(backend, sprint, 992, 1000, []common.Address{addr}, [][]common.Hash{{hash3}})
|
filter = NewBorBlockLogsRangeFilter(backend, testBorConfig, 992, 1000, []common.Address{addr}, [][]common.Hash{{hash3}})
|
||||||
logs, _ = filter.Logs(context.Background())
|
logs, _ = filter.Logs(context.Background())
|
||||||
|
|
||||||
if len(logs) != 1 {
|
if len(logs) != 1 {
|
||||||
|
|
@ -116,7 +116,7 @@ func TestBorFilters(t *testing.T) {
|
||||||
// Block 4
|
// Block 4
|
||||||
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, nil, &hash3})
|
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, nil, &hash3})
|
||||||
|
|
||||||
filter = NewBorBlockLogsRangeFilter(backend, sprint, 1, 16, []common.Address{addr}, [][]common.Hash{{hash1, hash2}})
|
filter = NewBorBlockLogsRangeFilter(backend, testBorConfig, 1, 16, []common.Address{addr}, [][]common.Hash{{hash1, hash2}})
|
||||||
|
|
||||||
logs, _ = filter.Logs(context.Background())
|
logs, _ = filter.Logs(context.Background())
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ func TestBorFilters(t *testing.T) {
|
||||||
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, nil, &hash3, &hash4, nil})
|
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, nil, &hash3, &hash4, nil})
|
||||||
|
|
||||||
failHash := common.BytesToHash([]byte("fail"))
|
failHash := common.BytesToHash([]byte("fail"))
|
||||||
filter = NewBorBlockLogsRangeFilter(backend, sprint, 0, 20, nil, [][]common.Hash{{failHash}})
|
filter = NewBorBlockLogsRangeFilter(backend, testBorConfig, 0, 20, nil, [][]common.Hash{{failHash}})
|
||||||
|
|
||||||
logs, _ = filter.Logs(context.Background())
|
logs, _ = filter.Logs(context.Background())
|
||||||
if len(logs) != 0 {
|
if len(logs) != 0 {
|
||||||
|
|
@ -139,7 +139,7 @@ func TestBorFilters(t *testing.T) {
|
||||||
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, nil, &hash3, &hash4, nil})
|
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, nil, &hash3, &hash4, nil})
|
||||||
|
|
||||||
failAddr := common.BytesToAddress([]byte("failmenow"))
|
failAddr := common.BytesToAddress([]byte("failmenow"))
|
||||||
filter = NewBorBlockLogsRangeFilter(backend, sprint, 0, 20, []common.Address{failAddr}, nil)
|
filter = NewBorBlockLogsRangeFilter(backend, testBorConfig, 0, 20, []common.Address{failAddr}, nil)
|
||||||
|
|
||||||
logs, _ = filter.Logs(context.Background())
|
logs, _ = filter.Logs(context.Background())
|
||||||
if len(logs) != 0 {
|
if len(logs) != 0 {
|
||||||
|
|
@ -149,7 +149,7 @@ func TestBorFilters(t *testing.T) {
|
||||||
// Block 7
|
// Block 7
|
||||||
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, nil, &hash3, &hash4, nil})
|
backend.expectBorReceiptsFromMock([]*common.Hash{&hash1, &hash2, nil, &hash3, &hash4, nil})
|
||||||
|
|
||||||
filter = NewBorBlockLogsRangeFilter(backend, sprint, 0, 20, nil, [][]common.Hash{{failHash}, {hash1}})
|
filter = NewBorBlockLogsRangeFilter(backend, testBorConfig, 0, 20, nil, [][]common.Hash{{failHash}, {hash1}})
|
||||||
|
|
||||||
logs, _ = filter.Logs(context.Background())
|
logs, _ = filter.Logs(context.Background())
|
||||||
if len(logs) != 0 {
|
if len(logs) != 0 {
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,9 @@ func NewDBForFakes(t TensingObject) (ethdb.Database, *core.Genesis, *params.Chai
|
||||||
chainConfig.Bor.Period = map[string]uint64{
|
chainConfig.Bor.Period = map[string]uint64{
|
||||||
"0": 1,
|
"0": 1,
|
||||||
}
|
}
|
||||||
|
chainConfig.Bor.Sprint = map[string]uint64{
|
||||||
|
"0": 1,
|
||||||
|
}
|
||||||
|
|
||||||
return chainDB, genesis, chainConfig
|
return chainDB, genesis, chainConfig
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue