From 34f3194082aec08485f498b4cac4e29d831878a9 Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Wed, 23 Feb 2022 02:32:36 +0200 Subject: [PATCH] Fix typos --- docs/contributing/Release-Checklist.md | 2 +- docs/design/Eras.md | 2 +- docs/design/specs/light-mode.md | 6 +++--- docs/developers/Building.md | 2 +- docs/user-guide/cli.md | 2 +- docs/user-guide/faq.md | 2 +- lib/cli/test/unit/Cardano/CLISpec.hs | 4 ++-- .../src/Test/Integration/Framework/DSL.hs | 4 ++-- lib/core-integration/src/Test/Integration/Plutus.hs | 4 ++-- .../Test/Integration/Scenario/API/Shared/Wallets.hs | 2 +- .../Integration/Scenario/API/Shelley/StakePools.hs | 2 +- .../Test/Integration/Scenario/CLI/Shelley/Wallets.hs | 2 +- lib/core/bench/db-bench.hs | 2 +- lib/core/src/Cardano/Pool/DB.hs | 2 +- lib/core/src/Cardano/Pool/DB/Sqlite.hs | 2 +- lib/core/src/Cardano/Wallet.hs | 10 +++++----- lib/core/src/Cardano/Wallet/Api.hs | 2 +- lib/core/src/Cardano/Wallet/Api/Server.hs | 6 +++--- lib/core/src/Cardano/Wallet/Api/Types.hs | 4 ++-- .../Cardano/Wallet/CoinSelection/Internal/Balance.hs | 4 ++-- lib/core/src/Cardano/Wallet/DB.hs | 2 +- lib/core/src/Cardano/Wallet/DB/Sqlite.hs | 2 +- lib/core/src/Cardano/Wallet/DB/Sqlite/Migration.hs | 4 ++-- .../Wallet/Primitive/AddressDerivation/Byron.hs | 2 +- .../src/Cardano/Wallet/Primitive/AddressDiscovery.hs | 4 ++-- .../Wallet/Primitive/AddressDiscovery/Shared.hs | 8 ++++---- .../src/Cardano/Wallet/Primitive/Delegation/State.hs | 4 ++-- lib/core/src/Cardano/Wallet/Primitive/Model.hs | 2 +- .../src/Cardano/Wallet/Primitive/SyncProgress.hs | 2 +- lib/core/src/Cardano/Wallet/Primitive/Types.hs | 2 +- lib/core/src/Cardano/Wallet/Primitive/Types/UTxO.hs | 2 +- .../Wallet/Primitive/Types/UTxOIndex/Internal.hs | 2 +- lib/core/src/Cardano/Wallet/Registry.hs | 2 +- lib/core/src/Network/Ntp.hs | 2 +- lib/core/src/Ouroboros/Network/Client/Wallet.hs | 4 ++-- lib/core/test/unit/Cardano/Byron/Codec/CborSpec.hs | 2 +- lib/core/test/unit/Cardano/Pool/DB/Arbitrary.hs | 2 +- lib/core/test/unit/Cardano/Pool/DB/Properties.hs | 2 +- lib/core/test/unit/Cardano/Wallet/DB/SqliteSpec.hs | 2 +- .../Wallet/Primitive/AddressDiscovery/RandomSpec.hs | 8 ++++---- .../Cardano/Wallet/Primitive/Delegation/StateSpec.hs | 6 +++--- .../unit/Cardano/Wallet/Primitive/SlottingSpec.hs | 2 +- lib/core/test/unit/Cardano/Wallet/RegistrySpec.hs | 2 +- lib/dbvar/src/Data/DBVar.hs | 12 ++++++------ lib/dbvar/src/Data/Table.hs | 4 ++-- lib/shelley/exe/local-cluster.hs | 2 +- lib/shelley/src/Cardano/Wallet/Shelley/Launch.hs | 2 +- lib/shelley/src/Cardano/Wallet/Shelley/Pools.hs | 4 ++-- .../src/Cardano/Wallet/Shelley/Transaction.hs | 6 +++--- .../data/cardano-node-shelley/byron-genesis.yaml | 2 +- lib/test-utils/src/Test/Hspec/Goldens.hs | 2 +- lib/test-utils/src/Test/Utils/Roundtrip.hs | 2 +- nix/haskell.nix | 4 ++-- reports/security/2020-01-21.md | 12 ++++++------ scripts/connect_wallet.rb | 4 ++-- scripts/make_release.sh | 4 ++-- specifications/api/swagger.yaml | 10 +++++----- test/e2e/README.md | 2 +- test/manual/ConnectionLostWithTheNode.md | 2 +- 59 files changed, 105 insertions(+), 105 deletions(-) diff --git a/docs/contributing/Release-Checklist.md b/docs/contributing/Release-Checklist.md index dfb0e2d3da4..5ac5f46b3a8 100644 --- a/docs/contributing/Release-Checklist.md +++ b/docs/contributing/Release-Checklist.md @@ -8,7 +8,7 @@ Verify that the content of [`stack.yaml`][] and [`cabal.project`][] correspond to the `cardano-node` version. - Verify that target repositories point to appopriate revisions for `persistent`, `cardano-addresses`, `bech32`, ...) + Verify that target repositories point to appropriate revisions for `persistent`, `cardano-addresses`, `bech32`, ...) - Fetch the tip of `master`: diff --git a/docs/design/Eras.md b/docs/design/Eras.md index 72c7795afa8..0a2d6faaed7 100644 --- a/docs/design/Eras.md +++ b/docs/design/Eras.md @@ -70,7 +70,7 @@ Cardano Mode is the default. I'm not aware of too many people using single-era m ## Specifications -Formal specifications (and the actual implementations!) for each Cardano era exist in the [input-output-hk/cardano-ledger](https://github.com/input-output-hk/cardano-ledger) repo. These documents are suprisingly readable, and are our go-to source for answers about how the node operates. See the [`README.md`](https://github.com/input-output-hk/cardano-ledger/blob/master/README.md) for links to PDFs and/or build instructions. +Formal specifications (and the actual implementations!) for each Cardano era exist in the [input-output-hk/cardano-ledger](https://github.com/input-output-hk/cardano-ledger) repo. These documents are surprisingly readable, and are our go-to source for answers about how the node operates. See the [`README.md`](https://github.com/input-output-hk/cardano-ledger/blob/master/README.md) for links to PDFs and/or build instructions. ### Decentralized Update Proposals diff --git a/docs/design/specs/light-mode.md b/docs/design/specs/light-mode.md index 8e5c24f3ddc..2fae7e9be0c 100644 --- a/docs/design/specs/light-mode.md +++ b/docs/design/specs/light-mode.md @@ -40,7 +40,7 @@ As the Cardano blockchain grows in size, retrieving and verifying blocks from th ## Technical benefits * *Speed*. With light-mode, we expect synchronisation times of < 1 minute for a wallet with 1'000 transactions. In contrast, synchronisation of an empty wallet currently takes ~ 50 minutes by connecting to a node — assuming that the node has already synced to the chain tip and built its ledger state, which itself takes hours. -* *Compatiblity*. Light-mode is intended to preserve the API presented to downstream software such as [Daedalus][], only *minimal* changes are expected. +* *Compatibility*. Light-mode is intended to preserve the API presented to downstream software such as [Daedalus][], only *minimal* changes are expected. * *Optionality*. A wallet that was started in light-mode can be restarted in full mode without resynchronization, and vice versa. (MVP: no support yet for changing the mode dynamically while the wallet is running.) ## Limitations @@ -100,7 +100,7 @@ flowchart TB ``` ::: -In light-mode, `cardano-wallet` instead connects to the data source (e.g. `cardano-graphql` or [Blockfrost][]) and a transaction submission service trough the internet +In light-mode, `cardano-wallet` instead connects to the data source (e.g. `cardano-graphql` or [Blockfrost][]) and a transaction submission service through the internet :::{.mermaid-container} ```mermaid @@ -132,7 +132,7 @@ $ cardano-wallet serve --light CRED ``` * `CRED` specifies how to connect to the less trusted blockchain data source. (MVP: Use [Blockfrost][]; `CRED` is a filepath to the secret token.) -* The `--light` argument and the `--node-socket` arguments are mutally exclusive with each other. +* The `--light` argument and the `--node-socket` arguments are mutually exclusive with each other. ### REST API diff --git a/docs/developers/Building.md b/docs/developers/Building.md index 6561b3e5e44..87ce404363b 100644 --- a/docs/developers/Building.md +++ b/docs/developers/Building.md @@ -120,7 +120,7 @@ The resulting executable will appear at `./result/bin/cardano-wallet`. Unless you have local changes in your git repo, Nix will download the build from the Hydra cache rather than building locally. -You may also run the exectable directly with: +You may also run the executable directly with: ```console $ nix run . -- diff --git a/docs/user-guide/cli.md b/docs/user-guide/cli.md index 34d54608ec8..f2febb4a23b 100644 --- a/docs/user-guide/cli.md +++ b/docs/user-guide/cli.md @@ -97,7 +97,7 @@ Available COMMANDS: ::: :::{.info-block} -:information_source: The CLI commands for `wallet`, `transaction` and `address` only output valid JSON on `stdout`. So you may redirect the output to a file with `>` or pipe it into utility softwares like `jq`! +:information_source: The CLI commands for `wallet`, `transaction` and `address` only output valid JSON on `stdout`. So you may redirect the output to a file with `>` or pipe it into utility software like `jq`! ::: ## Commands diff --git a/docs/user-guide/faq.md b/docs/user-guide/faq.md index 96258869b2e..7ac9253c971 100644 --- a/docs/user-guide/faq.md +++ b/docs/user-guide/faq.md @@ -15,7 +15,7 @@ More recently, `cardano-wallet` has been using sequential derivation which follo There are two sides to this question. Either, you are referring to accounts as in Ethereum accounts, or you may refer to accounts of hierarchical deterministic wallets. -In the first scenario, assets in the form of accounts are only supported in the Shelley era of Cardano and only for a specific use-case: rewards. Rewards are indeed implicitely published on the blockchain to mitigate the risk of flooding the network at the end of every epoch with rewards payouts! Hence, each core node keeps track of the current value of each reward account in a Ledger. Money can be withdrawn from this account and is then turned as a UTxO. Please note that funds can never be manually sent to a reward account. The creation of a reward account is done when registering a staking key, via a specific type of transaction. +In the first scenario, assets in the form of accounts are only supported in the Shelley era of Cardano and only for a specific use-case: rewards. Rewards are indeed implicitly published on the blockchain to mitigate the risk of flooding the network at the end of every epoch with rewards payouts! Hence, each core node keeps track of the current value of each reward account in a Ledger. Money can be withdrawn from this account and is then turned as a UTxO. Please note that funds can never be manually sent to a reward account. The creation of a reward account is done when registering a staking key, via a specific type of transaction. In the second case, please refer to the [[hierarchical-deterministic-wallets]] section in the _Key concepts_. Cardano wallets typically follow an HD tree of derivation as described in this section. diff --git a/lib/cli/test/unit/Cardano/CLISpec.hs b/lib/cli/test/unit/Cardano/CLISpec.hs index 3d963962f8e..d5f6e45b844 100644 --- a/lib/cli/test/unit/Cardano/CLISpec.hs +++ b/lib/cli/test/unit/Cardano/CLISpec.hs @@ -264,7 +264,7 @@ spec = do (\(desc, arg, tst) -> it desc (parse arg `shouldSatisfy` tst)) [ ("valid", "{ \"42\": { \"string\": \"hi\" } }", ok (Just md)) , ("malformed", "testing", err) - , ("malformed trailling", "{ \"0\": { \"string\": \"\" } } arstneio", err) + , ("malformed trailing", "{ \"0\": { \"string\": \"\" } } arstneio", err) , ("invalid", "{ \"json\": true }", err) , ("null 1", "{ \"0\": null }", err) , ("null 2", "null", ok Nothing) @@ -284,7 +284,7 @@ spec = do , ("valid zero", "0s", ok 0) , ("invalid negative", "-1s", err) , ("invalid fractional", "1.5s", err) - , ("malformed trailling", "1ss", err) + , ("malformed trailing", "1ss", err) , ("malformed suffix", "1", err) , ("malformed empty", "", err) , ("malformed emptyish", "s", err) diff --git a/lib/core-integration/src/Test/Integration/Framework/DSL.hs b/lib/core-integration/src/Test/Integration/Framework/DSL.hs index a5439600510..a7f62d5472f 100644 --- a/lib/core-integration/src/Test/Integration/Framework/DSL.hs +++ b/lib/core-integration/src/Test/Integration/Framework/DSL.hs @@ -204,7 +204,7 @@ module Test.Integration.Framework.DSL , deleteTransactionViaCLI , getTransactionViaCLI - -- utilites + -- utilities , getRetirementEpoch , replaceStakeKey -- * Re-exports @@ -2476,7 +2476,7 @@ verifyMsg desc a = counterexample msg . mapM_ (a &) -- | Can be used to add context to a @HUnitFailure@. -- --- >>> counterexample (show reponse) (0 `shouldBe` 3) +-- >>> counterexample (show response) (0 `shouldBe` 3) -- >>> (Status {statusCode = 200, statusMessage = "OK"},Right []) -- >>> expected: 3 -- >>> but got: 0 diff --git a/lib/core-integration/src/Test/Integration/Plutus.hs b/lib/core-integration/src/Test/Integration/Plutus.hs index e87c7054f26..ceb353a7d1e 100644 --- a/lib/core-integration/src/Test/Integration/Plutus.hs +++ b/lib/core-integration/src/Test/Integration/Plutus.hs @@ -254,7 +254,7 @@ mintBurn_1 = }|] -- The second transaction burn the token minted by the previous one. The token --- isn't explictly listed in the inputs, as we expect the wallet to select the +-- isn't explicitly listed in the inputs, as we expect the wallet to select the -- right input during balancing. -- -- The template has the same three parameters as 'mintBurn_1' @@ -325,7 +325,7 @@ withdrawScript_1 = -- * -- * -- --- The contract was serialised using the suppor code in +-- The contract was serialised using the support code in -- @/extra/Plutus/CurrencyContract.hs@ in this repository. -- -- Assets can be minted by spending a specific UTxO that is hard-wired into diff --git a/lib/core-integration/src/Test/Integration/Scenario/API/Shared/Wallets.hs b/lib/core-integration/src/Test/Integration/Scenario/API/Shared/Wallets.hs index 9e76a1cb511..9fdb21e4c9b 100644 --- a/lib/core-integration/src/Test/Integration/Scenario/API/Shared/Wallets.hs +++ b/lib/core-integration/src/Test/Integration/Scenario/API/Shared/Wallets.hs @@ -757,7 +757,7 @@ spec = describe "SHARED_WALLETS" $ do expectResponseCode HTTP.status403 rPatch expectErrorMessage errMsg403WalletAlreadyActive rPatch - it "SHARED_WALLETS_PATCH_04 - Cannot add cosigner key when delegation script missing and cannot add already existant key to other cosigner" $ \ctx -> runResourceT $ do + it "SHARED_WALLETS_PATCH_04 - Cannot add cosigner key when delegation script missing and cannot add already existent key to other cosigner" $ \ctx -> runResourceT $ do [(_, accXPubTxt0),(_,accXPubTxt1)] <- liftIO $ genXPubs 2 let payloadCreate = Json [json| { "name": "Shared Wallet", diff --git a/lib/core-integration/src/Test/Integration/Scenario/API/Shelley/StakePools.hs b/lib/core-integration/src/Test/Integration/Scenario/API/Shelley/StakePools.hs index 2fc30c38ada..7406d6a5a76 100644 --- a/lib/core-integration/src/Test/Integration/Scenario/API/Shelley/StakePools.hs +++ b/lib/core-integration/src/Test/Integration/Scenario/API/Shelley/StakePools.hs @@ -408,7 +408,7 @@ spec = describe "SHELLEY_STAKE_POOLS" $ do let txid = getFromResponse Prelude.id rq let quitFeeAmt = getFromResponse #amount rq - eventually "Certificates are inserted after quiting a pool" $ do + eventually "Certificates are inserted after quitting a pool" $ do let epg = Link.getTransaction @'Shelley src txid rlg <- request @(ApiTransaction n) ctx epg Default Empty verify rlg diff --git a/lib/core-integration/src/Test/Integration/Scenario/CLI/Shelley/Wallets.hs b/lib/core-integration/src/Test/Integration/Scenario/CLI/Shelley/Wallets.hs index fffdf9dcbb4..36c67f22813 100644 --- a/lib/core-integration/src/Test/Integration/Scenario/CLI/Shelley/Wallets.hs +++ b/lib/core-integration/src/Test/Integration/Scenario/CLI/Shelley/Wallets.hs @@ -414,7 +414,7 @@ spec = describe "SHELLEY_CLI_WALLETS" $ do , ( "-1000 -> fail", "-1000", expectsErr ) , ( "0 -> fail", "0", expectsErr ) , ( "10.5 -> fail", "10.5", expectsErr ) - , ( "arbitraty string -> fail", "string", expectsErr ) + , ( "arbitrary string -> fail", "string", expectsErr ) ] forM_ matrix $ \(title, gap, expects) -> it title $ \ctx -> runResourceT $ do diff --git a/lib/core/bench/db-bench.hs b/lib/core/bench/db-bench.hs index 3b0467d5aff..9f0265aee8d 100644 --- a/lib/core/bench/db-bench.hs +++ b/lib/core/bench/db-bench.hs @@ -473,7 +473,7 @@ mkRndAddresses numAddrs i = -- imagine a transaction with 1 inputs and 200 outputs because, the coin -- selection algorithm always try to consider output independently. So for -- 200 outputs, we know that 200 inputs (at least) would be necessary. There are --- the case for other softwares of course, but we may consider the following +-- the case for other software of course, but we may consider the following -- numbers as realistic benchmark higher bounds (in the worst case): -- -- - 50 inputs diff --git a/lib/core/src/Cardano/Pool/DB.hs b/lib/core/src/Cardano/Pool/DB.hs index af4d2a9ff6c..3d17f58de0c 100644 --- a/lib/core/src/Cardano/Pool/DB.hs +++ b/lib/core/src/Cardano/Pool/DB.hs @@ -310,7 +310,7 @@ determinePoolLifeCycleStatus mReg mRet = case (mReg, mRet) of | regPoolId /= retPoolId -> differentPoolsError | regTime > retTime -> - -- A re-registration always /supercedes/ a prior retirement. + -- A re-registration always /supersedes/ a prior retirement. PoolRegistered regCert | regTime < retTime -> -- A retirement always /augments/ the latest known registration. diff --git a/lib/core/src/Cardano/Pool/DB/Sqlite.hs b/lib/core/src/Cardano/Pool/DB/Sqlite.hs index 340fdab3e56..50eebbe344e 100644 --- a/lib/core/src/Cardano/Pool/DB/Sqlite.hs +++ b/lib/core/src/Cardano/Pool/DB/Sqlite.hs @@ -360,7 +360,7 @@ newDBLayer tr ti SqliteContext{runQuery} = , retryAfter, "IS NULL" , ")" -- Important, since we have a limit, we order all results by - -- earlist "retry_after", so that we are sure that all + -- earliest "retry_after", so that we are sure that all -- metadata gets _eventually_ processed. -- -- Note that `NULL` is smaller than everything. diff --git a/lib/core/src/Cardano/Wallet.hs b/lib/core/src/Cardano/Wallet.hs index 82cfdca23ef..de5c551abab 100644 --- a/lib/core/src/Cardano/Wallet.hs +++ b/lib/core/src/Cardano/Wallet.hs @@ -34,7 +34,7 @@ -- values for this parameter are described in 'Cardano.Wallet.AddressDiscovery' sub-modules. -- For instance @SeqState@ or @Rnd State@. -- --- - @k@: A __k__ey derivation scheme intrisically connected to the underlying discovery +-- - @k@: A __k__ey derivation scheme intrinsically connected to the underlying discovery -- state @s@. This describes how the hierarchical structure of a wallet is -- defined as well as the relationship between secret keys and public -- addresses. @@ -967,8 +967,8 @@ in the checked exceptions or aware of them. Making 'chainSync' aware of the checked exception is currently not a good idea, because this function is used in different contexts, which have different checked exceptions. -So, it would need to be polymorophic in the the undelrying monad, -but at present, 'chainSync' is restricted to 'IO' beause some +So, it would need to be polymorphic in the underlying monad, +but at present, 'chainSync' is restricted to 'IO' because some of its constituents are also restricted to 'IO'. As a workaround / solution, we wrap the checked exception into a new type @@ -1241,7 +1241,7 @@ manageRewardBalance _ ctx wid = db & \DBLayer{..} -> do Left err -> traceWith tr $ MsgRewardBalanceNoSuchWallet err Right () -> pure () Left _err -> - -- Occasionaly failing to query is generally not fatal. It will + -- Occasionally failing to query is generally not fatal. It will -- just update the balance next time the tip changes. pure () traceWith tr MsgRewardBalanceExited @@ -1695,7 +1695,7 @@ balanceTransaction -- -- A promising fix would be to replace the details of 'TransactionCtx' with -- a (balance, fee) based on calling the node/ledger - -- @evaluateTransactionBalance@ on the partial transacion. + -- @evaluateTransactionBalance@ on the partial transaction. let isReg (Cardano.StakePoolRegistrationCertificate _) = True isReg (Cardano.StakeAddressRegistrationCertificate _) = True isReg (Cardano.StakeAddressDeregistrationCertificate _) = True diff --git a/lib/core/src/Cardano/Wallet/Api.hs b/lib/core/src/Cardano/Wallet/Api.hs index 32fd847026e..21a169b793c 100644 --- a/lib/core/src/Cardano/Wallet/Api.hs +++ b/lib/core/src/Cardano/Wallet/Api.hs @@ -1112,7 +1112,7 @@ data ApiLayer s (k :: Depth -> Type -> Type) deriving (Generic) -- | Locks that are held by the wallet in order to enforce --- sequential executation of some API actions. +-- sequential execution of some API actions. -- Used with "Control.Concurrent.Concierge". data WalletLock = PostTransactionOld WalletId deriving (Eq, Ord, Show) diff --git a/lib/core/src/Cardano/Wallet/Api/Server.hs b/lib/core/src/Cardano/Wallet/Api/Server.hs index add8071ef5d..852f59a25bf 100644 --- a/lib/core/src/Cardano/Wallet/Api/Server.hs +++ b/lib/core/src/Cardano/Wallet/Api/Server.hs @@ -2188,7 +2188,7 @@ constructTransaction ctx genChange knownPools getPoolStatus (ApiT wid) body = do Just delegs -> do -- TODO: Current limitation: -- at this moment we are handling just one delegation action: - -- either joining pool, or rejoining or quiting + -- either joining pool, or rejoining or quitting -- When we support multi-account this should be lifted (action, deposit, refund) <- case NE.toList delegs of [(Joining (ApiT pid) _)] -> do @@ -3050,7 +3050,7 @@ getNetworkInformation st nl = liftIO $ do toApiEra (AnyCardanoEra AlonzoEra) = ApiAlonzo -- (network tip, next epoch) - -- May be unavailible if the node is still syncing. + -- May be unavailable if the node is still syncing. networkTipInfo :: RelativeTime -> MaybeT IO (ApiSlotReference, ApiEpochInfo) networkTipInfo now = do networkTipSlot <- interpretQuery ti $ ongoingSlotAt now @@ -3453,7 +3453,7 @@ mkApiTransaction timeInterpreter setTimeReference tx = do -- (pending) when reclaim is coming we have (fee+out) - inp = deposit -- tx is incoming, and the wallet spent for fee and received deposit - fee as out - -- (inLedger) when reclaim is accomodated we have out - inp < deposit as fee was incurred + -- (inLedger) when reclaim is accommodated we have out - inp < deposit as fee was incurred -- So in order to detect this we need to have -- 1. deposit -- 2. have inpsWithoutFee of the wallet non-empty diff --git a/lib/core/src/Cardano/Wallet/Api/Types.hs b/lib/core/src/Cardano/Wallet/Api/Types.hs index fffe7464276..cd931049ef7 100644 --- a/lib/core/src/Cardano/Wallet/Api/Types.hs +++ b/lib/core/src/Cardano/Wallet/Api/Types.hs @@ -1894,7 +1894,7 @@ data ApiOurStakeKey (n :: NetworkDiscriminant) = ApiOurStakeKey { _index :: !Natural , _key :: !(ApiT W.RewardAccount, Proxy n) , _stake :: !(Quantity "lovelace" Natural) - -- ^ The total ada this stake key controlls / is associated with. This + -- ^ The total ada this stake key controls / is associated with. This -- also includes the reward balance. , _rewardBalance :: !(Quantity "lovelace" Natural) -- ^ The current reward balance (not lifetime). @@ -1909,7 +1909,7 @@ data ApiOurStakeKey (n :: NetworkDiscriminant) = ApiOurStakeKey data ApiForeignStakeKey (n :: NetworkDiscriminant) = ApiForeignStakeKey { _key :: !(ApiT W.RewardAccount, Proxy n) , _stake :: !(Quantity "lovelace" Natural) - -- ^ The total ada this stake key controlls / is associated with. This + -- ^ The total ada this stake key controls / is associated with. This -- also includes the reward balance. , _rewardBalance :: !(Quantity "lovelace" Natural) -- ^ The current reward balance (not lifetime). diff --git a/lib/core/src/Cardano/Wallet/CoinSelection/Internal/Balance.hs b/lib/core/src/Cardano/Wallet/CoinSelection/Internal/Balance.hs index e89b7eb95e2..ee3d82ba3fc 100644 --- a/lib/core/src/Cardano/Wallet/CoinSelection/Internal/Balance.hs +++ b/lib/core/src/Cardano/Wallet/CoinSelection/Internal/Balance.hs @@ -1536,7 +1536,7 @@ makeChange criteria userSpecifiedAssetIds = TokenBundle.getAssets (F.fold outputBundles) -- Identifiers and quantities of all non-user-specified assets: assets that - -- were not included in the orginal set of outputs, but that were + -- were not included in the original set of outputs, but that were -- nevertheless selected during the selection process. -- -- Each asset is paired with the complete list of quantities of that asset @@ -1802,7 +1802,7 @@ makeChangeForCoin = flip Coin.unsafePartition -- requires us to add value to the change outputs and burning tokens requires -- us to remove value from the change outputs. -- --- It's also important to note that the change bundle calcualation requires +-- It's also important to note that the change bundle calculation requires -- that the change for user-specified and non-user-specified assets have the -- following properties: -- diff --git a/lib/core/src/Cardano/Wallet/DB.hs b/lib/core/src/Cardano/Wallet/DB.hs index ebbcf2c143d..e9879d8b204 100644 --- a/lib/core/src/Cardano/Wallet/DB.hs +++ b/lib/core/src/Cardano/Wallet/DB.hs @@ -96,7 +96,7 @@ data DBFactory m s k = DBFactory } -- | A Database interface for storing various things in a DB. In practice, --- we'll need some extra contraints on the wallet state that allows us to +-- we'll need some extra constraints on the wallet state that allows us to -- serialize and unserialize it (e.g. @forall s. (Serialize s) => ...@) -- -- NOTE: diff --git a/lib/core/src/Cardano/Wallet/DB/Sqlite.hs b/lib/core/src/Cardano/Wallet/DB/Sqlite.hs index 376ef9e18bc..56e8aa78021 100644 --- a/lib/core/src/Cardano/Wallet/DB/Sqlite.hs +++ b/lib/core/src/Cardano/Wallet/DB/Sqlite.hs @@ -1032,7 +1032,7 @@ mkTxInputsOutputs tx = , txOutTokenQuantity = quantity } ordered f = fmap (zip [0..] . f) - -- | Distribute `a` accross many `b`s using the given function. + -- | Distribute `a` across many `b`s using the given function. -- >>> dist TxOut (addr, [Coin 1, Coin 42, Coin 14]) -- [TxOut addr (Coin 1), TxOut addr (Coin 42), TxOut addr (Coin 14)] dist :: (a -> b -> c) -> (a, [b]) -> [c] diff --git a/lib/core/src/Cardano/Wallet/DB/Sqlite/Migration.hs b/lib/core/src/Cardano/Wallet/DB/Sqlite/Migration.hs index d537e2fd7c4..8434aa3f8e3 100644 --- a/lib/core/src/Cardano/Wallet/DB/Sqlite/Migration.hs +++ b/lib/core/src/Cardano/Wallet/DB/Sqlite/Migration.hs @@ -603,10 +603,10 @@ migrateManually tr proxy defaultFieldValues = -- - Fees -- - Total deposits if any -- - -- To substract deposit values from fees, we consider that any transaction + -- To subtract deposit values from fees, we consider that any transaction -- that has one or less output and fees greater than the key deposit (or min -- utxo value) is a key registration transaction and the key deposit value - -- can be substracted from the delta to deduce the fees. + -- can be subtracted from the delta to deduce the fees. -- -- Note that ideally, we would do this in a single `UPDATE ... FROM` query -- but the `FROM` syntax is only supported in SQLite >= 3.33 which is only diff --git a/lib/core/src/Cardano/Wallet/Primitive/AddressDerivation/Byron.hs b/lib/core/src/Cardano/Wallet/Primitive/AddressDerivation/Byron.hs index d315473878d..41b067e7a80 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/AddressDerivation/Byron.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/AddressDerivation/Byron.hs @@ -301,7 +301,7 @@ changePassphraseRnd (Passphrase oldPwd) (Passphrase newPwd) key = ByronKey -- are any withdrawals). -- -- With 'ByronKey', withdrawals will always be `0`, and the result of this --- function shouldn't be evaluated (relying on lazyness here). If they do, then +-- function shouldn't be evaluated (relying on laziness here). If they do, then -- we're doing something wrong. instance W.HardDerivation ByronKey where type AddressIndexDerivationType ByronKey = 'WholeDomain diff --git a/lib/core/src/Cardano/Wallet/Primitive/AddressDiscovery.hs b/lib/core/src/Cardano/Wallet/Primitive/AddressDiscovery.hs index 970bdc6aae2..4474079fa94 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/AddressDiscovery.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/AddressDiscovery.hs @@ -154,10 +154,10 @@ class KnownAddresses s where coinTypeAda :: Index 'Hardened 'CoinTypeK coinTypeAda = toEnum 0x80000717 --- It is used for geting purpose for a given key. +-- It is used for getting purpose for a given key. class GetPurpose (key :: Depth -> Type -> Type) where getPurpose :: Index 'Hardened 'PurposeK --- It is used for geting account public key for a given state. +-- It is used for getting account public key for a given state. class GetAccount s (key :: Depth -> Type -> Type) | s -> key where getAccount :: s -> key 'AccountK XPub diff --git a/lib/core/src/Cardano/Wallet/Primitive/AddressDiscovery/Shared.hs b/lib/core/src/Cardano/Wallet/Primitive/AddressDiscovery/Shared.hs index 0d0401941e7..4b37e70c157 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/AddressDiscovery/Shared.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/AddressDiscovery/Shared.hs @@ -184,7 +184,7 @@ newSharedAddressPool g payment delegation = -- -- The shared wallet is instantiated with an account public key, derivation path needed to -- recreate it for a holder of this shared wallet, ie., one of the co-signers. --- In order to construct corectly the wallet, ie., enable co-shared script addresses discovery +-- In order to construct correctly the wallet, ie., enable co-shared script addresses discovery -- the following is needed: -- -- - a way to determine what range of indices are checked on the @@ -192,7 +192,7 @@ newSharedAddressPool g payment delegation = -- is used. The idea is to track all indices starting from 0 and up to N. -- N is variable as addresses are discovered (and marked as Used in consequence). -- The pool of addresses is enlarged in such way that the number of consecutive --- Unsed addresses equals to address pool gap of the address pool. Hence, +-- Unused addresses equals to address pool gap of the address pool. Hence, -- the address pool gap needs to be specified. -- -- - script template for payment credential contains information about all collected @@ -200,7 +200,7 @@ newSharedAddressPool g payment delegation = -- determining script structure is provided. In this sense script is predetermined from -- the beginning and can variate only in verification key part that replaces co-signers in the -- script skeleton. The places where a specific cosigner is present is to be replaced --- with the derived verfication key using the co-signer's account public key and +-- with the derived verification key using the co-signer's account public key and -- the index that was chosen. This is the reason why we need complete set of account public keys for -- each co-signer to realize address discovery. The script template can be translated into -- a corresponding script, which hash is used in the address, only when account public keys @@ -324,7 +324,7 @@ activate -- | Possible errors from adding a co-signer key to the shared wallet state. data ErrAddCosigner = NoDelegationTemplate - -- ^ Adding key for a cosigner for a non-existant delegation template is + -- ^ Adding key for a cosigner for a non-existent delegation template is -- not allowed. | NoSuchCosigner CredentialType Cosigner -- ^ Adding key for a cosigners for a given script is possible for the diff --git a/lib/core/src/Cardano/Wallet/Primitive/Delegation/State.hs b/lib/core/src/Cardano/Wallet/Primitive/Delegation/State.hs index 238d8c0dafd..151aa0fa1b0 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/Delegation/State.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/Delegation/State.hs @@ -186,7 +186,7 @@ instance NFData State -- -- (pseudocode; requires a bit more boilerplate to compile) -- --- See the implementaiton of @applyTx@ for how it is used. +-- See the implementation of @applyTx@ for how it is used. data Key0Status = ValidKey0 | MissingKey0 deriving (Eq, Show, Generic) @@ -254,7 +254,7 @@ pointer _ = Nothing -- | A transaction type specific to `DelegationState`. -- --- Intented to be converted both from and to a more real transaction type. +-- Intended to be converted both from and to a more real transaction type. -- -- When constructing a real transaction from `Tx`, these `outputs` -- should appear before other outputs. In the theoretical event that there's diff --git a/lib/core/src/Cardano/Wallet/Primitive/Model.hs b/lib/core/src/Cardano/Wallet/Primitive/Model.hs index 6f54a0c6c89..ef16862d4de 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/Model.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/Model.hs @@ -343,7 +343,7 @@ totalUTxO pending (Wallet u _ s) = spent = F.foldMap' getSpentTxIn pending -- NOTE: In 'availableUTxO', we exclude UTxO committed as collateral, but - -- not here. Since the total UTxO set is indended to be a projection of how + -- not here. Since the total UTxO set is indented to be a projection of how -- the UTxO set would look if all pending transactions are applied -- successfully: if a transaction is applied successfully, then its -- collateral inputs cannot be consumed. diff --git a/lib/core/src/Cardano/Wallet/Primitive/SyncProgress.hs b/lib/core/src/Cardano/Wallet/Primitive/SyncProgress.hs index 8b980e6d8f7..7b28e3e2fe4 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/SyncProgress.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/SyncProgress.hs @@ -108,7 +108,7 @@ instance FromText SyncTolerance where -- Hence, the progress percentage will often be < 100%, -- as the slot corresponding to the current wall-clock time -- may not be filled with a block. --- The sync tolerance should be large enough to accomodate this issue. +-- The sync tolerance should be large enough to accommodate this issue. syncProgress :: (HasCallStack, Monad m) => SyncTolerance diff --git a/lib/core/src/Cardano/Wallet/Primitive/Types.hs b/lib/core/src/Cardano/Wallet/Primitive/Types.hs index 222f8951ff7..1a8146066cb 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/Types.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/Types.hs @@ -567,7 +567,7 @@ isSubrangeOf r1 r2 = data PoolMetadataGCStatus = NotApplicable | NotStarted - | Restarting POSIXTime -- shows last GC before restart occured + | Restarting POSIXTime -- shows last GC before restart occurred | HasRun POSIXTime -- shows last GC deriving (Eq, Show, Generic) diff --git a/lib/core/src/Cardano/Wallet/Primitive/Types/UTxO.hs b/lib/core/src/Cardano/Wallet/Primitive/Types/UTxO.hs index 4ff11b6f8f3..9497c0dfc0e 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/Types/UTxO.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/Types/UTxO.hs @@ -20,7 +20,7 @@ module Cardano.Wallet.Primitive.Types.UTxO UTxO (..) , UTxOStatistics (..) - -- * Auxilliary types + -- * Auxiliary types , BoundType , Dom (..) , HistogramBar (..) diff --git a/lib/core/src/Cardano/Wallet/Primitive/Types/UTxOIndex/Internal.hs b/lib/core/src/Cardano/Wallet/Primitive/Types/UTxOIndex/Internal.hs index 38b3c8c0bf5..a2f1e14cbf2 100644 --- a/lib/core/src/Cardano/Wallet/Primitive/Types/UTxOIndex/Internal.hs +++ b/lib/core/src/Cardano/Wallet/Primitive/Types/UTxOIndex/Internal.hs @@ -205,7 +205,7 @@ singleton u b = insertUnsafe u b empty -- -- If the given sequence contains more than one mapping for the same UTxO -- identifier, the mapping that appears latest in the sequence will take --- precendence, and all others will be ignored. +-- precedence, and all others will be ignored. -- fromSequence :: (Foldable f, Ord u) => f (u, TokenBundle) -> UTxOIndex u fromSequence = flip insertMany empty diff --git a/lib/core/src/Cardano/Wallet/Registry.hs b/lib/core/src/Cardano/Wallet/Registry.hs index 12fe77c59f3..f29b699a985 100644 --- a/lib/core/src/Cardano/Wallet/Registry.hs +++ b/lib/core/src/Cardano/Wallet/Registry.hs @@ -155,7 +155,7 @@ unregister registry k = Worker -------------------------------------------------------------------------------} --- | A worker which holds and manipulate a paticular acquired resource. That +-- | A worker which holds and manipulate a particular acquired resource. That -- resource can be, for example, a handle to a database connection. data Worker key resource = Worker { workerId :: key diff --git a/lib/core/src/Network/Ntp.hs b/lib/core/src/Network/Ntp.hs index 37359a129a8..fe7f23679b0 100644 --- a/lib/core/src/Network/Ntp.hs +++ b/lib/core/src/Network/Ntp.hs @@ -8,7 +8,7 @@ -- License: Apache-2.0 -- -- This module provides the Ntp client related settings, types --- and re-exports used in a number of places throught codebase. +-- and re-exports used in a number of places throughout codebase. module Network.Ntp ( withWalletNtpClient diff --git a/lib/core/src/Ouroboros/Network/Client/Wallet.hs b/lib/core/src/Ouroboros/Network/Client/Wallet.hs index d21aea146bd..a245fed1003 100644 --- a/lib/core/src/Ouroboros/Network/Client/Wallet.hs +++ b/lib/core/src/Ouroboros/Network/Client/Wallet.hs @@ -331,7 +331,7 @@ chainSyncWithBlocks tr chainFollower = clientStNegotiateGenesis } - -- Explictly negotiate the genesis point + -- Explicitly negotiate the genesis point clientStNegotiateGenesis :: m (P.ClientPipelinedStIdle 'Z block (Point block) (Tip block) m Void) clientStNegotiateGenesis = do @@ -673,7 +673,7 @@ localTxSubmission queue = LocalTxSubmissionClient clientStIdle -- quantified type. -- In typical use, the @cmd m@ involves existential quantification over -- the type @a@, so that the 'TQueue' has elements with a monomorphic type. --- However, the type signature of `send` allows us to retrive this particular +-- However, the type signature of `send` allows us to retrieve this particular -- type @a@ for later use again. send :: MonadSTM m diff --git a/lib/core/test/unit/Cardano/Byron/Codec/CborSpec.hs b/lib/core/test/unit/Cardano/Byron/Codec/CborSpec.hs index be148c75ab8..e8e776024e0 100644 --- a/lib/core/test/unit/Cardano/Byron/Codec/CborSpec.hs +++ b/lib/core/test/unit/Cardano/Byron/Codec/CborSpec.hs @@ -157,7 +157,7 @@ data DecodeDerivationPath = DecodeDerivationPath , addrIndex :: Word32 } deriving (Show, Eq) --- An aribtrary mnemonic sentence for the tests +-- An arbitrary mnemonic sentence for the tests arbitraryMnemonic :: [Text] arbitraryMnemonic = [ "price", "whip", "bottom", "execute", "resist", "library" diff --git a/lib/core/test/unit/Cardano/Pool/DB/Arbitrary.hs b/lib/core/test/unit/Cardano/Pool/DB/Arbitrary.hs index 13ab8d2b87f..d7bc3a1cca1 100644 --- a/lib/core/test/unit/Cardano/Pool/DB/Arbitrary.hs +++ b/lib/core/test/unit/Cardano/Pool/DB/Arbitrary.hs @@ -171,7 +171,7 @@ instance Arbitrary PoolId where where z = toEnum 0 --- NOTE Excepted to have a reasonnably small entropy +-- NOTE Excepted to have a reasonably small entropy instance Arbitrary PoolOwner where arbitrary = do byte <- elements ['0'..'8'] diff --git a/lib/core/test/unit/Cardano/Pool/DB/Properties.hs b/lib/core/test/unit/Cardano/Pool/DB/Properties.hs index c36d8282a0e..586bd163fef 100644 --- a/lib/core/test/unit/Cardano/Pool/DB/Properties.hs +++ b/lib/core/test/unit/Cardano/Pool/DB/Properties.hs @@ -1219,7 +1219,7 @@ prop_determinePoolLifeCycleStatus_orderCorrect regData retData = where prop | regTime > retTime = - -- A re-registration always /supercedes/ a prior retirement. + -- A re-registration always /supersedes/ a prior retirement. result `shouldBe` PoolRegistered regCert | regTime < retTime = -- A retirement always /augments/ the latest registration. diff --git a/lib/core/test/unit/Cardano/Wallet/DB/SqliteSpec.hs b/lib/core/test/unit/Cardano/Wallet/DB/SqliteSpec.hs index 77d3afb9898..7b71bb2b2f5 100644 --- a/lib/core/test/unit/Cardano/Wallet/DB/SqliteSpec.hs +++ b/lib/core/test/unit/Cardano/Wallet/DB/SqliteSpec.hs @@ -511,7 +511,7 @@ fileModeSpec = do testTxs mempty - it "put and read tx history (Decending)" $ \f -> do + it "put and read tx history (Descending)" $ \f -> do withShelleyFileDBLayer f $ \DBLayer{..} -> do atomically $ do unsafeRunExceptT $ diff --git a/lib/core/test/unit/Cardano/Wallet/Primitive/AddressDiscovery/RandomSpec.hs b/lib/core/test/unit/Cardano/Wallet/Primitive/AddressDiscovery/RandomSpec.hs index 6ea1cd3381d..ed07387c308 100644 --- a/lib/core/test/unit/Cardano/Wallet/Primitive/AddressDiscovery/RandomSpec.hs +++ b/lib/core/test/unit/Cardano/Wallet/Primitive/AddressDiscovery/RandomSpec.hs @@ -264,8 +264,8 @@ propSpec = parallel $ describe "Random Address Discovery Properties" $ do property prop_derivedKeysAreOwned it "GenChange address always satisfies isOurs" $ do property prop_changeAddressesBelongToUs - it "each address discovered by isOurs is in forbiden addresses and different than change address" $ do - property prop_forbiddenAddreses + it "each address discovered by isOurs is in forbidden addresses and different than change address" $ do + property prop_forbiddenAddresses it "address that are discovered via isOurs are marked as 'Used'" $ do property prop_oursAreUsed @@ -310,11 +310,11 @@ prop_changeAddressesBelongToUs (Rnd st rk pwd) (Rnd st' _ _) = where (addr, _) = genChange (rk, pwd) st -prop_forbiddenAddreses +prop_forbiddenAddresses :: Rnd -> Index 'WholeDomain 'AddressK -> Property -prop_forbiddenAddreses rnd@(Rnd st rk pwd) addrIx = conjoin +prop_forbiddenAddresses rnd@(Rnd st rk pwd) addrIx = conjoin [ (Set.notMember addr (forbidden st)) , (Set.member addr (forbidden isOursSt)) , (Set.notMember changeAddr (forbidden isOursSt)) diff --git a/lib/core/test/unit/Cardano/Wallet/Primitive/Delegation/StateSpec.hs b/lib/core/test/unit/Cardano/Wallet/Primitive/Delegation/StateSpec.hs index 2ee4953ab9e..0e549f9e26b 100644 --- a/lib/core/test/unit/Cardano/Wallet/Primitive/Delegation/StateSpec.hs +++ b/lib/core/test/unit/Cardano/Wallet/Primitive/Delegation/StateSpec.hs @@ -162,11 +162,11 @@ spec = do it "no rejected txs, normally" $ property prop_noRejectedTxs - -- Lots of weird things can happen when we concider concurrent user-actions + -- Lots of weird things can happen when we consider concurrent user-actions -- on multiple wallet versions and rollbacks. -- -- Whatever happens, we should be able to recover using a single - -- @CmdSetPortfolioOf n@, and be concistent with the ledger. + -- @CmdSetPortfolioOf n@, and be consistent with the ledger. it "can recover from dropped transactions" $ withMaxSuccess 2000 prop_rollbacks @@ -347,7 +347,7 @@ data Cmd -- ^ A wallet implementation without multi-stake-key support could decide -- to either - -- 1. register stake-key 0 witout adding a pointer UTxO + -- 1. register stake-key 0 without adding a pointer UTxO -- 2. de-register stake-key 0 despite despite e.g. key 1 being active -- depending on whether it is registered or not. -- diff --git a/lib/core/test/unit/Cardano/Wallet/Primitive/SlottingSpec.hs b/lib/core/test/unit/Cardano/Wallet/Primitive/SlottingSpec.hs index e301fd3bc21..853a17061d5 100644 --- a/lib/core/test/unit/Cardano/Wallet/Primitive/SlottingSpec.hs +++ b/lib/core/test/unit/Cardano/Wallet/Primitive/SlottingSpec.hs @@ -109,7 +109,7 @@ spec = do it "slotRangeFromTimeRange and slotRangeFromTimeRange'" $ withMaxSuccess 10000 $ property $ \t0 sp timeRange -> do - -- NOTE: The old impementation breaks for large times / + -- NOTE: The old implementation breaks for large times / -- slotNos. After only generating SlotLengths of 1s or -- bigger, it should hopefully always work. let res = runIdentity $ interpretQuery diff --git a/lib/core/test/unit/Cardano/Wallet/RegistrySpec.hs b/lib/core/test/unit/Cardano/Wallet/RegistrySpec.hs index bfd1272bfdf..c3ef723627a 100644 --- a/lib/core/test/unit/Cardano/Wallet/RegistrySpec.hs +++ b/lib/core/test/unit/Cardano/Wallet/RegistrySpec.hs @@ -222,7 +222,7 @@ instance HasWorkerCtx DummyResource DummyCtx where type WorkerKey DummyCtx = WalletId hoistResource _ _ = id --- A reasonnably 'long' delay to test asynchronous race conditions, in us +-- A reasonably 'long' delay to test asynchronous race conditions, in us newtype Delay = Delay Int deriving Show data WorkerTest ctx res = WorkerTest diff --git a/lib/dbvar/src/Data/DBVar.hs b/lib/dbvar/src/Data/DBVar.hs index 188f72cc1bc..5f33cae9800 100644 --- a/lib/dbvar/src/Data/DBVar.hs +++ b/lib/dbvar/src/Data/DBVar.hs @@ -9,7 +9,7 @@ module Data.DBVar ( -- * Synopsis -- | 'DBVar' represents a mutable variable whose value is kept in memory, -- but which is written to the hard drive on every update. - -- This provides a convient interface for persisting + -- This provides a convenient interface for persisting -- values across program runs. -- For efficient updates, delta encodings are used, see "Data.Delta". -- @@ -162,7 +162,7 @@ newWithCache update a = do mask $ \restore -> do -- We mask asynchronous exceptions here -- to ensure that the TVar will be updated - -- whenever @update@ suceeds without exception. + -- whenever @update@ succeeds without exception. restore $ update old delta atomically $ writeTVar cache new pure b @@ -202,7 +202,7 @@ A 'Store' is characterized by the following properties: is returned, where the exception @e@ gives more information about the failure. - However, loading a value after writing it should always suceed, + However, loading a value after writing it should always succeed, we have > writeS s a >> loadS s = pure (Right a) @@ -229,7 +229,7 @@ A 'Store' is characterized by the following properties: It is expected that the functions 'loadS', 'updateS', 'writeS' do not throw synchronous exceptions. In the worst case, 'loadS' should return 'Nothing' after reading or writing - to the store was unsuccesful. + to the store was unsuccessful. * __Concurrency__: It is expected that the functions 'updateS' and 'writeS' @@ -380,7 +380,7 @@ embedStore embed bstore = do writeMachine mab update a da = do readMachine >>= \case - Nothing -> do -- we were missing the inital write + Nothing -> do -- we were missing the initial write write (apply da a) Just mab1 -> do -- advance the machine by one step let (db, mab2) = step_ mab1 (a,da) @@ -410,7 +410,7 @@ embedStore' Embedding'{load,write,update} Store{loadS,writeS,updateS} = Store -- -- WARNING: The 'updateS' and 'writeS' functions of the result are not atomic -- in the presence of asynchronous exceptions. --- For example, the update of the first store may suceed while the update of +-- For example, the update of the first store may succeed while the update of -- the second store may fail. -- In other words, this combinator works for some monads, such as @m = @'STM', -- but fails for others, such as @m = 'IO'@. diff --git a/lib/dbvar/src/Data/Table.hs b/lib/dbvar/src/Data/Table.hs index 0d475f0ca69..006b95b7ba0 100644 --- a/lib/dbvar/src/Data/Table.hs +++ b/lib/dbvar/src/Data/Table.hs @@ -7,7 +7,7 @@ module Data.Table ( -- Each row has a unique ID, but this is transparent to the API user. -- -- 'Pile' models a set of values. - -- Unlike 'Set', it is represented as a leightweight list. + -- Unlike 'Set', it is represented as a lightweight list. -- This is used to highlight that the ordering of rows -- in a 'Table' is /not/ deterministic. -- @@ -140,7 +140,7 @@ instance Delta (DeltaTable row) where apply (DeleteWhere p) = deleteWhere p apply (UpdateWhere p f) = updateWhere p f --- | Delta encoding for changes to a database table with uniqe IDs. +-- | Delta encoding for changes to a database table with unique IDs. data DeltaDB key row = InsertManyDB [(key, row)] | DeleteManyDB [key] diff --git a/lib/shelley/exe/local-cluster.hs b/lib/shelley/exe/local-cluster.hs index c83305bd933..fbfb7abd2cc 100644 --- a/lib/shelley/exe/local-cluster.hs +++ b/lib/shelley/exe/local-cluster.hs @@ -154,7 +154,7 @@ import qualified Data.Text as T -- , "salute", "hybrid", "stone", "smart" -- ] -- --- - (Byron) Has 200 UTxO, 100 are worth 1 Lovelace, 100 are woth 100_000 Ada. +-- - (Byron) Has 200 UTxO, 100 are worth 1 Lovelace, 100 are worth 100_000 Ada. -- -- [ "collect", "fold", "file", "clown" -- , "injury", "sun", "brass", "diet" diff --git a/lib/shelley/src/Cardano/Wallet/Shelley/Launch.hs b/lib/shelley/src/Cardano/Wallet/Shelley/Launch.hs index e061f15ba9f..28e5b64537a 100644 --- a/lib/shelley/src/Cardano/Wallet/Shelley/Launch.hs +++ b/lib/shelley/src/Cardano/Wallet/Shelley/Launch.hs @@ -95,7 +95,7 @@ import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Text.Encoding.Error as T --- | Shelley hard fork network configuration has two genesis datas. +-- | Shelley hard fork network configuration has two genesis data. -- As a special case for mainnet, we hardcode the byron genesis data. data NetworkConfiguration where -- | Mainnet does not have network discrimination. diff --git a/lib/shelley/src/Cardano/Wallet/Shelley/Pools.hs b/lib/shelley/src/Cardano/Wallet/Shelley/Pools.hs index 2480090ebff..c735fb8a7ef 100644 --- a/lib/shelley/src/Cardano/Wallet/Shelley/Pools.hs +++ b/lib/shelley/src/Cardano/Wallet/Shelley/Pools.hs @@ -659,7 +659,7 @@ monitorStakePools tr (NetworkParameters gp sp _pp) nl DBLayer{..} = -- However, assuming the rollback window is always guaranteed to be less -- than one epoch in length, retirements that occurred two epochs ago can -- no longer be affected by rollbacks. Therefore, if we see a retirement - -- that occurred two epochs ago that has not subsquently been superseded, + -- that occurred two epochs ago that has not subsequently been superseded, -- it should be safe to garbage collect that pool. -- garbageCollectPools currentSlot latestGarbageCollectionEpochRef = do @@ -789,7 +789,7 @@ monitorMetadata gcStatus tr sp db@(DBLayer{..}) = do endlessly :: Monad m => a -> (a -> m a) -> m Void endlessly zero action = action zero >>= (`endlessly` action) - -- | Run an action asyncronously only when there's an available seat. + -- | Run an action asynchronously only when there's an available seat. -- Seats are materialized by a bounded queue. If the queue is full, -- then there's no seat. withAvailableSeat :: TBQueue () -> IO a -> IO () diff --git a/lib/shelley/src/Cardano/Wallet/Shelley/Transaction.hs b/lib/shelley/src/Cardano/Wallet/Shelley/Transaction.hs index 85e0f85bc69..5c2244f529a 100644 --- a/lib/shelley/src/Cardano/Wallet/Shelley/Transaction.hs +++ b/lib/shelley/src/Cardano/Wallet/Shelley/Transaction.hs @@ -266,7 +266,7 @@ data TxPayload era = TxPayload -- ^ Certificates to be included in the transactions. , _extraWitnesses :: Cardano.TxBody era -> [Cardano.KeyWitness era] - -- ^ Create payload-specific witesses given the unsigned transaction body. + -- ^ Create payload-specific witnesses given the unsigned transaction body. -- -- Caller has the freedom and responsibility to provide the correct -- witnesses for what they're trying to do. @@ -394,7 +394,7 @@ signTransaction , WalletKey k ) => Cardano.NetworkId - -- ^ Network identifer (e.g. mainnet, testnet) + -- ^ Network identifier (e.g. mainnet, testnet) -> (RewardAccount -> Maybe (XPrv, Passphrase "encryption")) -- ^ Stake key store / reward account resolution -> (Address -> Maybe (k 'AddressK XPrv, Passphrase "encryption")) @@ -462,7 +462,7 @@ signTransaction networkId resolveRewardAcct resolveAddress resolveInput (body, w -- NOTE: We cannot resolve key hashes directly, so create a one-time -- temporary address with that key hash which is fine to lookup via the -- address lookup provided above. It works _fine_ because the discovery - -- of addresses is done properly based on the address constituants (i.e. + -- of addresses is done properly based on the address constituents (i.e. -- the key hash) and not the overall address itself. let addr = Cardano.makeShelleyAddress networkId (Cardano.PaymentCredentialByKey vkh) diff --git a/lib/shelley/test/data/cardano-node-shelley/byron-genesis.yaml b/lib/shelley/test/data/cardano-node-shelley/byron-genesis.yaml index e75b8fa6f84..98a7dd07ec4 100644 --- a/lib/shelley/test/data/cardano-node-shelley/byron-genesis.yaml +++ b/lib/shelley/test/data/cardano-node-shelley/byron-genesis.yaml @@ -1251,7 +1251,7 @@ nonAvvmBalances: - DdzFFzCqrht53PjyZUcneCYf9CGnHxnpc8fbsqjhVRNu8zx9onVDX5rS623SfAJ4enUZseRsFehCYXoTiMFnZrrXk9daNs87EMVPupzs: '100000000000' - DdzFFzCqrhsdwALkqZUNTYvqq1cM1HDP9iXzWfEwJktgnutkDDzhEKRYa5u6DLf2Qbgo8bSEhNjrjVAFRK5CrHH9tvxhSDoV3u3xG1P7: '100000000000' - # A special Byron Wallet comming from ["suffer", "decorate", "head", "opera", "yellow", "debate", "visa", "fire", "salute", "hybrid", "stone", "smart"] + # A special Byron Wallet coming from ["suffer", "decorate", "head", "opera", "yellow", "debate", "visa", "fire", "salute", "hybrid", "stone", "smart"] # # with with only dust - DdzFFzCqrhsz56VqWWAQpRMcSFYE1WKeuFcVzV9UpovnJghF4YmV7TkMLNh1GCHftUBNEZQ2h3fCKsb25syBYrd1Qob2XkyeS6vgDzQ8: '1' diff --git a/lib/test-utils/src/Test/Hspec/Goldens.hs b/lib/test-utils/src/Test/Hspec/Goldens.hs index 8330dfb5b3b..5376fa4941a 100644 --- a/lib/test-utils/src/Test/Hspec/Goldens.hs +++ b/lib/test-utils/src/Test/Hspec/Goldens.hs @@ -15,7 +15,7 @@ -- ".win" to the golden file name. -- -- This seems to work for now with just two windows specific goldens, but if --- there are more, it might be more conventient if windows goldens always are +-- there are more, it might be more convenient if windows goldens always are -- separate, as OVERWRITE_GOLDENS will never currently write the .win version. module Test.Hspec.Goldens ( Settings (..) diff --git a/lib/test-utils/src/Test/Utils/Roundtrip.hs b/lib/test-utils/src/Test/Utils/Roundtrip.hs index e18c993003c..2c7e4759341 100644 --- a/lib/test-utils/src/Test/Utils/Roundtrip.hs +++ b/lib/test-utils/src/Test/Utils/Roundtrip.hs @@ -45,7 +45,7 @@ import Web.HttpApiData -- -- ...will compare @ToJSON@ of @Wallet@ against `Wallet.json`. It may either -- match and succeed, or fail and write `Wallet.faulty.json` to disk with the --- new format. Faulty golden files should /not/ be commited. +-- new format. Faulty golden files should /not/ be committed. -- -- The directory `test/data/Cardano/Wallet/Api` is used. jsonRoundtripAndGolden diff --git a/nix/haskell.nix b/nix/haskell.nix index a7a7d5f251b..2b2db0e3610 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -210,7 +210,7 @@ haskell-nix: haskell-nix.stackProject' [ # # An hypothesis is that #2472 is caused by heavy load and unfocused # resources from running the tests concurrently, risking that the slowest - # hspec runner - and thererefore the stdout - being silent for 900s causing + # hspec runner - and therefore the stdout - being silent for 900s causing # hydra to timeout. # # Setting -j 1 should hopefully focus the resource we have in one place. It @@ -233,7 +233,7 @@ haskell-nix: haskell-nix.stackProject' [ # default number of build cores. # # To alleviate TimeInterpreter race conditions on the mac builders - # since #2755, we run slightly less in paralell on macOS. + # since #2755, we run slightly less in parallel on macOS. integration.testFlags = if pkgs.stdenv.hostPlatform.isDarwin then [ "-j" "2" ] diff --git a/reports/security/2020-01-21.md b/reports/security/2020-01-21.md index cb8370f8414..24ae2dd527e 100644 --- a/reports/security/2020-01-21.md +++ b/reports/security/2020-01-21.md @@ -10,7 +10,7 @@ (c) introduce rate-limiter with 429 Too Many Requests header 4. If cardano-wallet is to be served (publicly/privately) then a lot of stuff needs to be addressed (besides all in point 3): (a) make more restrictive usage of DB : add users with operation granting - (b) All security mechanism embracing proper authencation/logging analytics/encryption + (b) All security mechanism embracing proper authentication/logging analytics/encryption ## OWASP risks @@ -61,7 +61,7 @@ deleteLoose "tx_out" ``` So it is secure too. -**Conclusion** : Sqlite impl of DBLayer is resistant from direct injection intrusion (so called First Order Attack) because of escape of any character measure adopted in persitent library in the methods we use throught our code. The only use of raw execution does not allow to inject any text from input parameters, hence is immune from this kind of attacks. +**Conclusion** : Sqlite impl of DBLayer is resistant from direct injection intrusion (so called First Order Attack) because of escape of any character measure adopted in persistent library in the methods we use throughout our code. The only use of raw execution does not allow to inject any text from input parameters, hence is immune from this kind of attacks. If cardano-wallet API part will become part of other component that will be deployed publicly, it would be good to consider creating restrictive user as a consequence of principle of least authority (POLA) - ie., user/processes in the system will be given only those permissions needed to its job, no more, no less. So, if we identify that user does need to DROP/DELETE then we could add something like that upon DB creation: ``` @@ -115,7 +115,7 @@ Logging in lib/jormungandr/exe/cardano-wallet-jormungandr.hs, lib/core/src/Carda Logging is emitted to stdout and there is no way to change it now being the user of cardano-wallet. Daedalus, using cardano-wallet inside, realizes rotation based logging itself. It is set, user cannot control it. Moreover, it includes also logs from its layer. Some users, though, use cardano-wallet without Daedalus. -**Conclusions** : Logs land to stdout, which has its pros and cons (it can be lost when terminal is set and by definition is less persistant). It would be good to add option for rotation, and embrace possibilities of iohk-monitoring-framework : https://github.com/input-output-hk/iohk-monitoring-framework/blob/bea0e079fc32ed316ce352d17d14199a680e3f6c/iohk-monitoring/src/Cardano/BM/Data/Rotation.lhs#L29 +**Conclusions** : Logs land to stdout, which has its pros and cons (it can be lost when terminal is set and by definition is less persistent). It would be good to add option for rotation, and embrace possibilities of iohk-monitoring-framework : https://github.com/input-output-hk/iohk-monitoring-framework/blob/bea0e079fc32ed316ce352d17d14199a680e3f6c/iohk-monitoring/src/Cardano/BM/Data/Rotation.lhs#L29 Maybe it is even good to set this as default - users with problems could then immediately share logs with us. ### OWASP risk : Security Misconfiguration @@ -131,7 +131,7 @@ d - . (**to be addressed**). Adding other standard security headers in API's res ("X-Content-Type-Options", "nosniff") - prevent browser guessing Content-Type ("X-Frame-Options", "deny") - prevent API responses being loaded in a frame or iframe ("Cache-Control","private, max-age=0") - control whether browser/proxies can cache content in the response and how long for -("Content-Security-Policy", "default-src 'none'; frame-ancestors 'none'; sandbox") - restricing where script can be loaded - so called CSP +("Content-Security-Policy", "default-src 'none'; frame-ancestors 'none'; sandbox") - restricting where script can be loaded - so called CSP ``` e - (**ok**). Do not specify server version in order to avoid attacks pertinent to version-known vulnerabilities. Due to nature of open source we cannot do anything about it - anyone can check what server we use. @@ -160,7 +160,7 @@ Here, huge number of options are available (starting from simple ones) (d) audit logging (so extend current logging by adding authorization logs). Consider using DB solution for logging (as a way to have in-house analytics on top of it or just try to use elasticsearch or summologic solutions directly on logs) (e) access control - differentiate actions AFTER authorization (401 vs 403). Think about Access Control Lists (ACL) and privilege escalation. -Generally speaking the above security mechanisms (ie., security controls of rate-limiting, encryption, authentication and audit logging), when properly applied, can address STRIDE threat (Spoofing, Tampering, Repudation, Information disclosure, Denial of service, Elevation of privilege). +Generally speaking the above security mechanisms (ie., security controls of rate-limiting, encryption, authentication and audit logging), when properly applied, can address STRIDE threat (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege). Given the assumption, though, I think it would be beneficial to introduce rate-limiter solution to cardano-wallet and to have a solution that throttle number of calls possible to API (even trusted application can do it unintentionally). If this happens, then adequate response will be emitted. @@ -173,4 +173,4 @@ and depending on number of request set in a given period for some of them we sho ``` 429 Too Many Requests ``` -**Conclusions** : consider adding rate limiter as sketched above. If the assumption is not valid anymore (ie., local API with localhost listenning talking with trusted app with colocation) then all security mechanisms enumerated above needs to be implemented in order to address STRIDE threat. +**Conclusions** : consider adding rate limiter as sketched above. If the assumption is not valid anymore (ie., local API with localhost listening talking with trusted app with colocation) then all security mechanisms enumerated above needs to be implemented in order to address STRIDE threat. diff --git a/scripts/connect_wallet.rb b/scripts/connect_wallet.rb index c5e93065f6f..799e5fde539 100755 --- a/scripts/connect_wallet.rb +++ b/scripts/connect_wallet.rb @@ -3,7 +3,7 @@ require 'cardano_wallet' timeout = 100 -treshold = Time.now + timeout +threshold = Time.now + timeout def is_connected? begin @@ -14,7 +14,7 @@ def is_connected? end end -while (is_connected? == false && (Time.now <= treshold)) +while (is_connected? == false && (Time.now <= threshold)) puts "Wallet is not up yet... will check again in 5 seconds" sleep 5 end diff --git a/scripts/make_release.sh b/scripts/make_release.sh index d2117485c01..e583d640b49 100755 --- a/scripts/make_release.sh +++ b/scripts/make_release.sh @@ -5,7 +5,7 @@ set -euo pipefail # A handy utility for filling in the github RELEASE_TEMPLATE. -# Since we are using nix, this script shoud work whether on linux or mac. +# Since we are using nix, this script should work whether on linux or mac. # # NOTE: This script will target the LATEST wiki version. Make sure the # wiki hasn't changed undesirably since the release tag. @@ -42,7 +42,7 @@ tag_cabal_ver_re() { } ################################################################################ -# Interactively change the release-specific parameter by promting the caller, and +# Interactively change the release-specific parameter by prompting the caller, and # mutating the script itself. echo "Previous release: $GIT_TAG" diff --git a/specifications/api/swagger.yaml b/specifications/api/swagger.yaml index 68d8e5c57da..c253d389488 100644 --- a/specifications/api/swagger.yaml +++ b/specifications/api/swagger.yaml @@ -335,7 +335,7 @@ x-assetQuantity: &assetQuantity x-assetValueNode: &assetValueNode description: Map of asset values along with their quantities. - assetName in field name is expected (max lenght 64-character hex-encoded text) + assetName in field name is expected (max length 64-character hex-encoded text) type: object additionalProperties: *assetQuantity # Note: propertyNames pattern not supported in current OpenAPI version. @@ -469,9 +469,9 @@ x-validationLevel: &validationLevel * 'all' is non-empty * there are redundant timelocks in a given level * there are no duplicated verification keys in a given level - * 'at_least' coeffcient is positive + * 'at_least' coefficient is positive * 'all', 'any' are non-empty and `'at_least' has no less elements in the list - than the coeffcient after timelocks are filtered out. + than the coefficient after timelocks are filtered out. type: string enum: @@ -3324,7 +3324,7 @@ components: <<: *transactionNoAmountOutputs ApiConstructTransactionData: &ApiConstructTransactionData - description: At least one field needs to be choosen + description: At least one field needs to be chosen type: object properties: payments: *ApiPaymentDestination @@ -3453,7 +3453,7 @@ components: are not associated with an identifiable stake key. Most likely, these funds are associated with enterprise addresses lacking staking rights. - But they /could/ also be associate with more rare types of addreses like pointer addresses. + But they /could/ also be associate with more rare types of addresses like pointer addresses. ApiStakeKeys: &ApiStakeKeys type: object required: diff --git a/test/e2e/README.md b/test/e2e/README.md index 184b149ec5b..373a943cbdf 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -9,7 +9,7 @@ [![Docker-compose Linux](https://github.com/input-output-hk/cardano-wallet/actions/workflows/docker_linux.yml/badge.svg)](https://github.com/input-output-hk/cardano-wallet/actions/workflows/docker_linux.yml) [![Docker-compose MacOS](https://github.com/input-output-hk/cardano-wallet/actions/workflows/docker_macos.yml/badge.svg)](https://github.com/input-output-hk/cardano-wallet/actions/workflows/docker_macos.yml) -E2E functional tests of cardano-wallet are running nightly on [cardano testnet](https://testnets.cardano.org/en/cardano/overview/). Running tests against public testnet allows to excercise cardano-wallet on environment close to production (mainnet) utilizing and integrating maximally all components of the Cardano ecosystem like Stake pools, SMASH, metadata token server etc. +E2E functional tests of cardano-wallet are running nightly on [cardano testnet](https://testnets.cardano.org/en/cardano/overview/). Running tests against public testnet allows to exercise cardano-wallet on environment close to production (mainnet) utilizing and integrating maximally all components of the Cardano ecosystem like Stake pools, SMASH, metadata token server etc. ## Running tests diff --git a/test/manual/ConnectionLostWithTheNode.md b/test/manual/ConnectionLostWithTheNode.md index 0c491afe08a..9dfbc9eb2b8 100644 --- a/test/manual/ConnectionLostWithTheNode.md +++ b/test/manual/ConnectionLostWithTheNode.md @@ -1,5 +1,5 @@ -# Test cardano-wallet recovers after losing conection with cardano-node +# Test cardano-wallet recovers after losing connection with cardano-node ## OS