@@ -20,7 +20,7 @@ module Cardano.DbSync.Ledger.Event (
20
20
splitDeposits ,
21
21
) where
22
22
23
- import Cardano.Db hiding (AdaPots , EpochNo , SyncState , epochNo )
23
+ import Cardano.Db hiding (AdaPots , EpochNo , SyncState , TreasuryWithdrawals , epochNo )
24
24
import qualified Cardano.DbSync.Era.Shelley.Generic as Generic
25
25
import Cardano.DbSync.Era.Shelley.Generic.Tx.Shelley
26
26
import Cardano.DbSync.Types
@@ -29,8 +29,8 @@ import Cardano.Ledger.Address (RewardAccount)
29
29
import qualified Cardano.Ledger.Allegra.Rules as Allegra
30
30
import Cardano.Ledger.Alonzo.Rules (AlonzoBbodyEvent (.. ), AlonzoUtxoEvent (.. ), AlonzoUtxowEvent (.. ))
31
31
import qualified Cardano.Ledger.Alonzo.Rules as Alonzo
32
- import Cardano.Ledger.Api (GovActionId , GovActionState (.. ), ProposalProcedure (.. ))
33
32
import Cardano.Ledger.Coin (Coin (.. ))
33
+ import Cardano.Ledger.Conway.Governance
34
34
import Cardano.Ledger.Conway.Rules as Conway
35
35
import qualified Cardano.Ledger.Core as Ledger
36
36
import Cardano.Ledger.SafeHash (SafeHash )
@@ -83,6 +83,7 @@ data GovActionRefunded = GovActionRefunded
83
83
{ garGovActionId :: GovActionId StandardCrypto
84
84
, garDeposit :: Coin
85
85
, garReturnAddr :: RewardAccount StandardCrypto
86
+ , garMTreasury :: Maybe (Map (RewardAccount StandardCrypto ) Coin )
86
87
, garIsEnacted :: Bool -- True for enacted, False for retired, possibly redundant
87
88
}
88
89
deriving (Eq )
@@ -267,8 +268,13 @@ toLedgerEventConway evt hasRewards =
267
268
{ garGovActionId = gasId gas
268
269
, garDeposit = pProcDeposit $ gasProposalProcedure gas
269
270
, garReturnAddr = pProcReturnAddr $ gasProposalProcedure gas
271
+ , garMTreasury = mWithrawal
270
272
, garIsEnacted = isEnacted
271
273
}
274
+ where
275
+ mWithrawal = case pProcGovAction (gasProposalProcedure gas) of
276
+ TreasuryWithdrawals mp _ -> Just mp
277
+ _ -> Nothing
272
278
273
279
instance All ConvertLedgerEvent xs => ConvertLedgerEvent (HardForkBlock xs ) where
274
280
toLedgerEvent hasRewards =
0 commit comments