Skip to content

Commit

Permalink
fix: fixing usage of num-ops param in 'benchmarks/sequencer/scripts'
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Nedkov <[email protected]>
  • Loading branch information
Psykepro committed Aug 24, 2023
1 parent 57a8269 commit 12e7228
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/benchmarks/sequencer/common/params/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const (
// PrometheusPort is the port where prometheus is running
PrometheusPort = 9092
// NumberOfOperations is the number of transactions to send
NumberOfOperations = 2
NumberOfOperations = 300
)
4 changes: 2 additions & 2 deletions test/benchmarks/sequencer/common/transactions/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func SendAndWait(
auth *bind.TransactOpts,
client *ethclient.Client,
getTxsByStatus func(ctx context.Context, status pool.TxStatus, limit uint64) ([]pool.Transaction, error),
nTxs int,
nTxs uint64,
erc20SC *ERC20.ERC20,
uniswapDeployments *pkg.Deployments,
txSenderFunc func(l2Client *ethclient.Client, gasPrice *big.Int, auth *bind.TransactOpts, erc20SC *ERC20.ERC20, uniswapDeployments *pkg.Deployments) ([]*types.Transaction, error),
Expand All @@ -37,7 +37,7 @@ func SendAndWait(
}

allTxs := make([]*types.Transaction, 0, nTxs)
for i := 0; i < nTxs; i++ {
for i := 0; i < int(nTxs); i++ {
txs, err := txSenderFunc(client, auth.GasPrice, auth, erc20SC, uniswapDeployments)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions test/benchmarks/sequencer/scripts/erc20-transfers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
err error
)

numOps := flag.Int("num-ops", 200, "The number of operations to run. Default is 200.")
numOps := flag.Uint64("num-ops", 200, "The number of operations to run. Default is 200.")
flag.Parse()

if numOps == nil {
Expand Down Expand Up @@ -47,7 +47,7 @@ func main() {
}

// Wait for Txs to be selected
err = transactions.WaitStatusSelected(pl.CountTransactionsByStatus, initialCount, params.NumberOfOperations)
err = transactions.WaitStatusSelected(pl.CountTransactionsByStatus, initialCount, *numOps)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions test/benchmarks/sequencer/scripts/eth-transfers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func main() {
var (
err error
)
numOps := flag.Int("num-ops", 200, "The number of operations to run. Default is 200.")
numOps := flag.Uint64("num-ops", 200, "The number of operations to run. Default is 200.")
flag.Parse()
if numOps == nil {
panic("numOps is nil")
Expand All @@ -42,7 +42,7 @@ func main() {
}

// Wait for Txs to be selected
err = transactions.WaitStatusSelected(pl.CountTransactionsByStatus, initialCount, params.NumberOfOperations)
err = transactions.WaitStatusSelected(pl.CountTransactionsByStatus, initialCount, *numOps)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions test/benchmarks/sequencer/scripts/uniswap-transfers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func main() {
var (
err error
)
numOps := flag.Int("num-ops", 200, "The number of operations to run. Default is 200.")
numOps := flag.Uint64("num-ops", 200, "The number of operations to run. Default is 200.")
flag.Parse()
if numOps == nil {
panic("numOps is nil")
Expand Down Expand Up @@ -50,7 +50,7 @@ func main() {
}

// Wait for Txs to be selected
err = transactions.WaitStatusSelected(pl.CountTransactionsByStatus, initialCount, params.NumberOfOperations)
err = transactions.WaitStatusSelected(pl.CountTransactionsByStatus, initialCount, *numOps)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 12e7228

Please sign in to comment.