Skip to content

Commit

Permalink
Use TxSummary from customer-deposit-wallet-pure
Browse files Browse the repository at this point in the history
  • Loading branch information
HeinrichApfelmus committed Sep 25, 2024
1 parent 33d3635 commit 876723d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 3 additions & 7 deletions lib/customer-deposit-wallet/src/Cardano/Wallet/Deposit/Pure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ import Cardano.Wallet.Address.BIP32
( BIP32Path (..)
, DerivationType (..)
)
import Cardano.Wallet.Deposit.Pure.TxSummary
( TxSummary (..)
)
import Cardano.Wallet.Deposit.Pure.UTxO.UTxOHistory
( UTxOHistory
)
Expand Down Expand Up @@ -209,13 +212,6 @@ availableUTxO w =
pending = listTxsInSubmission w
utxo = UTxOHistory.getUTxO $ utxoHistory w

data TxSummary = TxSummary
{ txid :: Read.TxId
, blockHeaderBody :: Read.BHBody
, transfer :: ValueTransfer
}
deriving (Eq, Show)

getCustomerHistory :: Customer -> WalletState -> [TxSummary]
getCustomerHistory = undefined

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ scenarioTrackDepositOne env w = do

-- no deposits
txsummaries0<- Wallet.getCustomerHistory customer w
assert $ txsummaries0 == []
assert $ null txsummaries0

-- first deposit
depositFundsAt env address coin
txsummaries1 <- Wallet.getCustomerHistory customer w
assert $ map (received . transfer) txsummaries1 == [coin]
assert $ map (received . txTransfer) txsummaries1 == [coin]

-- second deposit
depositFundsAt env address coin
txsummaries2 <- Wallet.getCustomerHistory customer w
assert $ map (received . transfer) txsummaries2 == [coin, coin]
assert $ map (received . txTransfer) txsummaries2 == [coin, coin]
where
customer = 7 :: Customer
coin = ada 12
Expand Down Expand Up @@ -210,7 +210,7 @@ scenarioCreatePayment xprv env destination w = do

-- but the original deposit amount is still recorded
txsummaries <- Wallet.getCustomerHistory customer w
assert $ value1 `elem` map (received . transfer) txsummaries
assert $ value1 `elem` map (received . txTransfer) txsummaries
where
customer :: Customer
customer = 17
Expand Down

0 comments on commit 876723d

Please sign in to comment.