From 275c5d359142724d582aab327d2ad9cba7941bda Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Tue, 14 Aug 2018 10:50:17 +0200 Subject: [PATCH] swarm/bmt: move segmentCount to tests --- swarm/bmt/bmt.go | 3 --- swarm/bmt/bmt_test.go | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/swarm/bmt/bmt.go b/swarm/bmt/bmt.go index 77b9b4f99f..a85d4369e5 100644 --- a/swarm/bmt/bmt.go +++ b/swarm/bmt/bmt.go @@ -55,9 +55,6 @@ Two implementations are provided: */ const ( - // segmentCount is the maximum number of segments of the underlying chunk - // Should be equal to max-chunk-data-size / hash-size - segmentCount = 128 // PoolSize is the maximum number of bmt trees used by the hashers, i.e, // the maximum number of concurrent BMT hashing operations performed by the same hasher PoolSize = 8 diff --git a/swarm/bmt/bmt_test.go b/swarm/bmt/bmt_test.go index 8763f194ad..760aa11d8b 100644 --- a/swarm/bmt/bmt_test.go +++ b/swarm/bmt/bmt_test.go @@ -34,6 +34,13 @@ import ( // the actual data length generated (could be longer than max datalength of the BMT) const BufferSize = 4128 +const ( + // segmentCount is the maximum number of segments of the underlying chunk + // Should be equal to max-chunk-data-size / hash-size + // Currently set to 128 == 4096 (default chunk size) / 32 (sha3.keccak256 size) + segmentCount = 128 +) + var counts = []int{1, 2, 3, 4, 5, 8, 9, 15, 16, 17, 32, 37, 42, 53, 63, 64, 65, 111, 127, 128} // calculates the Keccak256 SHA3 hash of the data