Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3393 from input-output-hk/check-all-wallet-TODOs
Browse files Browse the repository at this point in the history
[CBR-227] Go over TODOs, remove stray, add tickets
  • Loading branch information
edsko authored Aug 14, 2018
2 parents 0e9859a + e677e88 commit e65bcca
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 42 deletions.
4 changes: 0 additions & 4 deletions server/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ actionWithNewWallet pm txpConfig sscParams nodeParams params =
sscParams
(txpGlobalSettings pm txpConfig)
(initNodeDBs pm epochSlots) $ \nr -> do
-- TODO: Will probably want to extract some parameters from the
-- 'NewWalletBackendParams' to construct or initialize the wallet

-- TODO(ks): Currently using non-implemented layer for wallet layer.
userSecret <- readTVarIO (ncUserSecret $ nrContext nr)
let nodeState = NodeStateAdaptor.newNodeStateAdaptor nr
liftIO $ Keystore.bracketLegacyKeystore userSecret $ \keystore -> do
Expand Down
2 changes: 0 additions & 2 deletions src/Cardano/Wallet/API/V1/Handlers/Transactions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ newTransaction :: ActiveWalletLayer IO
-> Handler (WalletResponse Transaction)
newTransaction aw payment@Payment{..} = do

-- TODO(adn) If the wallet is being restored, we need to disallow any @Payment@ from
-- being submitted.
-- NOTE(adn) The 'SenderPaysFee' option will become configurable as part
-- of CBR-291.
res <- liftIO $ (WalletLayer.pay aw) (maybe mempty coerce pmtSpendingPassword)
Expand Down
4 changes: 2 additions & 2 deletions src/Cardano/Wallet/Kernel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ data WalletHandles = Handles {
handlesOpen :: IO WalletHandles
handlesOpen = do
db <- openMemoryState defDB
metadb <- openMetaDB ":memory:" -- TODO: Eventually :memory: should be replaced with the real path.
metadb <- openMetaDB ":memory:" -- TODO: CBR-378
migrateMetaDB metadb -- TODO: this will be run with asynchronous exceptions masked.
return $ Handles db metadb

Expand Down Expand Up @@ -144,7 +144,7 @@ init PassiveWallet{..} = do

-- | Prefilter the block for each esk in the `WalletESK` map.
-- Return a unified Map of accountId and prefiltered blocks (representing multiple ESKs)
-- TODO(@uroboros/ryan) optimisation: we are prefiltering the block n times for n keys, change this to be a single pass
-- TODO: Improve performance (CBR-379)
prefilterBlock' :: PassiveWallet
-> ResolvedBlock
-> IO (Map HdAccountId PrefilteredBlock)
Expand Down
2 changes: 0 additions & 2 deletions src/Cardano/Wallet/Kernel/Addresses.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ data CreateAddressError =
-- to find another random index would be too expensive
deriving Eq

-- TODO(adn): This will be done as part of my work on the 'newTransaction'
-- endpoint, see [CBR-313].
instance Arbitrary CreateAddressError where
arbitrary = oneof []

Expand Down
2 changes: 1 addition & 1 deletion src/Cardano/Wallet/Kernel/CoinSelection/FromGeneric.hs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ runCoinSelT opts pickUtxo policy request utxo = do
originalOuts = case outs of
[] -> error "runCoinSelT: empty list of outputs"
o:os -> o :| os
-- TODO: We should shuffle allOuts
-- TODO: We should shuffle allOuts CBR-380
return . Right $ CoinSelFinalResult allInps
originalOuts
(concatMap coinSelChange css)
Expand Down
2 changes: 0 additions & 2 deletions src/Cardano/Wallet/Kernel/DB/HdWallet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ instance Arbitrary HdAddressId where
-- address indices.
--
-- NOTE: We do not store the encrypted key of the wallet.
--
-- TODO: synchronization state
data HdRoot = HdRoot {
-- | Wallet ID
_hdRootId :: HdRootId
Expand Down
3 changes: 0 additions & 3 deletions src/Cardano/Wallet/Kernel/DB/HdWallet/Create.hs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ initHdRoot rootId name hasPass assurance created = HdRoot {
--
-- It is the responsibility of the caller to check the wallet's spending
-- password.
--
-- TODO: If any key derivation is happening when creating accounts, should we
-- store a public key or an address or something?
initHdAccount :: HdAccountId
-> Checkpoint
-> HdAccount
Expand Down
5 changes: 0 additions & 5 deletions src/Cardano/Wallet/Kernel/DB/HdWallet/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
--
-- NOTE: These are pure functions, which are intended to work on a snapshot
-- of the database. They are intended to support the V1 wallet API.
--
-- TODO: We need to think about which layer will have the responsibility for
-- filtering and sorting. If we want the 'IxSet' stuff to be local to the
-- "Kernel.DB" namespace (which would be a good thing), then filtering and
-- sorting (and maybe even pagination) will need to happen here.
module Cardano.Wallet.Kernel.DB.HdWallet.Read (
-- | * Infrastructure
HdQuery
Expand Down
4 changes: 0 additions & 4 deletions src/Cardano/Wallet/Kernel/DB/Resolved.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ data ResolvedBlock = ResolvedBlock {
makeLenses ''ResolvedTx
makeLenses ''ResolvedBlock

-- TODO: Why are these necessary? and if they're not, get rid of InDb
--deriveSafeCopy 1 'base ''ResolvedTx
--deriveSafeCopy 1 'base ''ResolvedBlock

{-------------------------------------------------------------------------------
Pretty-printing
-------------------------------------------------------------------------------}
Expand Down
2 changes: 1 addition & 1 deletion src/Cardano/Wallet/Kernel/DB/Sqlite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ newConnection path = Sqlite.open path
-- | Closes an open 'Connection' to the @Sqlite@ database stored in the
-- input 'MetaDBHandle'.
-- Even if open failed with error, this function should be called http://www.sqlite.org/c3ref/open.html
-- TODO: provide a brucket style interface to ensure this.
-- TODO: provide a bracket style interface to ensure this.
closeMetaDB :: Sqlite.Connection -> IO ()
closeMetaDB = Sqlite.close

Expand Down
2 changes: 0 additions & 2 deletions src/Cardano/Wallet/Kernel/DB/TxMeta/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ data TxMeta = TxMeta {
_txMetaId :: Txp.TxId

-- | Total amount
--
-- TODO: What does this mean?
, _txMetaAmount :: Core.Coin

-- | Transaction inputs
Expand Down
14 changes: 4 additions & 10 deletions src/Cardano/Wallet/Kernel/Mode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,21 @@ getWallet = view wcWallet_L
-------------------------------------------------------------------------------}

-- | Callback for new blocks
--
-- TODO: This should wrap the functionality in "Cardano.Wallet.Core" to
-- wrap things in Cardano specific types.
walletApplyBlocks :: PassiveWalletLayer IO
-> OldestFirst NE Blund
-> WalletMode SomeBatchOp
walletApplyBlocks _w _bs = do
lift $ applyBlocks _w _bs
walletApplyBlocks w bs = do
lift $ applyBlocks w bs

-- We don't make any changes to the DB so we always return 'mempty'.
return mempty

-- | Callback for rollbacks
--
-- TODO: This should wrap the functionality in "Cardano.Wallet.Core" to
-- wrap things in Cardano specific types.
walletRollbackBlocks :: PassiveWalletLayer IO
-> NewestFirst NE Blund
-> WalletMode SomeBatchOp
walletRollbackBlocks _w _bs = do
lift $ rollbackBlocks _w _bs
walletRollbackBlocks w bs = do
lift $ rollbackBlocks w bs

-- We don't make any changes to the DB so we always return 'mempty'.
return mempty
Expand Down
5 changes: 1 addition & 4 deletions src/Cardano/Wallet/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ walletServer w _ =
:<|> v1Handler
:<|> internalHandler
where
-- TODO: Not sure if we want to support the V0 API with the new wallet.
-- For now I'm assuming we're not going to.
--
-- TODO: It'd be nicer to not throw an exception here, but servant doesn't
-- make this very easy at the moment.
v0Handler = error "V0 API no longer supported"
v1Handler = V1.handlers w
internalHandler = error "Internal API not yet defined"
internalHandler = error "TODO: Internal API not yet defined (CBR-377)"


walletDocServer :: (HasCompileInfo, HasUpdateConfiguration) => Server WalletDocAPI
Expand Down

0 comments on commit e65bcca

Please sign in to comment.