mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-07 03:22:18 +00:00
97eccd913c
- Fix tx numbers expected - Check for baseFee subpool size too - Fix tx counting - Wait for blocks in baseFee subpool to be promoted and mined - Add BlockNumber request
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package services
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/models"
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
|
|
)
|
|
|
|
func CheckTxPoolContent(expectedPendingSize, expectedQueuedSize, expectedBaseFeeSize int) {
|
|
pendingSize, queuedSize, baseFeeSize, err := requests.TxpoolContent(models.ReqId)
|
|
if err != nil {
|
|
fmt.Printf("FAILURE => error getting txpool content: %v\n", err)
|
|
return
|
|
}
|
|
|
|
if pendingSize != expectedPendingSize {
|
|
fmt.Printf("FAILURE => %v\n", fmt.Errorf("expected %d transaction(s) in pending pool, got %d", expectedPendingSize, pendingSize))
|
|
return
|
|
}
|
|
|
|
if queuedSize != expectedQueuedSize {
|
|
fmt.Printf("FAILURE => %v\n", fmt.Errorf("expected %d transaction(s) in queued pool, got %d", expectedQueuedSize, queuedSize))
|
|
return
|
|
}
|
|
|
|
if baseFeeSize != expectedBaseFeeSize {
|
|
fmt.Printf("FAILURE => %v\n", fmt.Errorf("expected %d transaction(s) in baseFee pool, got %d", expectedBaseFeeSize, baseFeeSize))
|
|
}
|
|
|
|
fmt.Printf("SUCCESS => %d transaction(s) in the pending pool, %d transaction(s) in the queued pool and %d transaction(s) in the baseFee pool\n", pendingSize, queuedSize, baseFeeSize)
|
|
}
|