Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cardano-testnet-test: small improvements #5962

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,9 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "babbage-leadership-sched
H.note_ SYS.os
conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } <- mkConf tempAbsBasePath'
let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath

let sbe = shelleyBasedEra @BabbageEra
sbe = shelleyBasedEra @BabbageEra
cTestnetOptions = cardanoDefaultTestnetOptions
{ cardanoNodes = cardanoDefaultTestnetNodeOptions
, cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
, cardanoActiveSlotsCoeff = 0.1
{ cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
}

tr@TestnetRuntime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,13 @@ hprop_stakeSnapshot = integrationRetryWorkspace 2 "babbage-stake-snapshot" $ \te
H.note_ SYS.os
conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath'
let tempAbsPath' = unTmpAbsPath tempAbsPath

let
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
sbe = ShelleyBasedEraBabbage
options = cardanoDefaultTestnetOptions
{ cardanoNodes = cardanoDefaultTestnetNodeOptions
, cardanoSlotLength = 0.1
, cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
}
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'

TestnetRuntime
{ testnetMagic
, poolNodes
, configurationFile
} <- cardanoTestnetDefault options conf
} <- cardanoTestnetDefault cardanoDefaultTestnetOptions conf

poolNode1 <- H.headM poolNodes
poolSprocket1 <- H.noteShow $ nodeSprocket $ poolRuntime poolNode1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,13 @@ hprop_stakeSnapshot = integrationRetryWorkspace 2 "conway-stake-snapshot" $ \tem
H.note_ SYS.os
conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath'
let tempAbsPath' = unTmpAbsPath tempAbsPath

let
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
sbe = ShelleyBasedEraBabbage
options = cardanoDefaultTestnetOptions
{ cardanoNodes = cardanoDefaultTestnetNodeOptions
, cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
}
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'

TestnetRuntime
{ testnetMagic
, poolNodes
, configurationFile
} <- cardanoTestnetDefault options conf
} <- cardanoTestnetDefault cardanoDefaultTestnetOptions conf

poolNode1 <- H.headM poolNodes
poolSprocket1 <- H.noteShow $ nodeSprocket $ poolRuntime poolNode1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ hprop_kes_period_info = integrationRetryWorkspace 2 "kes-period-info" $ \tempAbs

let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath
sbe = ShelleyBasedEraBabbage
era = toCardanoEra sbe
anyEra = AnyCardanoEra era
eraString = eraToString sbe
cTestnetOptions = cardanoDefaultTestnetOptions
{ cardanoNodes = cardanoDefaultTestnetNodeOptions
, cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
, cardanoActiveSlotsCoeff = 0.1
{ cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
}

runTime@TestnetRuntime
Expand All @@ -78,7 +75,7 @@ hprop_kes_period_info = integrationRetryWorkspace 2 "kes-period-info" $ \tempAbs
let utxoAddr = Text.unpack $ paymentKeyInfoAddr wallet0
utxoSKeyFile = signingKeyFp $ paymentKeyInfoPair wallet0
void $ execCli' execConfig
[ anyEraToString anyEra, "query", "utxo"
[ eraString, "query", "utxo"
, "--address", utxoAddr
, "--cardano-mode"
, "--out-file", work </> "utxo-1.json"
Expand Down Expand Up @@ -153,7 +150,7 @@ hprop_kes_period_info = integrationRetryWorkspace 2 "kes-period-info" $ \tempAbs
H.note_ "Get updated UTxO"

void $ execCli' execConfig
[ anyEraToString anyEra, "query", "utxo"
[ eraString, "query", "utxo"
, "--address", utxoAddr
, "--cardano-mode"
, "--out-file", work </> "utxo-2.json"
Expand All @@ -165,8 +162,7 @@ hprop_kes_period_info = integrationRetryWorkspace 2 "kes-period-info" $ \tempAbs
UTxO utxo2 <- H.noteShowM $ decodeEraUTxO sbe utxo2Json
txin2 <- H.noteShow =<< H.headM (Map.keys utxo2)

let eraString = eraToString sbe
delegRegTestDelegatorTxBodyFp = work </> "deleg-register-test-delegator.txbody"
let delegRegTestDelegatorTxBodyFp = work </> "deleg-register-test-delegator.txbody"

void $ execCli' execConfig
[ eraString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ module Cardano.Testnet.Test.Cli.QuerySlotNumber
( hprop_querySlotNumber
) where

import Cardano.Api

import Cardano.Ledger.Shelley.Genesis (fromNominalDiffTimeMicro)
import Cardano.Slotting.Slot
import Cardano.Testnet
Expand Down Expand Up @@ -42,17 +40,11 @@ hprop_querySlotNumber = integrationRetryWorkspace 2 "query-slot-number" $ \tempA
conf <- mkConf tempAbsBasePath'

let tempBaseAbsPath' = makeTmpBaseAbsPath $ tempAbsPath conf
sbe = ShelleyBasedEraBabbage
options = cardanoDefaultTestnetOptions
{ cardanoNodes = cardanoDefaultTestnetNodeOptions
, cardanoSlotLength = 0.1
, cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
}

tr@TestnetRuntime
{ testnetMagic
, poolNodes
} <- cardanoTestnetDefault options conf
} <- cardanoTestnetDefault cardanoDefaultTestnetOptions conf
ShelleyGenesis{sgSlotLength, sgEpochLength} <- H.noteShowM $ shelleyGenesis tr
startTime <- H.noteShowM $ getStartTime tempAbsBasePath' tr

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,13 @@ hprop_transaction = integrationRetryWorkspace 0 "submit-api-babbage-transaction"
H.note_ SYS.os
conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath'
let tempAbsPath' = unTmpAbsPath tempAbsPath
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"
sbe = ShelleyBasedEraBabbage
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
options = cardanoDefaultTestnetOptions
{ cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
}

let
sbe = ShelleyBasedEraBabbage
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
options = cardanoDefaultTestnetOptions
{ cardanoNodes = cardanoDefaultTestnetNodeOptions
, cardanoSlotLength = 0.1
, cardanoNodeEra = AnyShelleyBasedEra sbe -- TODO: We should only support the latest era and the upcoming era
}
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

TestnetRuntime
{ configurationFile
Expand Down
Loading