diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp.hs index f3ffa9461bb..ba49713b141 100644 --- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp.hs +++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp.hs @@ -74,7 +74,6 @@ conwayEraGenericSpec = do conwayEraSpecificSpec :: SpecWith (ImpInit (LedgerSpec ConwayEra)) conwayEraSpecificSpec = do describe "Conway era specific Imp spec" $ do - describe "DELEG" Deleg.conwayEraSpecificSpec describe "UTXO" Utxo.conwayEraSpecificSpec instance EraSpecificSpec ConwayEra where diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/DelegSpec.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/DelegSpec.hs index d7e7b4c482e..475701fde6f 100644 --- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/DelegSpec.hs +++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/DelegSpec.hs @@ -10,7 +10,6 @@ module Test.Cardano.Ledger.Conway.Imp.DelegSpec ( spec, - conwayEraSpecificSpec, ) where import Cardano.Ledger.Address (RewardAccount (..)) @@ -169,13 +168,12 @@ spec = do describe "Delegate stake" $ do it "Delegate to unregistered pool" $ do - expectedDeposit <- getsNES $ nesEsL . curPParamsEpochStateL . ppKeyDepositL - cred <- KeyHashObj <$> freshKeyHash + regTxCert <- genRegTxCert cred submitTx_ $ mkBasicTx mkBasicTxBody & bodyTxL . certsTxBodyL - .~ [RegDepositTxCert cred expectedDeposit] + .~ [regTxCert] poolKh <- freshKeyHash submitFailingTx @@ -529,29 +527,3 @@ spec = do accounts <- getsNES $ nesEsL . esLStateL . lsCertStateL . certDStateL . accountsL impAnn (show cred <> " expected to not have their vote delegated") $ expectNothingExpr (lookupDRepDelegation cred accounts) - -conwayEraSpecificSpec :: SpecWith (ImpInit (LedgerSpec ConwayEra)) -conwayEraSpecificSpec = do - describe "Delegate stake" $ do - it "Register and delegate in the same transaction" $ do - cred1 <- KeyHashObj <$> freshKeyHash - regTxCert1 <- genRegTxCert cred1 - poolKh <- freshKeyHash - registerPool poolKh - submitTx_ $ - mkBasicTx mkBasicTxBody - & bodyTxL . certsTxBodyL - .~ [ regTxCert1 - , DelegTxCert cred1 (DelegStake poolKh) - ] - expectDelegatedToPool cred1 poolKh - - cred2 <- KeyHashObj <$> freshKeyHash - regTxCert2 <- genRegTxCert cred2 - submitTx_ $ - mkBasicTx mkBasicTxBody - & bodyTxL . certsTxBodyL - .~ [ regTxCert2 - , DelegStakeTxCert cred2 poolKh -- using the pattern from Shelley - ] - expectDelegatedToPool cred2 poolKh diff --git a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp.hs b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp.hs index 7d4f84bff4b..a3e3ddfb2d7 100644 --- a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp.hs +++ b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp.hs @@ -50,5 +50,4 @@ shelleyEraSpecificSpec = do Deleg.shelleyEraSpecificSpec instance EraSpecificSpec ShelleyEra where - eraSpecificSpec = - describe "DELEG" Deleg.shelleyEraSpecificSpec + eraSpecificSpec = shelleyEraSpecificSpec diff --git a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp/DelegSpec.hs b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp/DelegSpec.hs index 62c359f087e..7d37a340c9a 100644 --- a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp/DelegSpec.hs +++ b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp/DelegSpec.hs @@ -204,13 +204,13 @@ spec = do it "Register and delegate in the same transaction" $ do poolKh <- freshKeyHash registerPool poolKh - freshKeyHash >>= \kh -> do - regTxCert <- genRegTxCert (KeyHashObj kh) - submitTx_ $ - mkBasicTx mkBasicTxBody - & bodyTxL . certsTxBodyL - .~ [regTxCert, delegStakeTxCert (KeyHashObj kh) poolKh] - expectDelegatedToPool (KeyHashObj kh) poolKh + cred <- KeyHashObj <$> freshKeyHash + regTxCert <- genRegTxCert cred + submitTx_ $ + mkBasicTx mkBasicTxBody + & bodyTxL . certsTxBodyL + .~ [regTxCert, delegStakeTxCert cred poolKh] + expectDelegatedToPool cred poolKh it "Delegate unregistered stake credentials" $ do cred <- KeyHashObj <$> freshKeyHash