[input-output-hk/cardano-sl] [CO-350] Load throttling configuration from file (#3399)

denisshevchenko commented on this pull request.

> + } deriving (Show, Generic)
+
+defaultWalletConfiguration :: WalletConfiguration
+defaultWalletConfiguration = WalletConfiguration
+ { ccThrottle = Nothing
+ }
+
+instance FromJSON WalletConfiguration where
+ parseJSON = genericParseJSON defaultOptions
+
+instance ToJSON WalletConfiguration where
+ toJSON = genericToJSON defaultOptions
+
+data ThrottleSettings = ThrottleSettings
+ { tsRate :: !Int
+ , tsPeriod :: !Int

If this is «Number of requests» and «Amount of microseconds» — why do you use `Int` here? It cannot be negative, so maybe some `Word`-type is better?

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