Skip to content

Commit

Permalink
Add temporary logging of the mocked initial deposit wallet state
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Nov 14, 2024
1 parent 63ead70 commit c454a87
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import Cardano.Wallet.Deposit.IO.Network.Type
import Cardano.Wallet.Deposit.REST
( ErrWalletResource
, WalletResource
, availableBalance
, customerAddress
, getTxHistoryByCustomer
, getTxHistoryByTime
, listCustomers
, loadWallet
, runWalletResourceM
, walletExists
Expand Down Expand Up @@ -70,14 +74,27 @@ loadDepositWalletFromDisk
-> IO ()
loadDepositWalletFromDisk tr dir env resource = do
result <- runExceptT $ do
ExceptT $ flip runWalletResourceM resource $ do
exists <- ExceptT $ flip runWalletResourceM resource $ do
test <- walletExists dir
liftIO $ print test
when test $ do
lg tr "Loading wallet from" dir
loadWallet env dir
lg tr "Wallet loaded from" dir
pure test
liftIO $ threadDelay 1_000_000
ExceptT $ mockFundTheWallet (networkEnv env) resource
when exists $ do
ExceptT $ mockFundTheWallet (networkEnv env) resource
ExceptT $ flip runWalletResourceM resource $ do
liftIO $ putStrLn "Available balance"
availableBalance >>= liftIO . print
liftIO $ putStrLn "Tx history by customer"
getTxHistoryByCustomer >>= liftIO . print
liftIO $ putStrLn "Tx history by time"
getTxHistoryByTime >>= liftIO . print
liftIO $ putStrLn "List customers"
listCustomers >>= liftIO . print
liftIO $ putStrLn "UTxO"
case result of
Left e -> error $ show e
Right _ -> pure ()
Expand Down

0 comments on commit c454a87

Please sign in to comment.