@@ -33,6 +33,11 @@ instance
3333 • withName "DelegEnv"
3434 Conv-DelegEnv = autoConvert DelegEnv
3535
36+ HsTy-GovCertEnv = autoHsType GovCertEnv
37+ ⊣ withConstructor "MkGovCertEnv"
38+ • fieldPrefix "gce"
39+ Conv-GovCertEnv = autoConvert GovCertEnv
40+
3641 HsTy-PState = autoHsType PState
3742 ⊣ withConstructor "MkPState"
3843 • fieldPrefix "ps"
@@ -49,32 +54,11 @@ instance
4954 • fieldPrefix "gs"
5055 Conv-GState = autoConvert GState
5156
52- -- CertEnv needs a wrapper because the votes field uses GovVote
53- -- which requires non-trivial conversion through GovVote'.
54-
55- record CertEnv' : Type where
56- field
57- epoch : Epoch
58- pp : PParams
59- votes : List GovVote'
60- wdrls : RewardAddress ⇀ Coin
61- coldCreds : ℙ Credential
62- directDeposits : DirectDeposits
63-
64- instance
65- HsTy-CertEnv' = autoHsType CertEnv'
57+ HsTy-CertEnv = autoHsType CertEnv
6658 ⊣ withConstructor "MkCertEnv"
6759 • withName "CertEnv"
6860 • fieldPrefix "ce"
69- Conv-CertEnv' = autoConvert CertEnv'
70-
71- mkCertEnv' : Convertible CertEnv CertEnv'
72- mkCertEnv' = λ where
73- .to ce → let module ce = CertEnv ce in record { epoch = ce.epoch ; pp = ce.pp ; votes = to ce.votes ; wdrls = ce.wdrls ; coldCreds = ce.coldCreds ; directDeposits = ce.directDeposits }
74- .from ce → let module ce = CertEnv' ce in record { epoch = ce.epoch ; pp = ce.pp ; votes = from ce.votes ; wdrls = ce.wdrls ; coldCreds = ce.coldCreds ; directDeposits = ce.directDeposits }
75-
76- HsTy-CertEnv = mkHsType CertEnv (HsType CertEnv')
77- Conv-CertEnv = mkCertEnv' ⨾ Conv-CertEnv'
61+ Conv-CertEnv = autoConvert CertEnv
7862
7963-- Computational step functions
8064
@@ -88,7 +72,7 @@ pool-step = to (compute Computational-POOL)
8872
8973{-# COMPILE GHC pool-step as poolStep #-}
9074
91- govcert-step : HsType (CertEnv → GState → DCert → ComputationResult String GState)
75+ govcert-step : HsType (GovCertEnv → GState → DCert → ComputationResult String GState)
9276govcert-step = to (compute Computational-GOVCERT)
9377
9478{-# COMPILE GHC govcert-step as govCertStep #-}
0 commit comments