Commit 9e91ac5 1 parent 876db4b commit 9e91ac5 Copy full SHA for 9e91ac5
File tree 5 files changed +13
-38
lines changed
lib/customer-deposit-wallet/src/Cardano/Wallet/Deposit
5 files changed +13
-38
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ genesis :: Read.ChainPoint
96
96
genesis = Read. Origin
97
97
98
98
getBlockPoint :: Read. Block -> Read. ChainPoint
99
- getBlockPoint = Read. At . Read. slot . Read. blockHeaderBody . Read. blockHeader
99
+ getBlockPoint = Read. At . Read. slotNo . Read. blockHeaderBody . Read. blockHeader
100
100
101
101
mkNextBlock :: Read. ChainPoint -> [Tx Conway ] -> Read. Block
102
102
mkNextBlock tipOld txs =
@@ -105,7 +105,7 @@ mkNextBlock tipOld txs =
105
105
{ Read. blockHeaderBody = Read. BHBody
106
106
{ Read. prev = Nothing
107
107
, Read. blockno = toEnum $ fromEnum slotNext
108
- , Read. slot = slotNext
108
+ , Read. slotNo = slotNext
109
109
, Read. bhash = ()
110
110
}
111
111
, Read. blockHeaderSignature = ()
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ rollForwardUTxO isOurs block u =
176
176
UTxOHistory. appendBlock slot deltaUTxO u
177
177
where
178
178
(deltaUTxO,_) = Balance. applyBlock isOurs block (UTxOHistory. getUTxO u)
179
- slot = Read. slot . Read. blockHeaderBody $ Read. blockHeader block
179
+ slot = Read. slotNo . Read. blockHeaderBody $ Read. blockHeader block
180
180
181
181
rollBackward
182
182
:: Read. ChainPoint
Original file line number Diff line number Diff line change @@ -31,11 +31,11 @@ import qualified Data.Delta as Delta
31
31
Types
32
32
------------------------------------------------------------------------------}
33
33
type TxSubmissions
34
- = Sbm. Submissions () Read. Slot (Read. TxId , Read. Tx )
34
+ = Sbm. Submissions () Read. SlotNo (Read. TxId , Read. Tx )
35
35
type TxSubmissionsStatus
36
- = Sbm. TxStatusMeta () Read. Slot (Read. TxId , Read. Tx )
36
+ = Sbm. TxStatusMeta () Read. SlotNo (Read. TxId , Read. Tx )
37
37
type DeltaTxSubmissions1
38
- = Sbm. Operation () Read. Slot (Read. TxId , Read. Tx )
38
+ = Sbm. Operation () Read. SlotNo (Read. TxId , Read. Tx )
39
39
type DeltaTxSubmissions
40
40
= [DeltaTxSubmissions1 ]
41
41
@@ -56,7 +56,7 @@ empty = Sbm.mkEmpty 0
56
56
57
57
-- | Add a /new/ transaction to the local submission pool
58
58
-- with the most recent submission slot.
59
- add :: Read. Tx -> Read. Slot -> DeltaTxSubmissions
59
+ add :: Read. Tx -> Read. SlotNo -> DeltaTxSubmissions
60
60
add = undefined
61
61
62
62
listInSubmission :: TxSubmissions -> Set Read. Tx
@@ -69,5 +69,5 @@ rollForward block = [ Sbm.RollForward tip txs ]
69
69
txids = undefined block
70
70
txs = map (tip,) txids
71
71
72
- rollBackward :: Read. Slot -> DeltaTxSubmissions
72
+ rollBackward :: Read. SlotNo -> DeltaTxSubmissions
73
73
rollBackward = undefined
Original file line number Diff line number Diff line change @@ -7,25 +7,10 @@ module Cardano.Wallet.Deposit.Pure.UTxOHistory
7
7
, getUTxO
8
8
) where
9
9
10
- import Cardano.Wallet.Deposit.Pure.UTxO.DeltaUTxO
11
- ( DeltaUTxO
12
- )
13
10
import Cardano.Wallet.Deposit.Pure.UTxO.UTxOHistory
14
- ( UTxOHistory
11
+ ( DeltaUTxOHistory (.. )
12
+ , UTxOHistory
15
13
, appendBlock
16
14
, empty
17
15
, getUTxO
18
16
)
19
- import Cardano.Wallet.Deposit.Read
20
- ( Slot
21
- , SlotNo
22
- )
23
-
24
- -- | Changes to the UTxO history.
25
- data DeltaUTxOHistory
26
- = -- | New slot tip, changes within that block.
27
- AppendBlock SlotNo DeltaUTxO
28
- | -- | Rollback tip.
29
- Rollback Slot
30
- | -- | Move finality forward.
31
- Prune SlotNo
Original file line number Diff line number Diff line change 7
7
-- TODO: Match this up with the @Read@ hierarchy.
8
8
module Cardano.Wallet.Deposit.Read
9
9
( Network (.. )
10
- , Slot
11
10
, Read. SlotNo
12
11
, toSlot
13
12
, fromSlot
@@ -79,18 +78,9 @@ import qualified Data.ByteString.Short as SBS
79
78
------------------------------------------------------------------------------}
80
79
data Network = Testnet | Mainnet
81
80
82
- -- Spec: type Slot = Natural
83
- type Slot = Read. SlotNo
84
-
85
- toSlot :: Natural -> Slot
86
- toSlot = Read. SlotNo
87
-
88
- fromSlot :: Slot -> Natural
89
- fromSlot (Read. SlotNo sl) = sl
90
-
91
81
data ChainPoint
92
82
= Origin
93
- | At Slot
83
+ | At Read. SlotNo
94
84
deriving (Eq , Ord , Show )
95
85
96
86
-- | Synonym for readability.
@@ -154,7 +144,7 @@ type Sig = ()
154
144
data BHBody = BHBody
155
145
{ prev :: Maybe HashHeader
156
146
, blockno :: BlockNo
157
- , slot :: Slot
147
+ , slotNo :: Read. SlotNo
158
148
, bhash :: HashBBody
159
149
}
160
150
deriving (Eq , Ord , Show )
@@ -166,7 +156,7 @@ dummyBHBody :: BHBody
166
156
dummyBHBody = BHBody
167
157
{ prev = Nothing
168
158
, blockno = 128
169
- , slot = Read. SlotNo 42
159
+ , slotNo = Read. SlotNo 42
170
160
, bhash = ()
171
161
}
172
162
You can’t perform that action at this time.
0 commit comments