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

KtorZ commented on this pull request.

> + & at «10000000000000» ?~ wordRef
+ & at «100000000000000» ?~ wordRef
+ & at «1000000000000000» ?~ wordRef
+ & at «10000000000000000» ?~ wordRef
+ & at «45000000000000000» ?~ wordRef
+ )
+ )
+ & at «allStakes» ?~ (Inline $ mempty
+ & type_ .~ SwaggerNumber
+ & minimum_ .~ Just 0
+ )
+ )
+
+instance Arbitrary UtxoStatistics where
+ arbitrary = UtxoStatistics <$> arbitrary
+ <*> arbitrary

The «invariant» I was talking about enters into play here. We could generate an arbitrary statistics here where we have `14000` in the last bucket, but a total take of `42` ADA which doesn’t make sense.
Hence the difficulty of having such parameter as part of the structure.

Добавить комментарий