Skip to content

Commit 2028a10

Browse files
authored
feat: Shelley genesis UTxOs (#758)
Signed-off-by: Aurora Gaffney <[email protected]>
1 parent 665893e commit 2028a10

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
connectrpc.com/connect v1.18.1
99
connectrpc.com/grpchealth v1.4.0
1010
connectrpc.com/grpcreflect v1.3.0
11-
github.com/blinklabs-io/gouroboros v0.124.0
11+
github.com/blinklabs-io/gouroboros v0.125.0
1212
github.com/blinklabs-io/ouroboros-mock v0.3.8
1313
github.com/dgraph-io/badger/v4 v4.7.0
1414
github.com/glebarez/sqlite v1.11.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1
1515
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
1616
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
1717
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
18-
github.com/blinklabs-io/gouroboros v0.124.0 h1:k6C5Dd73PtCpUq50TA1o24MHfHXtoKu7hGTrFv1BEUY=
19-
github.com/blinklabs-io/gouroboros v0.124.0/go.mod h1:LUGnvJ1iOmpCihNxT9fyZFf6KD5E45sV8ZqEUgljzDw=
18+
github.com/blinklabs-io/gouroboros v0.125.0 h1:hx2xFSnjR5FgrZUBi8fVcR1umRM07L8Q8vJRUgTRKBI=
19+
github.com/blinklabs-io/gouroboros v0.125.0/go.mod h1:LUGnvJ1iOmpCihNxT9fyZFf6KD5E45sV8ZqEUgljzDw=
2020
github.com/blinklabs-io/ouroboros-mock v0.3.8 h1:+DAt2rx0ouZUxee5DBMgZq3I1+ZdxFSHG9g3tYl/FKU=
2121
github.com/blinklabs-io/ouroboros-mock v0.3.8/go.mod h1:UwQIf4KqZwO13P9d90fbi3UL/X7JaJfeEbqk+bEeFQA=
2222
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=

ledger/chainsync.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,16 @@ func (ls *LedgerState) createGenesisBlock() error {
207207
err := txn.Do(func(txn *database.Txn) error {
208208
// Record genesis UTxOs
209209
byronGenesis := ls.config.CardanoNodeConfig.ByronGenesis()
210-
genesisUtxos, err := byronGenesis.GenesisUtxos()
210+
byronGenesisUtxos, err := byronGenesis.GenesisUtxos()
211211
if err != nil {
212-
return fmt.Errorf("failed to generate genesis UTxOs: %w", err)
212+
return fmt.Errorf("generate Byron genesis UTxOs: %w", err)
213213
}
214-
for _, utxo := range genesisUtxos {
214+
shelleyGenesis := ls.config.CardanoNodeConfig.ShelleyGenesis()
215+
shelleyGenesisUtxos, err := shelleyGenesis.GenesisUtxos()
216+
if err != nil {
217+
return fmt.Errorf("generate Shelley genesis UTxOs: %w", err)
218+
}
219+
for _, utxo := range slices.Concat(byronGenesisUtxos, shelleyGenesisUtxos) {
215220
outAddr := utxo.Output.Address()
216221
outputCbor, err := cbor.Encode(utxo.Output)
217222
if err != nil {

0 commit comments

Comments
 (0)