Skip to content

Commit

Permalink
Remove code repetition around protocol_version CDDL in Babbage and Co…
Browse files Browse the repository at this point in the history
…nway eras
  • Loading branch information
iccicci authored and teodanciu committed Mar 8, 2024
1 parent a13e552 commit c9f43e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions eras/babbage/impl/cddl-files/babbage.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ header_body =
, block_body_size : uint
, block_body_hash : $hash32 ; merkle triple root
, operational_cert
, [ protocol_version ]
, protocol_version
]

operational_cert =
Expand All @@ -48,7 +48,7 @@ next_major_protocol_version = 9

major_protocol_version = 1..next_major_protocol_version

protocol_version = (major_protocol_version, uint)
protocol_version = [(major_protocol_version, uint)]

transaction_body =
{ 0 : set<transaction_input> ; inputs
Expand Down Expand Up @@ -280,7 +280,7 @@ protocol_param_update =
, ? 9: nonnegative_interval ; pool pledge influence
, ? 10: unit_interval ; expansion rate
, ? 11: unit_interval ; treasury growth rate
, ? 14: [protocol_version] ; protocol version
, ? 14: protocol_version ; protocol version
, ? 16: coin ; min pool cost
, ? 17: coin ; ada per utxo byte
, ? 18: costmdls ; cost models for script languages
Expand Down
6 changes: 3 additions & 3 deletions eras/conway/impl/cddl-files/conway.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ header_body =
, block_body_size : uint
, block_body_hash : $hash32 ; merkle triple root
, operational_cert
, [ protocol_version ]
, protocol_version
]

operational_cert =
Expand All @@ -48,7 +48,7 @@ next_major_protocol_version = 10

major_protocol_version = 1..next_major_protocol_version

protocol_version = (major_protocol_version, uint)
protocol_version = [(major_protocol_version, uint)]

transaction_body =
{ 0 : set<transaction_input> ; inputs
Expand Down Expand Up @@ -105,7 +105,7 @@ policy_hash = scripthash

parameter_change_action = (0, gov_action_id / null, protocol_param_update, policy_hash / null)

hard_fork_initiation_action = (1, gov_action_id / null, [protocol_version])
hard_fork_initiation_action = (1, gov_action_id / null, protocol_version)

treasury_withdrawals_action = (2, { reward_account => coin }, policy_hash / null)

Expand Down

0 comments on commit c9f43e4

Please sign in to comment.