Skip to content

Commit 7498860

Browse files
committed
test(cardano-chain-gen): Fix up imports
1 parent 5064616 commit 7498860

File tree

2 files changed

+13
-34
lines changed

2 files changed

+13
-34
lines changed

cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Conway/Other.hs

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,7 @@ module Test.Cardano.Db.Mock.Unit.Conway.Other (
2424
forkParam,
2525
) where
2626

27-
import Cardano.Db (
28-
EntityField (
29-
EpochParamEpochNo,
30-
EpochParamProtocolMajor,
31-
ParamProposalEpochNo,
32-
ParamProposalProtocolMajor
33-
),
34-
EpochParam (),
35-
ParamProposal (),
36-
)
27+
import qualified Cardano.Db as Db
3728
import Cardano.DbSync.Era.Shelley.Generic.Util (unKeyHashRaw)
3829
import Cardano.Ledger.BaseTypes (EpochNo (..))
3930
import Cardano.Ledger.Conway.TxCert (ConwayTxCert (..))
@@ -51,17 +42,7 @@ import Cardano.Prelude hiding (from)
5142
import Cardano.SMASH.Server.PoolDataLayer (PoolDataLayer (..), dbToServantPoolId)
5243
import Cardano.SMASH.Server.Types (DBFail (..))
5344
import Data.List (last)
54-
import Database.Esqueleto.Experimental (
55-
from,
56-
selectOne,
57-
table,
58-
unValue,
59-
val,
60-
where_,
61-
(==.),
62-
(^.),
63-
)
64-
import Database.Persist.Sql (SqlBackend ())
45+
import Database.Esqueleto.Experimental
6546
import Ouroboros.Consensus.Shelley.Eras (StandardConway ())
6647
import Ouroboros.Network.Block (blockPoint)
6748
import Test.Cardano.Db.Mock.Config
@@ -469,12 +450,10 @@ forkParam =
469450
withFullConfig configDir testLabel $ \interpreter mockServer dbSync -> do
470451
startDBSync dbSync
471452

472-
-- Forge a block with stake credentials
473-
void $ Api.registerAllStakeCreds interpreter mockServer
474453
-- Protocol params aren't added to the DB until the following epoch
475454
epoch0 <- Api.fillUntilNextEpoch interpreter mockServer
476455
-- Wait for it to sync
477-
assertBlockNoBackoff dbSync (1 + length epoch0)
456+
assertBlockNoBackoff dbSync (length epoch0)
478457
-- Protocol major version should still match config
479458
assertEqBackoff
480459
dbSync
@@ -488,7 +467,7 @@ forkParam =
488467
Api.withBabbageFindLeaderAndSubmitTx interpreter mockServer $
489468
const Babbage.mkParamUpdateTx
490469
-- Wait for it to sync
491-
assertBlockNoBackoff dbSync (2 + length epoch0)
470+
assertBlockNoBackoff dbSync (1 + length epoch0)
492471
-- Query protocol param proposals
493472
assertEqBackoff
494473
dbSync
@@ -500,7 +479,7 @@ forkParam =
500479
-- The fork will be applied on the first block of the next epoch
501480
epoch1 <- Api.fillUntilNextEpoch interpreter mockServer
502481
-- Wait for it to sync
503-
assertBlockNoBackoff dbSync $ 2 + length (epoch0 <> epoch1)
482+
assertBlockNoBackoff dbSync $ 1 + length (epoch0 <> epoch1)
504483
-- Protocol major version should now be updated
505484
assertEqBackoff
506485
dbSync
@@ -514,7 +493,7 @@ forkParam =
514493
Api.withConwayFindLeaderAndSubmitTx interpreter mockServer $
515494
Conway.mkPaymentTx (UTxOIndex 0) (UTxOIndex 1) 10_000 500
516495
-- Wait for it to sync
517-
assertBlockNoBackoff dbSync $ 3 + length (epoch0 <> epoch1)
496+
assertBlockNoBackoff dbSync $ 2 + length (epoch0 <> epoch1)
518497
where
519498
testLabel = "conwayForkParam"
520499
configDir = babbageConfigDir
@@ -529,9 +508,9 @@ forkParam =
529508

530509
-- Query epoch params from database
531510
res <- selectOne $ do
532-
param <- from $ table @EpochParam
533-
where_ (param ^. EpochParamEpochNo ==. val currentEpoch)
534-
pure (param ^. EpochParamProtocolMajor)
511+
param <- from $ table @Db.EpochParam
512+
where_ (param ^. Db.EpochParamEpochNo ==. val currentEpoch)
513+
pure (param ^. Db.EpochParamProtocolMajor)
535514

536515
pure $ unValue <$> res
537516

@@ -545,8 +524,8 @@ forkParam =
545524

546525
-- Query proposals from database
547526
res <- selectOne $ do
548-
prop <- from $ table @ParamProposal
549-
where_ $ prop ^. ParamProposalEpochNo ==. val (Just currentEpoch)
550-
pure (prop ^. ParamProposalProtocolMajor)
527+
prop <- from $ table @Db.ParamProposal
528+
where_ $ prop ^. Db.ParamProposalEpochNo ==. val (Just currentEpoch)
529+
pure (prop ^. Db.ParamProposalProtocolMajor)
551530

552531
pure $ join (unValue <$> res)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[2,7,10,12,19,24,26,27,35,37,39,61,70,74,75,84,99,101,103,112,120,125,136,137,138,141,146,151,166,180,188,205,207,215,216,226,234,235,246,253,261,272,275,279,284,285,287,299,307,311,314,315,318,321,341,345,353,355,361,362,366,367,372,377,379,389,391,393,396,401,403,410,427,435,455,460,465,470,484,486,487,488,497,499,506,510,511,512,516,519,520,523,530,532,537,540,550,558,559,571,579,581,583,600,604,605,607,610,613,621,630,631,651,658,665,669,678,679,687,692,693,696,698,699,712,725,728,742,758,765,774,775,778,787,789,792,794,796,801,804,808,815,816,818,821,828,837,841,842,851,853,863,866,873,880,883,885,886,896,901,903,904,909,911,914,915,918,920,927,931,932,938,949,956,966,976,981,983,988,994,996,999,1000,1002]
1+
[2,7,10,12,19,24,26,27,35,37,39,61,70,74,75,84,99,101,103,112,120,125,136,137,138,141,146,151,166,180,188,205,207,215,216,226,234,235,246,253,261,272,275,279,284,285,287,299,307,311,314,315,318,321,341,345,353,355,361,362,366,367,372,377,379,389,391,393,396,401,403,410,427,435,455,460,465,470,484,486,487,488,497,499,506,510,511,512,516,519,520,523,530,532,537,540,550,558,559,571,579,581,583,600,604,605,607,610,613,621,630,631,651,658,665,669,678,679,687,692,693,696,698,699,712,725,728,742,758,765,774,775,778,787,789,792,794,796,801,804,808,815,816,818,821,828,837,841,842,851,853,863,866,873,880,883,885,886,896,901,903,904,909,911,914,915,918,920,927,931,932,938,949,956,966,976,981,983,988,994,996,999,1018,1019]

0 commit comments

Comments
 (0)