erigon-pulse/cmd/devnet/services/tx.go
ledgerwatch a8ec9eb471
[devnet tool] Use logging instead of fmt.Printf (#7560)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-22 08:46:50 +01:00

32 lines
1.0 KiB
Go

package services
import (
"github.com/ledgerwatch/erigon/cmd/devnet/models"
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
"github.com/ledgerwatch/log/v3"
)
func CheckTxPoolContent(expectedPendingSize, expectedQueuedSize, expectedBaseFeeSize int, logger log.Logger) {
pendingSize, queuedSize, baseFeeSize, err := requests.TxpoolContent(models.ReqId, 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)
}