Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Test.Cardano.Ledger.Conway.Imp.DelegSpec (
spec,
conwayEraSpecificSpec,
) where

import Cardano.Ledger.Address (RewardAccount (..))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ shelleyEraSpecificSpec = do
Deleg.shelleyEraSpecificSpec

instance EraSpecificSpec ShelleyEra where
eraSpecificSpec =
describe "DELEG" Deleg.shelleyEraSpecificSpec
eraSpecificSpec = shelleyEraSpecificSpec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down