Skip to content

Commit

Permalink
Propagate base record removal to Babbage and Cardano testnets
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Jun 2, 2023
1 parent 9218ca5 commit bfe29ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions cardano-testnet/src/Testnet/Babbage.hs
Expand Up @@ -54,7 +54,7 @@ startTimeOffsetSeconds = if OS.isWin32 then 90 else 15
babbageTestnet :: BabbageTestnetOptions -> H.Conf -> H.Integration TestnetRuntime
babbageTestnet testnetOptions H.Conf {..} = do
H.lbsWriteFile (tempAbsPath </> "byron.genesis.spec.json")
. encode $ defaultByronGenesisJsonValue
. encode $ defaultByronProtocolParamsJsonValue

void $ H.note OS.os
currentTime <- H.noteShowIO DTC.getCurrentTime
Expand All @@ -72,13 +72,13 @@ babbageTestnet testnetOptions H.Conf {..} = do
-- are deprecated, we must use the "create-staked" cli command to create
-- SPOs in the ShelleyGenesis

alonzoBabbageTestGenesisJsonSourceFile <- H.noteShow $ base </> "scripts/babbage/alonzo-babbage-test-genesis.json"
alonzoBabbageTestGenesisJsonTargetFile <- H.noteShow $ tempAbsPath </> "genesis.alonzo.spec.json"
H.copyFile alonzoBabbageTestGenesisJsonSourceFile alonzoBabbageTestGenesisJsonTargetFile
case defaultAlonzoGenesis of
Left e -> H.onFailure . H.noteIO_ . return $ displayError e
Right gen -> H.evalIO $ LBS.writeFile alonzoBabbageTestGenesisJsonTargetFile $ encode gen

conwayBabbageTestGenesisJsonSourceFile <- H.noteShow $ base </> "scripts/babbage/conway-babbage-test-genesis.json"
conwayBabbageTestGenesisJsonTargetFile <- H.noteShow $ tempAbsPath </> "genesis.conway.spec.json"
H.copyFile conwayBabbageTestGenesisJsonSourceFile conwayBabbageTestGenesisJsonTargetFile
H.evalIO $ LBS.writeFile conwayBabbageTestGenesisJsonTargetFile $ encode defaultConwayGenesis

configurationFile <- H.noteShow $ tempAbsPath </> "configuration.yaml"

Expand Down
13 changes: 6 additions & 7 deletions cardano-testnet/src/Testnet/Cardano.hs
Expand Up @@ -219,7 +219,7 @@ cardanoTestnet testnetOptions H.Conf {..} = do
H.writeFile (tempAbsPath </> node </> "port") (show port)

H.lbsWriteFile (tempAbsPath </> "byron.genesis.spec.json")
. J.encode $ defaultByronGenesisJsonValue
. J.encode $ defaultByronProtocolParamsJsonValue

-- stuff
execCli_
Expand Down Expand Up @@ -317,15 +317,14 @@ cardanoTestnet testnetOptions H.Conf {..} = do
-- Set up our template
shelleyDir <- H.createDirectoryIfMissing $ tempAbsPath </> "shelley"

-- TODO: This is fragile, we should be passing in all necessary
-- configuration files.
let sourceAlonzoGenesisSpecFile = base </> "cardano-testnet/files/data/alonzo/genesis.alonzo.spec.json"
alonzoSpecFile <- H.noteTempFile tempAbsPath "shelley/genesis.alonzo.spec.json"
H.copyFile sourceAlonzoGenesisSpecFile alonzoSpecFile
case defaultAlonzoGenesis of
Left e -> H.onFailure . H.noteIO_ . return $ displayError e
Right gen -> H.evalIO $ LBS.writeFile alonzoSpecFile $ J.encode gen


let sourceConwayGenesisSpecFile = base </> "cardano-testnet/files/data/conway/genesis.conway.spec.json"
conwaySpecFile <- H.noteTempFile tempAbsPath "shelley/genesis.conway.spec.json"
H.copyFile sourceConwayGenesisSpecFile conwaySpecFile
H.evalIO $ LBS.writeFile conwaySpecFile $ J.encode defaultConwayGenesis

execCli_
[ "genesis", "create"
Expand Down

0 comments on commit bfe29ac

Please sign in to comment.