@@ -14,7 +14,8 @@ module Main (module Main) where
1414
1515import Cardano.Api
1616import qualified Cardano.Api.Ledger as Api
17- import Cardano.Api.Shelley (ProtocolParameters (.. ), fromPlutusData )
17+ import Cardano.Api.Shelley (fromPlutusData , sgNetworkMagic )
18+ import Cardano.Api.Internal.ProtocolParameters (ProtocolParameters (.. ))
1819
1920#ifdef WITH_LIBRARY
2021import Cardano.Benchmarking.PlutusScripts
116117-- helper functions move them out-of-line, with an extra helper to
117118-- avoid repeating the failure message.
118119showFundCore :: IsShelleyBasedEra era => Maybe (AddressInEra era , Api. Coin ) -> String
119- showFundCore = maybe " fund check failed " show
120+ showFundCore = maybe " no fund found for given key in genesis " show
120121
121122showBabbage :: Maybe (AddressInEra BabbageEra , Api. Coin ) -> String
122123showBabbage = (" Babbage: " ++ ) . showFundCore
@@ -135,14 +136,16 @@ checkFund nixService shelleyGenesis signingKey
135136 | AnyCardanoEra ConwayEra <- _nix_era nixService
136137 = showConway $ checkFundCore shelleyGenesis signingKey
137138 | otherwise
138- = " ApiTest: unrecognized era"
139+ = " ApiTest.checkFund : unrecognized era"
139140
140141checkFundCore ::
141142 IsShelleyBasedEra era
142143 => ShelleyGenesis
143144 -> SigningKey PaymentKey
144145 -> Maybe (AddressInEra era , Api. Coin )
145- checkFundCore = genesisInitialFundForKey Mainnet
146+ checkFundCore sg = genesisInitialFundForKey networkId sg
147+ where
148+ networkId = fromNetworkMagic $ NetworkMagic $ sgNetworkMagic sg
146149
147150checkPlutusBuiltin :: FilePath -> IO ()
148151#ifndef WITH_LIBRARY
0 commit comments