[input-output-hk/cardano-sl] [CO-347] Wallet’s UTXO histogram view (#3402)

paweljakubas commented on this pull request.

> +
+— Buckets boundaries can be constructed in different way
+data BoundType = Log10 | Haphazard
+
+generateBounds :: BoundType -> NonEmpty Word64
+generateBounds bType =
+ let (^!) :: Word64 -> Word64 -> Word64
+ (^!) = (^)
+ in case bType of
+ Log10 -> NL.fromList $ ( map (\toPower -> 10 ^! toPower) [1..16] ) ++ [45 * (10 ^! 15)]
+ Haphazard -> NL.fromList [10, 100, 1000, 10000]
+
+instance Arbitrary HistogramBar where
+ arbitrary = do
+ possiblenames <- elements $ map show (NL.toList $ generateBounds Log10) + bound <- arbitrary fixed