Skip to content

Commit 394927d

Browse files
committed
Propagate ChainAccountState
1 parent e197baa commit 394927d

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ module Cardano.Api.Ledger.Internal.Reexport
112112
, toPlainDecoder
113113
-- Shelley
114114
, secondsToNominalDiffTimeMicro
115-
, AccountState (..)
115+
, AccountState
116116
, NewEpochState (..)
117117
, ShelleyGenesisStaking (..)
118118
-- Babbage
@@ -266,7 +266,6 @@ import Cardano.Ledger.Binary
266266
, toPlainDecoder
267267
)
268268
import Cardano.Ledger.Binary.Plain (Decoder, serializeAsHexText)
269-
import Cardano.Ledger.CertState (DRepState (..), csCommitteeCredsL)
270269
import Cardano.Ledger.Coin (Coin (..), addDeltaCoin, toDeltaCoin)
271270
import Cardano.Ledger.Conway.Core
272271
( DRepVotingThresholds (..)
@@ -293,6 +292,7 @@ import Cardano.Ledger.Conway.Governance
293292
)
294293
import Cardano.Ledger.Conway.PParams (UpgradeConwayPParams (..))
295294
import Cardano.Ledger.Conway.Scripts (ConwayPlutusPurpose (..))
295+
import Cardano.Ledger.Conway.State (DRepState (..), csCommitteeCredsL)
296296
import Cardano.Ledger.Conway.TxCert
297297
( ConwayDelegCert (..)
298298
, ConwayEraTxCert (..)
@@ -336,7 +336,7 @@ import Cardano.Ledger.Plutus.Data (Data (..), unData)
336336
import Cardano.Ledger.Plutus.Language (Language, Plutus, languageToText, plutusBinary)
337337
import Cardano.Ledger.PoolParams (PoolMetadata (..), PoolParams (..), StakePoolRelay (..))
338338
import Cardano.Ledger.Shelley.API
339-
( AccountState (..)
339+
( AccountState
340340
, GenDelegPair (..)
341341
, NewEpochState (..)
342342
, StakeReference (..)

cardano-api/src/Cardano/Api/Query/Internal/Convenience.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ import Cardano.Api.Query.Internal.Type.QueryInMode
3636
import Cardano.Api.Tx.Internal.Body
3737
import Cardano.Api.UTxO (UTxO (..))
3838

39-
import Cardano.Ledger.CertState (DRepState (..))
4039
import Cardano.Ledger.Coin qualified as L
40+
import Cardano.Ledger.Conway.State (ChainAccountState (..), DRepState (..))
4141
import Cardano.Ledger.Credential qualified as L
4242
import Cardano.Ledger.Keys qualified as L
43-
import Cardano.Ledger.Shelley.LedgerState qualified as L
4443
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras (EraMismatch (..))
4544
import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (..))
4645

@@ -168,11 +167,11 @@ queryStateForBalancedTx era allTxIns certs = runExceptT $ do
168167
caseShelleyToBabbageOrConwayEraOnwards
169168
(const $ pure Nothing)
170169
( \cOnwards -> do
171-
L.AccountState{L.asTreasury} <-
170+
chainAccountState <-
172171
lift (queryAccountState cOnwards)
173172
& onLeft (left . QceUnsupportedNtcVersion)
174173
& onLeft (left . QueryEraMismatch)
175-
let txCurrentTreasuryValue = TxCurrentTreasuryValue asTreasury
174+
let txCurrentTreasuryValue = TxCurrentTreasuryValue $ casTreasury chainAccountState
176175
return $ Just $ Featured cOnwards txCurrentTreasuryValue
177176
)
178177
sbe

cardano-api/src/Cardano/Api/Query/Internal/Expr.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ import Cardano.Api.UTxO
5959

6060
import Cardano.Ledger.Api qualified as L
6161
import Cardano.Ledger.Api.State.Query qualified as L
62-
import Cardano.Ledger.CertState qualified as L
6362
import Cardano.Ledger.Coin qualified as L
63+
import Cardano.Ledger.Conway.State qualified as L
6464
import Cardano.Ledger.Credential qualified as L
6565
import Cardano.Ledger.Hashes hiding (Hash)
6666
import Cardano.Ledger.Keys qualified as L
67-
import Cardano.Ledger.Shelley.LedgerState qualified as L
6867
import Cardano.Slotting.Slot
6968
import Ouroboros.Consensus.Cardano.Block qualified as Consensus
7069
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras as Consensus
@@ -484,7 +483,7 @@ queryAccountState
484483
QueryInMode
485484
r
486485
IO
487-
(Either UnsupportedNtcVersionError (Either EraMismatch L.AccountState))
486+
(Either UnsupportedNtcVersionError (Either EraMismatch L.ChainAccountState))
488487
queryAccountState eon = querySbe eon QueryAccountState
489488

490489
queryProposals

0 commit comments

Comments
 (0)