erigon-pulse/cmd/devnet/services/tx.go
ledgerwatch 708ea9225d
[devnet tool] single request generator (#7600)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-29 20:35:45 +01:00

31 lines
1.0 KiB
Go

package services
import (
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
"github.com/ledgerwatch/log/v3"
)
func CheckTxPoolContent(reqGen *requests.RequestGenerator, expectedPendingSize, expectedQueuedSize, expectedBaseFeeSize int, logger log.Logger) {
pendingSize, queuedSize, baseFeeSize, err := requests.TxpoolContent(reqGen, logger)
if err != nil {
logger.Error("FAILURE getting txpool content", "error", err)
return
}
if pendingSize != expectedPendingSize {
logger.Error("FAILURE mismatched pending subpool size", "expected", expectedPendingSize, "got", pendingSize)
return
}
if queuedSize != expectedQueuedSize {
logger.Error("FAILURE mismatched queued subpool size", "expected", expectedQueuedSize, "got", queuedSize)
return
}
if baseFeeSize != expectedBaseFeeSize {
logger.Error("FAILURE mismatched basefee subpool size", "expected", expectedBaseFeeSize, "got", baseFeeSize)
}
logger.Info("SUCCESS => subpool sizes", "pending", pendingSize, "queued", queuedSize, "basefee", baseFeeSize)
}