1
- // Copyright 2024 Blink Labs Software
1
+ // Copyright 2025 Blink Labs Software
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ import (
18
18
"encoding/hex"
19
19
"encoding/json"
20
20
"io"
21
+ "math/big"
21
22
"os"
22
23
"time"
23
24
@@ -35,7 +36,7 @@ type ShelleyGenesis struct {
35
36
EpochLength int `json:"epochLength"`
36
37
SlotsPerKESPeriod int `json:"slotsPerKESPeriod"`
37
38
MaxKESEvolutions int `json:"maxKESEvolutions"`
38
- SlotLength int `json:"slotLength"`
39
+ SlotLength common. GenesisRat `json:"slotLength"`
39
40
UpdateQuorum int `json:"updateQuorum"`
40
41
MaxLovelaceSupply uint64 `json:"maxLovelaceSupply"`
41
42
ProtocolParameters ShelleyGenesisProtocolParams `json:"protocolParams"`
@@ -71,6 +72,7 @@ func (g ShelleyGenesis) MarshalCBOR() ([]byte, error) {
71
72
map [any ]any {},
72
73
}
73
74
}
75
+ slotLengthMs := & big.Rat {}
74
76
tmpData := []any {
75
77
[]any {
76
78
g .SystemStart .Year (),
@@ -87,7 +89,7 @@ func (g ShelleyGenesis) MarshalCBOR() ([]byte, error) {
87
89
g .EpochLength ,
88
90
g .SlotsPerKESPeriod ,
89
91
g .MaxKESEvolutions ,
90
- g .SlotLength * 1_000_000 ,
92
+ slotLengthMs . Mul ( g .SlotLength . Rat , big . NewRat ( 1_000_000 , 1 )) ,
91
93
g .UpdateQuorum ,
92
94
g .MaxLovelaceSupply ,
93
95
g .ProtocolParameters ,
0 commit comments