Skip to content

Commit d84531a

Browse files
committed
CDDL: gov_action_id, plutus_v3_script era generic.
Remove unused maybeTaggedOSet
1 parent d5065ea commit d84531a

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

eras/conway/impl/cddl/lib/Cardano/Ledger/Conway/HuddleSpec.hs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{-# LANGUAGE QuasiQuotes #-}
1111
{-# LANGUAGE ScopedTypeVariables #-}
1212
{-# LANGUAGE TypeApplications #-}
13+
{-# LANGUAGE UndecidableInstances #-}
1314
{-# OPTIONS_GHC -Wno-orphans #-}
1415

1516
module Cardano.Ledger.Conway.HuddleSpec (
@@ -24,7 +25,6 @@ module Cardano.Ledger.Conway.HuddleSpec (
2425
anchorRule,
2526
drepRule,
2627
voterRule,
27-
govActionIdRule,
2828
accountRegistrationDepositCertGroup,
2929
accountUnregistrationDepositCertGroup,
3030
delegationToDrepCertGroup,
@@ -54,7 +54,6 @@ module Cardano.Ledger.Conway.HuddleSpec (
5454
drepVotingThresholdsRule,
5555
maybeTaggedSet,
5656
maybeTaggedNonemptySet,
57-
maybeTaggedOset,
5857
maybeTaggedNonemptyOset,
5958
) where
6059

@@ -117,14 +116,6 @@ voterRule p =
117116
/ arr [3, a (huddleRule @"script_hash" p)]
118117
/ arr [4, a (huddleRule @"addr_keyhash" p)]
119118

120-
govActionIdRule :: forall era. HuddleRule "transaction_id" era => Proxy era -> Rule
121-
govActionIdRule p =
122-
"gov_action_id"
123-
=:= arr
124-
[ "transaction_id" ==> huddleRule @"transaction_id" p
125-
, "gov_action_index" ==> (VUInt `sized` (2 :: Word64))
126-
]
127-
128119
accountRegistrationDepositCertGroup ::
129120
forall era.
130121
(HuddleRule "stake_credential" era, HuddleRule "coin" era) =>
@@ -627,16 +618,21 @@ instance HuddleRule "drep" ConwayEra where
627618
instance HuddleRule "voter" ConwayEra where
628619
huddleRule = voterRule @ConwayEra
629620

630-
instance HuddleRule "gov_action_id" ConwayEra where
631-
huddleRule = govActionIdRule @ConwayEra
621+
instance (Era era, HuddleRule "transaction_id" era) => HuddleRule "gov_action_id" era where
622+
huddleRule p =
623+
"gov_action_id"
624+
=:= arr
625+
[ "transaction_id" ==> huddleRule @"transaction_id" p
626+
, "gov_action_index" ==> (VUInt `sized` (2 :: Word64))
627+
]
632628

633629
instance HuddleRule "operational_cert" ConwayEra where
634630
huddleRule = babbageOperationalCertRule @ConwayEra
635631

636632
instance HuddleRule "protocol_version" ConwayEra where
637633
huddleRule = babbageProtocolVersionRule @ConwayEra
638634

639-
instance HuddleRule "plutus_v3_script" ConwayEra where
635+
instance (Era era, HuddleRule "distinct_bytes" era) => HuddleRule "plutus_v3_script" era where
640636
huddleRule p =
641637
comment
642638
[str|Conway introduces Plutus V3 with support for new governance features.
@@ -1216,8 +1212,5 @@ maybeTaggedSet = mkMaybeTaggedSet "set" 0
12161212
maybeTaggedNonemptySet :: IsType0 a => a -> GRuleCall
12171213
maybeTaggedNonemptySet = mkMaybeTaggedSet "nonempty_set" 1
12181214

1219-
maybeTaggedOset :: IsType0 a => a -> GRuleCall
1220-
maybeTaggedOset = mkMaybeTaggedSet "oset" 0
1221-
12221215
maybeTaggedNonemptyOset :: IsType0 a => a -> GRuleCall
12231216
maybeTaggedNonemptyOset = mkMaybeTaggedSet "nonempty_oset" 1

0 commit comments

Comments
 (0)