From 1ed45b1a9e5afa361bba9988306f5dfe674b7738 Mon Sep 17 00:00:00 2001 From: sweexordious Date: Fri, 18 Oct 2024 10:25:09 +0400 Subject: [PATCH] chore: use megabyte const --- app/benchmarks/benchmark_msg_send_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/benchmarks/benchmark_msg_send_test.go b/app/benchmarks/benchmark_msg_send_test.go index 6cbc30d6d2..91557e39f9 100644 --- a/app/benchmarks/benchmark_msg_send_test.go +++ b/app/benchmarks/benchmark_msg_send_test.go @@ -307,6 +307,9 @@ func generateMsgSendTransactions(b *testing.B, count int) (*app.App, [][]byte) { return testApp, rawTxs } +// megabyte the number of bytes in a megabyte +const megabyte = 1048576 + // calculateBlockSizeInMb returns the block size in mb given a set // of raw transactions. func calculateBlockSizeInMb(txs [][]byte) float64 { @@ -314,7 +317,7 @@ func calculateBlockSizeInMb(txs [][]byte) float64 { for _, tx := range txs { numberOfBytes += len(tx) } - mb := float64(numberOfBytes) / 1048576 + mb := float64(numberOfBytes) / megabyte return mb }