Permalink
Browse files

[BIP44-239] More style

  • Loading branch information...
uroboros committed Feb 11, 2019
1 parent 59b5310 commit 5924e74bfd35b81d3dcded04646dc14c678b48e2
@@ -125,8 +125,8 @@ import qualified Pos.Crypto as Core

import Cardano.Wallet.API.V1.Types (WalAddress (..))
import Cardano.Wallet.Kernel.AddressPool (AddressPool,
ErrAddressPoolInvalid(..),
emptyAddressPool, initAddressPool, lookupAddressPool)
ErrAddressPoolInvalid (..), emptyAddressPool,
initAddressPool, lookupAddressPool)
import Cardano.Wallet.Kernel.AddressPoolGap (AddressPoolGap)
import Cardano.Wallet.Kernel.DB.BlockContext
import Cardano.Wallet.Kernel.DB.HdRootId (HdRootId)
@@ -29,8 +29,7 @@ import Cardano.Wallet.Kernel.DB.InDb
import qualified Cardano.Wallet.Kernel.DB.Spec.Pending as Pending
import Cardano.Wallet.Kernel.DB.TxMeta (TxMeta, putTxMeta)
import Cardano.Wallet.Kernel.Internal
import Cardano.Wallet.Kernel.Read (getFOWallets,
getWalletSnapshot)
import Cardano.Wallet.Kernel.Read (getFOWallets, getWalletSnapshot)
import Cardano.Wallet.Kernel.Submission (Cancelled, addPending)
import Cardano.Wallet.Kernel.Util.Core

@@ -20,10 +20,10 @@ module Cardano.Wallet.Kernel.Read (
import Universum hiding (State)

import Data.Acid.Advanced (query')
import qualified Data.Map.Strict as Map
import Data.List (nub)
import qualified Formatting.Buildable
import qualified Data.Map.Strict as Map
import Formatting (bprint, build, sformat, (%))
import qualified Formatting.Buildable
import Serokell.Util (listJson)

import Pos.Core (Address)
@@ -34,13 +34,13 @@ import Pos.Util.Wlog (Severity (..))
import Cardano.Wallet.Kernel.AddressPool (AddressPool)
import Cardano.Wallet.Kernel.AddressPoolGap (AddressPoolGap)
import Cardano.Wallet.Kernel.DB.AcidState (DB, Snapshot (..),
dbHdWallets)
dbHdWallets)
import Cardano.Wallet.Kernel.DB.HdRootId (HdRootId)
import Cardano.Wallet.Kernel.DB.HdWallet (HdAccountId, HdAddress,
HdRoot, HdAccountBase (..), getHdAddressIx,
hdAccountBase, hdAddressAddress, hdAddressId,
hdAddressIdIx, hdRootId, hdWalletsRoots,
mkAddressPoolExisting)
import Cardano.Wallet.Kernel.DB.HdWallet (HdAccountBase (..),
HdAccountId, HdAddress, HdRoot, getHdAddressIx,
hdAccountBase, hdAddressAddress, hdAddressId,
hdAddressIdIx, hdRootId, hdWalletsRoots,
mkAddressPoolExisting)
import Cardano.Wallet.Kernel.DB.InDb (fromDb)
import Cardano.Wallet.Kernel.DB.Read as Getters
import Cardano.Wallet.Kernel.DB.Util.IxSet (Indexed (..))
@@ -125,8 +125,8 @@ getEosPools db mkAddress
-> [(HdAccountId, AddressPool Address)]
toAccountAddressPools _root accs
= case accs of
Nothing -> [] -- not an Eos root
(Just (Left err)) -> error (sformat build err)
Nothing -> [] -- not an Eos root
(Just (Left err)) -> error (sformat build err)
(Just (Right (accs_,gap))) -> map (mkPool gap) accs_

mkPool
@@ -136,7 +136,7 @@ getEosPools db mkAddress
mkPool gap (accId,pk)
= case mkAddressPoolExisting mkAddress pk gap (getAddrs accId) of
Left invalidPoolErr -> error (sformat build invalidPoolErr)
Right pool -> (accId, pool)
Right pool -> (accId, pool)

getAddrs :: HdAccountId -> [(Address, Word32)]
getAddrs accId
@@ -32,9 +32,8 @@ import Pos.Chain.Txp (Utxo)
import Pos.Core (Address, Timestamp, makePubKeyAddressBoot)
import Pos.Core.NetworkMagic (NetworkMagic, makeNetworkMagic)
import Pos.Crypto (EncryptedSecretKey, PassPhrase, ProtocolMagic,
PublicKey,
changeEncPassphrase, checkPassMatches, emptyPassphrase,
firstHardened, safeDeterministicKeyGen)
PublicKey, changeEncPassphrase, checkPassMatches,
emptyPassphrase, firstHardened, safeDeterministicKeyGen)

import Cardano.Mnemonic (Mnemonic)
import qualified Cardano.Mnemonic as Mnemonic
@@ -1,5 +1,6 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}

module Cardano.Wallet.WalletLayer.Kernel.Wallets (
createWallet
, createEosWallet
@@ -50,10 +51,9 @@ import Cardano.Wallet.Kernel.Restore (blundToResolvedBlock,
import qualified Cardano.Wallet.Kernel.Wallets as Kernel
import Cardano.Wallet.WalletLayer (CreateWallet (..),
CreateWalletError (..), DeleteWalletError (..),
GetEosWalletError (..),
GetUtxosError (..), GetWalletError (..),
UpdateEosWalletError (..), UpdateWalletError (..),
UpdateWalletPasswordError (..))
GetEosWalletError (..), GetUtxosError (..),
GetWalletError (..), UpdateEosWalletError (..),
UpdateWalletError (..), UpdateWalletPasswordError (..))
import Cardano.Wallet.WalletLayer.Kernel.Conv

createWallet :: MonadIO m

0 comments on commit 5924e74

Please sign in to comment.