Skip to content

Commit b64db3a

Browse files
Lucsanszkyteodanciu
andcommitted
Apply suggestions from code review
Co-authored-by: teodanciu <teodora.danciu@tweag.io>
1 parent 3248026 commit b64db3a

File tree

9 files changed

+32
-22
lines changed

9 files changed

+32
-22
lines changed

eras/babbage/impl/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Version history for `cardano-ledger-babbage`
22

3-
## 1.12.0.1
3+
## 1.12.1.0
44

55
*
66

7+
### `testlib`
8+
9+
* Removed `babbageEraSpecificSpec`
10+
711
## 1.12.0.0
812

913
* Hide `Cardano.Ledger.Babbage.Translation` module

eras/babbage/impl/cardano-ledger-babbage.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: cardano-ledger-babbage
3-
version: 1.12.0.1
3+
version: 1.12.1.0
44
license: Apache-2.0
55
maintainer: operations@iohk.io
66
author: IOHK

eras/conway/impl/CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
### `testlib`
1111

12+
* Removed `regDelegToDRep`
13+
* Removed `registerRewardAccountWithDeposit`
14+
* Removed `registerPoolWithDeposit`
15+
* Removed `registerStakeCredentialWithDeposit`
1216
* Remove `conwayAccountsToUMap` corresponding to the removal of `UMap` from core.
1317

1418
## 1.20.0.0
@@ -109,10 +113,6 @@
109113

110114
### `testlib`
111115

112-
* Removed `regDelegToDRep`
113-
* Removed `registerRewardAccountWithDeposit`
114-
* Removed `registerPoolWithDeposit`
115-
* Removed `registerStakeCredentialWithDeposit`
116116
* Added `EraSpecificSpec ConwayEra` instance
117117
* Added `registerRewardAccountWithDeposit`
118118
* Added `regDelegToDRep`

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/LedgerSpec.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ spec = do
205205
let scriptHash = hashPlutusScript $ alwaysSucceedsNoDatum SPlutusV3
206206
let cred = ScriptHashObj scriptHash
207207
ra <- registerStakeCredential cred
208+
void $ delegateToDRep cred (Coin 1_000_000) DRepAlwaysAbstain
208209
submitAndExpireProposalToMakeReward cred
209210
balance <- getBalance cred
210211

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,9 +904,9 @@ votingSpec =
904904
& ppDRepVotingThresholdsL . dvtMotionNoConfidenceL .~ 1 %! 1
905905
& ppCoinsPerUTxOByteL .~ CoinPerByte (Coin 1)
906906
(drep, _, committeeId) <- electBasicCommittee
907-
kh <- freshKeyHash
908-
_ <- registerStakeCredential (KeyHashObj kh)
909-
_ <- delegateToDRep (KeyHashObj kh) (Coin 300) DRepAlwaysNoConfidence
907+
cred <- KeyHashObj <$> freshKeyHash
908+
_ <- registerStakeCredential cred
909+
_ <- delegateToDRep cred (Coin 300) DRepAlwaysNoConfidence
910910
noConfidence <- submitGovAction (NoConfidence (SJust committeeId))
911911
submitYesVote_ (DRepVoter drep) noConfidence
912912
logAcceptedRatio noConfidence

eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra/ImpTest.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Test.Cardano.Ledger.Dijkstra.ImpTest (
1111
module Test.Cardano.Ledger.Conway.ImpTest,
1212
exampleDijkstraGenesis,
1313
DijkstraEraImp,
14-
dijkstraGenRegTxCert,
1514
) where
1615

1716
import Cardano.Ledger.BaseTypes
@@ -126,7 +125,9 @@ dijkstraGenUnRegTxCert ::
126125
ImpTestM era (TxCert era)
127126
dijkstraGenUnRegTxCert stakingCredential = do
128127
accounts <- getsNES (nesEsL . esLStateL . lsCertStateL . certDStateL . accountsL)
129-
case lookupAccountState stakingCredential accounts of
130-
Nothing -> error "TODO"
131-
Just accountState ->
132-
pure $ UnRegDepositTxCert stakingCredential (fromCompact (accountState ^. depositAccountStateL))
128+
deposit <-
129+
case lookupAccountState stakingCredential accounts of
130+
Nothing -> getsNES $ nesEsL . curPParamsEpochStateL . ppKeyDepositL
131+
Just accountState -> pure (fromCompact (accountState ^. depositAccountStateL))
132+
pure
133+
$ UnRegDepositTxCert stakingCredential deposit

eras/shelley/impl/CHANGELOG.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# Version history for `cardano-ledger-shelley`
22

3-
## 1.17.0.1
3+
## 1.17.1.0
44

55
*
66

7+
### `testlib`
8+
9+
* Removed `shelleyEraSpecificSpec`
10+
* Added `shelleyGenUnRegTxCert`
11+
* Added `genUnRegTxCert` to `ShelleyEraImp`
12+
* Added `shelleyGenRegTxCert`
13+
* Added `genRegTxCert` to `ShelleyEraImp`
14+
715
## 1.17.0.0
816

917
* Changed `MaxTxSizeUTxO` and `sizeShelleyTxF` to use `Word32`
@@ -96,10 +104,6 @@
96104
### `testlib`
97105

98106
* Remove `shelleyAccountsToUMap` corresponding to the removal of `UMap` from core.
99-
* Added `shelleyGenUnRegTxCert`
100-
* Added `genUnRegTxCert` to `ShelleyEraImp`
101-
* Added `shelleyGenRegTxCert`
102-
* Added `genRegTxCert` to `ShelleyEraImp`
103107
* Added `impSatisfySignature` and `impSatisfyMNativeScripts`
104108
* Added `EraSpecificSpec ShelleyEra` instance
105109
* Added `EraSpecificSpec` class

eras/shelley/impl/cardano-ledger-shelley.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: cardano-ledger-shelley
3-
version: 1.17.0.0
3+
version: 1.17.1.0
44
license: Apache-2.0
55
maintainer: operations@iohk.io
66
author: IOHK

eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,9 @@ class
509509

510510
expectTxSuccess :: HasCallStack => Tx era -> ImpTestM era ()
511511

512-
genRegTxCert :: HasCallStack => Credential 'Staking -> ImpTestM era (TxCert era)
512+
genRegTxCert :: Credential 'Staking -> ImpTestM era (TxCert era)
513513

514-
genUnRegTxCert :: HasCallStack => Credential 'Staking -> ImpTestM era (TxCert era)
514+
genUnRegTxCert :: Credential 'Staking -> ImpTestM era (TxCert era)
515515

516516
impSatisfySignature ::
517517
KeyHash 'Witness ->

0 commit comments

Comments
 (0)