From 4d2913c5d3d195d7ae868fc29cea643f7426010d Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Tue, 2 Apr 2024 10:56:11 -0400 Subject: [PATCH] Review fixes --- cardano-testnet/src/Testnet/Components/SPO.hs | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/cardano-testnet/src/Testnet/Components/SPO.hs b/cardano-testnet/src/Testnet/Components/SPO.hs index 67ca17e6130..5aeaaaa27ac 100644 --- a/cardano-testnet/src/Testnet/Components/SPO.hs +++ b/cardano-testnet/src/Testnet/Components/SPO.hs @@ -108,6 +108,7 @@ checkStakeKeyRegistered tempAbsP nodeConfigFile sPath terminationEpoch execConfi terminationEpoch (DelegationsAndRewards (mempty, mempty)) (handler sAddr) + case result of Right (_, dag) -> return dag Left e -> do @@ -117,17 +118,16 @@ checkStakeKeyRegistered tempAbsP nodeConfigFile sPath terminationEpoch execConfi , "--out-file", oFpAbs ] - pledgerStakeInfo <- H.leftFailM $ H.readJsonFile oFpAbs - (DelegationsAndRewards (rewardsMap, _delegMap)) - <- H.noteShowM $ H.jsonErrorFail $ Aeson.fromJSON @DelegationsAndRewards pledgerStakeInfo + DelegationsAndRewards (rewardsMap, _delegMap) <- H.noteShowM $ H.readJsonFileOk oFpAbs + H.failWithCustom GHC.callStack Nothing - $ unlines [ "Stake address in question: " - , Text.unpack (serialiseToBech32 sAddr) - , "was not registered" - , "Current stake info for address in question: " - , show $ map serialiseToBech32 $ Map.keys rewardsMap - , "foldEpochStateError: " <> show e - ] + $ unlines [ "Stake address in question: " + , Text.unpack (serialiseToBech32 sAddr) + , "was not registered" + , "Current stake info for address in question: " + , show $ map serialiseToBech32 $ Map.keys rewardsMap + , "foldEpochStateError: " <> show e + ] where handler :: StakeAddress -> AnyNewEpochState -> SlotNo -> BlockNo -> StateT DelegationsAndRewards IO LedgerStateCondition handler (StakeAddress network sCred) (AnyNewEpochState sbe newEpochState) _ _ = @@ -377,8 +377,7 @@ registerSingleSpo identifier tap@(TmpAbsolutePath tempAbsPath') nodeConfigFile s [ "transaction", "submit" , "--tx-file", pledgeAndPoolRegistrationTx ] - -- TODO: Currently we can't propagate the error message thrown by checkStakeKeyRegistered when using byDurationM - -- Instead we wait 15 seconds + -- Check the pledger/owner stake key was registered delegsAndRewards <- checkStakeKeyRegistered