Skip to content

Commit f434785

Browse files
committed
Add missing tx policies
1 parent b2e3db6 commit f434785

File tree

1 file changed

+9
-5
lines changed
  • ouroboros-network/sim-tests-lib/Test/Ouroboros/Network/TxSubmission

1 file changed

+9
-5
lines changed

ouroboros-network/sim-tests-lib/Test/Ouroboros/Network/TxSubmission/Common.hs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,11 @@ prop_receivedTxIds_generator (ArbReceivedTxIds _ someTxsToAck _peeraddr _ps st)
842842
-- `prop_makeDecisions_acknowledged`.
843843
--
844844
prop_acknowledgeTxIds :: ArbReceivedTxIds
845+
-> ArbDecisionContextWithReceivedTxIds
845846
-> Property
846-
prop_acknowledgeTxIds (ArbReceivedTxIds _mempoolHasTxFun _txs _peeraddr ps st) =
847-
case TXS.acknowledgeTxIds undefined st ps of
847+
prop_acknowledgeTxIds (ArbReceivedTxIds _ _ _ ps _)
848+
(ArbDecisionContextWithReceivedTxIds policy SharedDecisionContext { sdcSharedTxState = st } _ _ _) =
849+
case TXS.acknowledgeTxIds policy st ps of
848850
(numTxIdsToAck, _, txs, TXS.RefCountDiff { TXS.txIdsToAck }, ps') ->
849851
counterexample "number of tx ids to ack must agree with RefCountDiff"
850852
( fromIntegral numTxIdsToAck
@@ -879,10 +881,12 @@ prop_acknowledgeTxIds (ArbReceivedTxIds _mempoolHasTxFun _txs _peeraddr ps st) =
879881
--
880882
prop_hasTxIdsToAcknowledge
881883
:: ArbReceivedTxIds
884+
-> ArbTxDecisionPolicy
882885
-> Property
883-
prop_hasTxIdsToAcknowledge (ArbReceivedTxIds _mempoolHasTxFun _txs _peeraddr ps st) =
886+
prop_hasTxIdsToAcknowledge (ArbReceivedTxIds _mempoolHasTxFun _txs _peeraddr ps st)
887+
(ArbTxDecisionPolicy policy) =
884888
case ( TXS.hasTxIdsToAcknowledge st ps
885-
, TXS.acknowledgeTxIds undefined st ps
889+
, TXS.acknowledgeTxIds policy st ps
886890
) of
887891
(canAck, (numTxIdsToAck, _, _, _, _)) ->
888892
canAck === (numTxIdsToAck > 0)
@@ -1612,7 +1616,7 @@ prop_makeDecisions_acknowledged
16121616

16131617
ackFromState :: Map PeerAddr NumTxIdsToAck
16141618
ackFromState =
1615-
Map.map (\ps -> case TXS.acknowledgeTxIds undefined sharedTxState ps of
1619+
Map.map (\ps -> case TXS.acknowledgeTxIds policy sharedTxState ps of
16161620
(a, _, _, _, _) -> a)
16171621
. peerTxStates
16181622
$ sharedTxState

0 commit comments

Comments
 (0)