Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix language usage within comments. #123

Merged
merged 1 commit into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ paths:
description: |
Piority [Low]

Return the UTxOs distribution across the whole wallet, in the form of an histogram.
Return the UTxOs distribution across the whole wallet, in the form of a histogram.

```
Expand Down
12 changes: 6 additions & 6 deletions src/Cardano/Wallet/Api/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ newtype ApiT a =
deriving (Generic, Show, Eq)

-- | Representation of mnemonics at the API-level, using a polymorphic type in
-- the number of mnemonic that are supported (and an underlying purpose). In
-- practice, mnemonic corresponds to passphrases or seeds, and although they're
-- the lengths of mnemonics that are supported (and an underlying purpose). In
-- practice, mnemonics correspond to passphrases or seeds, and although they're
-- nice to manipulate as mnemonics from a user-perspective, carrying around a
-- list of words doesn't really make sense for the business logic which prefers
-- list of words doesn't really make sense for the business logic, which prefers
-- manipulating scrubbed bytes directly.
--
-- @
Expand All @@ -150,11 +150,11 @@ newtype ApiT a =
-- @
--
-- Note that the given 'Nat's **have** to be valid mnemonic sizes, otherwise the
-- underlying code won't even compile with, not-soo-friendly error messages.
-- underlying code won't even compile, with not-so-friendly error messages.
--
-- Also, the internal representation holds a @[Text]@ which contains the list of
-- mnemonic words that was parsed. This is only to be able to satisfy the
-- 'ToJSON' instance and rountrip and that is a very dubious argument. In
-- mnemonic words that was parsed. This is only to be able to implement the
-- 'ToJSON' instances and roundtrip, which is a very dubious argument. In
-- practice, we'll NEVER peek at the mnemonic, output them and whatnot.
newtype ApiMnemonicT (sizes :: [Nat]) (purpose :: Symbol) =
ApiMnemonicT (Passphrase purpose, [Text])
Expand Down
14 changes: 7 additions & 7 deletions test/unit/Cardano/Wallet/Api/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,18 @@ instance
ApiMnemonicT y <- arbitrary @(ApiMnemonicT rest purpose)
-- NOTE
-- If we were to "naively" combine previous generators without weights,
-- we would be tilting probabilities towards the left most, in such way
-- that every element would be twice as more likely as its right
-- neighbour with an exponential decrease (after 7th elements, elements
-- have less than a percent of chance to appear). By tweaking a bit the
-- weight like below, we allow every elements to have at least 10%
-- chance to appear for lists up to 10 elements.
-- we would be tilting probabilities towards the leftmost element, so
-- that every element would be twice as likely to appear as its right-
-- hand neighbour, with an exponential decrease. (After the 7th element,
-- subsequent elements would have less than 1 percent chance of
-- appearing.) By tweaking the weights a bit as we have done below, we
-- make it possible for every element to have at least 10% chance of
-- appearing, for lists up to 10 elements.
frequency
[ (1, pure $ ApiMnemonicT x)
, (5, pure $ ApiMnemonicT y)
]


{-------------------------------------------------------------------------------
Specification / Servant-Swagger Machinery

Expand Down