Skip to content

Commit

Permalink
chore: use megabyte const
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed Oct 18, 2024
1 parent 1608073 commit 1ed45b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/benchmarks/benchmark_msg_send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,17 @@ 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 {
numberOfBytes := 0
for _, tx := range txs {
numberOfBytes += len(tx)
}
mb := float64(numberOfBytes) / 1048576
mb := float64(numberOfBytes) / megabyte
return mb
}

Expand Down

0 comments on commit 1ed45b1

Please sign in to comment.