erigon-pulse/cmd/devnet/services/tx.go
Jochen Müller 97eccd913c
Some additions to the devnet tool (#7225)
- 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
2023-03-30 21:49:28 +00:00

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)
}