Drop Transaction Count for Transaction Generator (#13228)

* reduce

* comment
This commit is contained in:
Nishant Das 2023-11-30 18:55:18 +08:00 committed by GitHub
parent ca36634de6
commit d8b38cf230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,8 @@ import (
"golang.org/x/sync/errgroup"
)
const txCount = 20
var fundedAccount *keystore.Key
type TransactionGenerator struct {
@ -82,7 +84,7 @@ func (t *TransactionGenerator) Start(ctx context.Context) error {
return err
}
f := filler.NewFiller(rnd)
// Broadcast Transactions every 3 blocks
// Broadcast Transactions every slot
txPeriod := time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second
ticker := time.NewTicker(txPeriod)
gasPrice := big.NewInt(1e11)
@ -92,7 +94,7 @@ func (t *TransactionGenerator) Start(ctx context.Context) error {
return nil
case <-ticker.C:
backend := ethclient.NewClient(client)
err = SendTransaction(client, mineKey.PrivateKey, f, gasPrice, mineKey.Address.String(), 100, backend, false)
err = SendTransaction(client, mineKey.PrivateKey, f, gasPrice, mineKey.Address.String(), txCount, backend, false)
if err != nil {
return err
}