@@ -14,7 +14,7 @@ module Main (module Main) where
1414
1515import Cardano.Api
1616import qualified Cardano.Api.Ledger as Api
17- import Cardano.Api.Shelley (fromPlutusData )
17+ import Cardano.Api.Shelley (fromPlutusData , sgNetworkMagic )
1818import Cardano.Api.Internal.ProtocolParameters (ProtocolParameters (.. ))
1919
2020#ifdef WITH_LIBRARY
117117-- helper functions move them out-of-line, with an extra helper to
118118-- avoid repeating the failure message.
119119showFundCore :: IsShelleyBasedEra era => Maybe (AddressInEra era , Api. Coin ) -> String
120- showFundCore = maybe " fund check failed " show
120+ showFundCore = maybe " no fund found for given key in genesis " show
121121
122122showBabbage :: Maybe (AddressInEra BabbageEra , Api. Coin ) -> String
123123showBabbage = (" Babbage: " ++ ) . showFundCore
@@ -136,14 +136,16 @@ checkFund nixService shelleyGenesis signingKey
136136 | AnyCardanoEra ConwayEra <- _nix_era nixService
137137 = showConway $ checkFundCore shelleyGenesis signingKey
138138 | otherwise
139- = " ApiTest: unrecognized era"
139+ = " ApiTest.checkFund : unrecognized era"
140140
141141checkFundCore ::
142142 IsShelleyBasedEra era
143143 => ShelleyGenesis
144144 -> SigningKey PaymentKey
145145 -> Maybe (AddressInEra era , Api. Coin )
146- checkFundCore = genesisInitialFundForKey Mainnet
146+ checkFundCore sg = genesisInitialFundForKey networkId sg
147+ where
148+ networkId = fromNetworkMagic $ NetworkMagic $ sgNetworkMagic sg
147149
148150checkPlutusBuiltin :: FilePath -> IO ()
149151#ifndef WITH_LIBRARY
0 commit comments