Skip to content

Commit 9e6a057

Browse files
committed
CDDL: Rename some core fieldnames consistently.
1 parent 135bfb1 commit 9e6a057

File tree

13 files changed

+98
-84
lines changed

13 files changed

+98
-84
lines changed

eras/allegra/impl/cddl-files/allegra.cddl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ protocol_param_update =
267267

268268
nonnegative_interval = #6.30([uint, positive_int])
269269

270-
positive_int = 1 .. maxWord64
270+
positive_int = 1 .. max_word64
271271

272-
maxWord64 = 18446744073709551615
272+
max_word64 = 18446744073709551615
273273

274274
nonce = [0// 1, bytes .size 32]
275275

@@ -305,7 +305,11 @@ script_any = (2, [* native_script])
305305

306306
script_n_of_k = (3, n : int64, [* native_script])
307307

308-
int64 = -9223372036854775808 .. 9223372036854775807
308+
int64 = min_int64 .. max_int64
309+
310+
min_int64 = -9223372036854775808
311+
312+
max_int64 = 9223372036854775807
309313

310314
invalid_before = (4, uint)
311315

eras/alonzo/impl/cddl-files/alonzo.cddl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ protocol_param_update =
330330

331331
nonnegative_interval = #6.30([uint, positive_int])
332332

333-
positive_int = 1 .. maxWord64
333+
positive_int = 1 .. max_word64
334334

335-
maxWord64 = 18446744073709551615
335+
max_word64 = 18446744073709551615
336336

337337
nonce = [0// 1, bytes .size 32]
338338

@@ -349,7 +349,11 @@ language = 0
349349
; See Plutus' `ParamName` for parameter ordering
350350
cost_model = [166*166 int64]
351351

352-
int64 = -9223372036854775808 .. 9223372036854775807
352+
int64 = min_int64 .. max_int64
353+
354+
min_int64 = -9223372036854775808
355+
356+
max_int64 = 9223372036854775807
353357

354358
ex_unit_prices = [mem_price : positive_interval, step_price : positive_interval]
355359

@@ -558,5 +562,5 @@ auxiliary_scripts = [* native_script]
558562
transaction =
559563
[transaction_body, transaction_witness_set, bool, auxiliary_data/ nil]
560564

561-
signkeyKES = bytes .size 64
565+
signkey_kes = bytes .size 64
562566

eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/CDDL.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ alonzoCDDL =
4242
, HIRule transaction
4343
, HIRule kes_signature
4444
, HIRule language
45-
, HIRule signkeyKES
45+
, HIRule signkey_kes
4646
]
4747

4848
block :: Rule

eras/babbage/impl/cddl-files/babbage.cddl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,15 +415,19 @@ protocol_param_update =
415415

416416
nonnegative_interval = #6.30([uint, positive_int])
417417

418-
positive_int = 1 .. maxWord64
418+
positive_int = 1 .. max_word64
419419

420-
maxWord64 = 18446744073709551615
420+
max_word64 = 18446744073709551615
421421

422422
; 0: Plutus v1
423423
; 1: Plutus v2
424424
cost_models = {? 0 : [166*166 int64], ? 1 : [175*175 int64]}
425425

426-
int64 = -9223372036854775808 .. 9223372036854775807
426+
int64 = min_int64 .. max_int64
427+
428+
min_int64 = -9223372036854775808
429+
430+
max_int64 = 9223372036854775807
427431

428432
ex_unit_prices = [mem_price : positive_interval, step_price : positive_interval]
429433

@@ -578,5 +582,5 @@ transaction =
578582
; 1: Plutus v2
579583
language = 0/ 1
580584

581-
signkeyKES = bytes .size 64
585+
signkey_kes = bytes .size 64
582586

eras/babbage/impl/testlib/Test/Cardano/Ledger/Babbage/CDDL.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ babbageCDDL =
3232
, HIRule transaction
3333
, HIRule kes_signature
3434
, HIRule language
35-
, HIRule signkeyKES
35+
, HIRule signkey_kes
3636
]
3737

3838
block :: Rule

eras/conway/impl/cddl-files/conway.cddl

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ language = 0/ 1/ 2
2323

2424
potential_languages = 0 .. 255
2525

26-
signkeyKES = bytes .size 64
26+
signkey_kes = bytes .size 64
2727

2828
certificate =
2929
[ stake_registration
@@ -228,9 +228,9 @@ hash28 = bytes .size 28
228228

229229
asset_name = bytes .size (0 .. 32)
230230

231-
positive_coin = 1 .. maxWord64
231+
positive_coin = 1 .. max_word64
232232

233-
maxWord64 = 18446744073709551615
233+
max_word64 = 18446744073709551615
234234

235235
; NEW starting with babbage
236236
; datum_option
@@ -309,7 +309,11 @@ script_any = (2, [* native_script])
309309

310310
script_n_of_k = (3, n : int64, [* native_script])
311311

312-
int64 = -9223372036854775808 .. 9223372036854775807
312+
int64 = min_int64 .. max_int64
313+
314+
min_int64 = -9223372036854775808
315+
316+
max_int64 = 9223372036854775807
313317

314318
invalid_before = (4, slot_no)
315319

@@ -425,13 +429,13 @@ withdrawals = {+ reward_account => coin}
425429

426430
auxiliary_data_hash = hash32
427431

428-
mint = {+ policy_id => {+ asset_name => nonZeroInt64}}
432+
mint = {+ policy_id => {+ asset_name => nonzero_int64}}
429433

430-
nonZeroInt64 = negInt64/ posInt64
434+
nonzero_int64 = negative_int64/ positive_int64
431435

432-
negInt64 = -9223372036854775808 .. -1
436+
negative_int64 = min_int64 .. -1
433437

434-
posInt64 = 1 .. 9223372036854775807
438+
positive_int64 = 1 .. max_int64
435439

436440
; This is a hash of data which may affect evaluation of a script.
437441
; This data consists of:
@@ -586,7 +590,7 @@ epoch_interval = uint .size 4
586590

587591
nonnegative_interval = #6.30([uint, positive_int])
588592

589-
positive_int = 1 .. maxWord64
593+
positive_int = 1 .. max_word64
590594

591595
; The format for cost_models is flexible enough to allow adding
592596
; Plutus built-ins and language versions in the future.

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/CDDL.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ conwayCDDL =
103103
, HIRule kes_signature
104104
, HIRule language
105105
, HIRule potential_languages
106-
, HIRule signkeyKES
106+
, HIRule signkey_kes
107107
, -- Certificates
108108
HIRule certificate
109109
, HIGroup stake_registration
@@ -841,7 +841,7 @@ value :: Rule
841841
value = "value" =:= coin / sarr [a coin, a (multiasset positive_coin)]
842842

843843
mint :: Rule
844-
mint = "mint" =:= mp [1 <+ asKey policy_id ==> mp [1 <+ asKey asset_name ==> nonZeroInt64]]
844+
mint = "mint" =:= mp [1 <+ asKey policy_id ==> mp [1 <+ asKey asset_name ==> nonzero_int64]]
845845

846846
epoch_no :: Rule
847847
epoch_no = "epoch_no" =:= VUInt `sized` (8 :: Word64)

eras/dijkstra/impl/cddl-files/dijkstra.cddl

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ language = 0/ 1/ 2
2323

2424
potential_languages = 0 .. 255
2525

26-
signkeyKES = bytes .size 64
26+
signkey_kes = bytes .size 64
2727

2828
certificate =
2929
[ stake_registration
@@ -228,9 +228,9 @@ hash28 = bytes .size 28
228228

229229
asset_name = bytes .size (0 .. 32)
230230

231-
positive_coin = 1 .. maxWord64
231+
positive_coin = 1 .. max_word64
232232

233-
maxWord64 = 18446744073709551615
233+
max_word64 = 18446744073709551615
234234

235235
; NEW starting with babbage
236236
; datum_option
@@ -311,7 +311,11 @@ script_any = (2, [* native_script])
311311

312312
script_n_of_k = (3, n : int64, [* native_script])
313313

314-
int64 = -9223372036854775808 .. 9223372036854775807
314+
int64 = min_int64 .. max_int64
315+
316+
min_int64 = -9223372036854775808
317+
318+
max_int64 = 9223372036854775807
315319

316320
invalid_before = (4, slot_no)
317321

@@ -431,13 +435,13 @@ withdrawals = {+ reward_account => coin}
431435

432436
auxiliary_data_hash = hash32
433437

434-
mint = {+ policy_id => {+ asset_name => nonZeroInt64}}
438+
mint = {+ policy_id => {+ asset_name => nonzero_int64}}
435439

436-
nonZeroInt64 = negInt64/ posInt64
440+
nonzero_int64 = negative_int64/ positive_int64
437441

438-
negInt64 = -9223372036854775808 .. -1
442+
negative_int64 = min_int64 .. -1
439443

440-
posInt64 = 1 .. 9223372036854775807
444+
positive_int64 = 1 .. max_int64
441445

442446
; This is a hash of data which may affect evaluation of a script.
443447
; This data consists of:
@@ -587,7 +591,7 @@ protocol_param_update =
587591
, ? 33 : nonnegative_interval ; minfee refScript coins per byte
588592
, ? 34 : uint .size 4 ; max refScript size per block
589593
, ? 35 : uint .size 4 ; max refScript size per tx
590-
, ? 36 : posWord32 ; refScript cost stride
594+
, ? 36 : positive_word32 ; refScript cost stride
591595
, ? 37 : positive_interval ; refScript cost multiplier
592596
}
593597

@@ -596,7 +600,7 @@ epoch_interval = uint .size 4
596600

597601
nonnegative_interval = #6.30([uint, positive_int])
598602

599-
positive_int = 1 .. maxWord64
603+
positive_int = 1 .. max_word64
600604

601605
; The format for cost_models is flexible enough to allow adding
602606
; Plutus built-ins and language versions in the future.
@@ -637,9 +641,9 @@ drep_voting_thresholds =
637641
]
638642

639643

640-
posWord32 = 1 .. maxWord32
644+
positive_word32 = 1 .. max_word32
641645

642-
maxWord32 = 4294967295
646+
max_word32 = 4294967295
643647

644648
positive_interval = #6.30([positive_int, positive_int])
645649

eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra/CDDL.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dijkstraCDDL =
3232
, HIRule kes_signature
3333
, HIRule language
3434
, HIRule potential_languages
35-
, HIRule signkeyKES
35+
, HIRule signkey_kes
3636
, -- Certificates
3737
HIRule certificate
3838
, HIGroup stake_registration
@@ -322,7 +322,7 @@ protocol_param_update =
322322
, opt (idx 33 ==> nonnegative_interval) //- "minfee refScript coins per byte"
323323
, opt (idx 34 ==> (VUInt `sized` (4 :: Word64))) //- "max refScript size per block"
324324
, opt (idx 35 ==> (VUInt `sized` (4 :: Word64))) //- "max refScript size per tx"
325-
, opt (idx 36 ==> posWord32) //- "refScript cost stride"
325+
, opt (idx 36 ==> positive_word32) //- "refScript cost stride"
326326
, opt (idx 37 ==> positive_interval) //- "refScript cost multiplier"
327327
]
328328

eras/mary/impl/cddl-files/mary.cddl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,21 @@ protocol_param_update =
275275

276276
nonnegative_interval = #6.30([uint, positive_int])
277277

278-
positive_int = 1 .. maxWord64
278+
positive_int = 1 .. max_word64
279279

280-
maxWord64 = 18446744073709551615
280+
max_word64 = 18446744073709551615
281281

282282
nonce = [0// 1, bytes .size 32]
283283

284284
metadata_hash = hash32
285285

286286
mint = multiasset<int64>
287287

288-
int64 = -9223372036854775808 .. 9223372036854775807
288+
int64 = min_int64 .. max_int64
289+
290+
min_int64 = -9223372036854775808
291+
292+
max_int64 = 9223372036854775807
289293

290294
transaction_witness_set =
291295
{? 0 : [* vkeywitness], ? 1 : [* native_script], ? 2 : [* bootstrap_witness]}

0 commit comments

Comments
 (0)