diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 498be31894..46feec17f7 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,3 @@ e28fadbebc18b87991f84af72d8611393ae8875a b76f949e815990545371530a466b16f691a3aa98 +73fd9122f78282b1db7f6884b3bc23fb29f3e67f diff --git a/cardano-api/internal/Cardano/Api/Convenience/Query.hs b/cardano-api/internal/Cardano/Api/Convenience/Query.hs index 8eab5890f6..e78b1636b0 100644 --- a/cardano-api/internal/Cardano/Api/Convenience/Query.hs +++ b/cardano-api/internal/Cardano/Api/Convenience/Query.hs @@ -99,23 +99,23 @@ queryStateForBalancedTx -> [TxIn] -> [Certificate era] -> LocalStateQueryExpr - block - point - QueryInMode - r - IO - ( Either - QueryConvenienceError - ( UTxO era - , LedgerProtocolParameters era - , EraHistory - , SystemStart - , Set PoolId - , Map StakeCredential L.Coin - , Map (L.Credential L.DRepRole L.StandardCrypto) L.Coin - , Maybe (Featured ConwayEraOnwards era TxCurrentTreasuryValue) - ) - ) + block + point + QueryInMode + r + IO + ( Either + QueryConvenienceError + ( UTxO era + , LedgerProtocolParameters era + , EraHistory + , SystemStart + , Set PoolId + , Map StakeCredential L.Coin + , Map (L.Credential L.DRepRole L.StandardCrypto) L.Coin + , Maybe (Featured ConwayEraOnwards era TxCurrentTreasuryValue) + ) + ) queryStateForBalancedTx era allTxIns certs = runExceptT $ do sbe <- requireShelleyBasedEra era diff --git a/cardano-api/internal/Cardano/Api/Fees.hs b/cardano-api/internal/Cardano/Api/Fees.hs index 81a1eedf12..59383ec32b 100644 --- a/cardano-api/internal/Cardano/Api/Fees.hs +++ b/cardano-api/internal/Cardano/Api/Fees.hs @@ -673,8 +673,8 @@ evaluateTransactionExecutionUnits -> UTxO era -> TxBody era -> Either - (TransactionValidityError era) - (Map ScriptWitnessIndex (Either ScriptExecutionError (EvalTxExecutionUnitsLog, ExecutionUnits))) + (TransactionValidityError era) + (Map ScriptWitnessIndex (Either ScriptExecutionError (EvalTxExecutionUnitsLog, ExecutionUnits))) evaluateTransactionExecutionUnits era systemstart epochInfo pp utxo txbody = case makeSignedTransaction' era [] txbody of ShelleyTx sbe tx' -> evaluateTransactionExecutionUnitsShelley sbe systemstart epochInfo pp utxo tx' @@ -689,8 +689,8 @@ evaluateTransactionExecutionUnitsShelley -> UTxO era -> L.Tx (ShelleyLedgerEra era) -> Either - (TransactionValidityError era) - (Map ScriptWitnessIndex (Either ScriptExecutionError (EvalTxExecutionUnitsLog, ExecutionUnits))) + (TransactionValidityError era) + (Map ScriptWitnessIndex (Either ScriptExecutionError (EvalTxExecutionUnitsLog, ExecutionUnits))) evaluateTransactionExecutionUnitsShelley sbe systemstart epochInfo (LedgerProtocolParameters pp) utxo tx = caseShelleyToMaryOrAlonzoEraOnwards (const (Right Map.empty)) @@ -707,8 +707,8 @@ evaluateTransactionExecutionUnitsShelley sbe systemstart epochInfo (LedgerProtoc :: Alonzo.AlonzoEraScript (ShelleyLedgerEra era) => AlonzoEraOnwards era -> Map - (L.PlutusPurpose L.AsIx (ShelleyLedgerEra era)) - (Either (L.TransactionScriptFailure (ShelleyLedgerEra era)) (EvalTxExecutionUnitsLog, Alonzo.ExUnits)) + (L.PlutusPurpose L.AsIx (ShelleyLedgerEra era)) + (Either (L.TransactionScriptFailure (ShelleyLedgerEra era)) (EvalTxExecutionUnitsLog, Alonzo.ExUnits)) -> Map ScriptWitnessIndex (Either ScriptExecutionError (EvalTxExecutionUnitsLog, ExecutionUnits)) fromLedgerScriptExUnitsMap aOnwards exmap = fromList @@ -1502,15 +1502,15 @@ substituteExecutionUnits let mappedScriptWitnesses :: [ ( Certificate era , Either - (TxBodyErrorAutoBalance era) - ( BuildTxWith - BuildTx - ( Maybe - ( StakeCredential - , Witness WitCtxStake era - ) - ) - ) + (TxBodyErrorAutoBalance era) + ( BuildTxWith + BuildTx + ( Maybe + ( StakeCredential + , Witness WitCtxStake era + ) + ) + ) ) ] mappedScriptWitnesses = @@ -1523,8 +1523,8 @@ substituteExecutionUnits mapScriptWitnessesVotes :: Maybe (Featured ConwayEraOnwards era (TxVotingProcedures build era)) -> Either - (TxBodyErrorAutoBalance era) - (Maybe (Featured ConwayEraOnwards era (TxVotingProcedures build era))) + (TxBodyErrorAutoBalance era) + (Maybe (Featured ConwayEraOnwards era (TxVotingProcedures build era))) mapScriptWitnessesVotes Nothing = return Nothing mapScriptWitnessesVotes (Just (Featured _ TxVotingProceduresNone)) = return Nothing mapScriptWitnessesVotes (Just (Featured _ (TxVotingProcedures _ ViewTx))) = return Nothing @@ -1544,8 +1544,8 @@ substituteExecutionUnits mapScriptWitnessesProposals :: Maybe (Featured ConwayEraOnwards era (TxProposalProcedures build era)) -> Either - (TxBodyErrorAutoBalance era) - (Maybe (Featured ConwayEraOnwards era (TxProposalProcedures build era))) + (TxBodyErrorAutoBalance era) + (Maybe (Featured ConwayEraOnwards era (TxProposalProcedures build era))) mapScriptWitnessesProposals Nothing = return Nothing mapScriptWitnessesProposals (Just (Featured _ TxProposalProceduresNone)) = return Nothing mapScriptWitnessesProposals (Just (Featured _ (TxProposalProcedures _ ViewTx))) = return Nothing diff --git a/cardano-api/internal/Cardano/Api/IPC.hs b/cardano-api/internal/Cardano/Api/IPC.hs index bfba54487b..23e1e254a7 100644 --- a/cardano-api/internal/Cardano/Api/IPC.hs +++ b/cardano-api/internal/Cardano/Api/IPC.hs @@ -237,16 +237,16 @@ mkVersionedProtocols -> ProtocolClientInfoArgs block -> (NodeToClientVersion -> LocalNodeClientProtocolsForBlock block) -> Net.Versions - Net.NodeToClientVersion - Net.NodeToClientVersionData - ( Net.OuroborosApplicationWithMinimalCtx - Net.InitiatorMode - Net.LocalAddress - LBS.ByteString - IO - () - Void - ) + Net.NodeToClientVersion + Net.NodeToClientVersionData + ( Net.OuroborosApplicationWithMinimalCtx + Net.InitiatorMode + Net.LocalAddress + LBS.ByteString + IO + () + Void + ) mkVersionedProtocols networkid ptcl unversionedClients = -- TODO: really we should construct specific combinations of -- protocols for the versions we know about, with different protocol @@ -357,10 +357,10 @@ data LocalNodeClientParams where LocalNodeClientParamsSingleBlock :: ( ProtocolClient block , Consensus.LedgerSupportsProtocol - ( Consensus.ShelleyBlock - (Consensus.TPraos Consensus.StandardCrypto) - (Consensus.ShelleyEra Consensus.StandardCrypto) - ) + ( Consensus.ShelleyBlock + (Consensus.TPraos Consensus.StandardCrypto) + (Consensus.ShelleyEra Consensus.StandardCrypto) + ) ) => ProtocolClientInfoArgs block -> (NodeToClientVersion -> LocalNodeClientProtocolsForBlock block) @@ -375,36 +375,36 @@ data LocalNodeClientProtocolsForBlock block = LocalNodeClientProtocolsForBlock { localChainSyncClientForBlock :: LocalChainSyncClient - block - (Consensus.Point block) - (Net.Tip block) - IO + block + (Consensus.Point block) + (Net.Tip block) + IO , localStateQueryClientForBlock :: Maybe - ( LocalStateQueryClient - block - (Consensus.Point block) - (Consensus.Query block) - IO - () - ) + ( LocalStateQueryClient + block + (Consensus.Point block) + (Consensus.Query block) + IO + () + ) , localTxSubmissionClientForBlock :: Maybe - ( LocalTxSubmissionClient - (Consensus.GenTx block) - (Consensus.ApplyTxErr block) - IO - () - ) + ( LocalTxSubmissionClient + (Consensus.GenTx block) + (Consensus.ApplyTxErr block) + IO + () + ) , localTxMonitoringClientForBlock :: Maybe - ( LocalTxMonitorClient - (Consensus.TxId (Consensus.GenTx block)) - (Consensus.GenTx block) - SlotNo - IO - () - ) + ( LocalTxMonitorClient + (Consensus.TxId (Consensus.GenTx block)) + (Consensus.GenTx block) + SlotNo + IO + () + ) } -- | Convert from the mode-parametrised style to the block-parametrised style. diff --git a/cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs b/cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs index 4c593243aa..b88d4ab1be 100644 --- a/cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs +++ b/cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs @@ -110,8 +110,8 @@ data PoolReapDetails = PoolReapDetails convertRetiredPoolsMap :: Map - (Ledger.StakeCredential StandardCrypto) - (Map (Ledger.KeyHash Ledger.StakePool StandardCrypto) Ledger.Coin) + (Ledger.StakeCredential StandardCrypto) + (Map (Ledger.KeyHash Ledger.StakePool StandardCrypto) Ledger.Coin) -> Map StakeCredential (Map (Hash StakePoolKey) L.Coin) convertRetiredPoolsMap = Map.mapKeys fromShelleyStakeCredential diff --git a/cardano-api/internal/Cardano/Api/LedgerState.hs b/cardano-api/internal/Cardano/Api/LedgerState.hs index a839e9cb22..7b0ce1d2ef 100644 --- a/cardano-api/internal/Cardano/Api/LedgerState.hs +++ b/cardano-api/internal/Cardano/Api/LedgerState.hs @@ -513,11 +513,11 @@ foldBlocks nodeConfigFilePath socketPath validationMode state0 accumulate = hand -> Env -> LedgerState -> CSP.ChainSyncClientPipelined - BlockInMode - ChainPoint - ChainTip - IO - () + BlockInMode + ChainPoint + ChainTip + IO + () -- \^ Client returns maybe an error. chainSyncClient pipelineSize stateIORef errorIORef env ledgerState0 = CSP.ChainSyncClientPipelined $ @@ -666,11 +666,11 @@ chainSyncClientWithLedgerState -- ^ Initial ledger state -> ValidationMode -> CS.ChainSyncClient - (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) - ChainPoint - ChainTip - m - a + (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) + ChainPoint + ChainTip + m + a -- ^ A client to wrap. The block is annotated with a 'Either LedgerStateError -- LedgerState'. This is either an error from validating a block or -- the current 'LedgerState' from applying the current block. If we @@ -678,11 +678,11 @@ chainSyncClientWithLedgerState -- after a block fails to validate we may still roll back to a validated -- block, in which case the valid 'LedgerState' will be passed here again. -> CS.ChainSyncClient - BlockInMode - ChainPoint - ChainTip - m - a + BlockInMode + ChainPoint + ChainTip + m + a -- ^ A client that acts just like the wrapped client but doesn't require the -- 'LedgerState' annotation on the block type. chainSyncClientWithLedgerState env ledgerState0 validationMode (CS.ChainSyncClient clientTop) = @@ -691,17 +691,17 @@ chainSyncClientWithLedgerState env ledgerState0 validationMode (CS.ChainSyncClie goClientStIdle :: Either LedgerStateError (History (Either LedgerStateError LedgerStateEvents)) -> CS.ClientStIdle - (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) - ChainPoint - ChainTip - m - a + (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) + ChainPoint + ChainTip + m + a -> CS.ClientStIdle - BlockInMode - ChainPoint - ChainTip - m - a + BlockInMode + ChainPoint + ChainTip + m + a goClientStIdle history client = case client of CS.SendMsgRequestNext a b -> CS.SendMsgRequestNext a (goClientStNext history b) CS.SendMsgFindIntersect ps a -> CS.SendMsgFindIntersect ps (goClientStIntersect history a) @@ -712,17 +712,17 @@ chainSyncClientWithLedgerState env ledgerState0 validationMode (CS.ChainSyncClie goClientStNext :: Either LedgerStateError (History (Either LedgerStateError LedgerStateEvents)) -> CS.ClientStNext - (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) - ChainPoint - ChainTip - m - a + (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) + ChainPoint + ChainTip + m + a -> CS.ClientStNext - BlockInMode - ChainPoint - ChainTip - m - a + BlockInMode + ChainPoint + ChainTip + m + a goClientStNext (Left err) (CS.ClientStNext recvMsgRollForward recvMsgRollBackward) = CS.ClientStNext ( \blkInMode tip -> @@ -762,9 +762,9 @@ chainSyncClientWithLedgerState env ledgerState0 validationMode (CS.ChainSyncClie _ Seq.:|> (s, _, _) -> s Seq.Empty -> error "Impossible! History should always be non-empty" history' = ( \h -> - if Seq.null h - then Left (InvalidRollback oldestSlot point) - else Right h + if Seq.null h + then Left (InvalidRollback oldestSlot point) + else Right h ) $ case point of ChainPointAtGenesis -> initialLedgerStateHistory @@ -777,17 +777,17 @@ chainSyncClientWithLedgerState env ledgerState0 validationMode (CS.ChainSyncClie goClientStIntersect :: Either LedgerStateError (History (Either LedgerStateError LedgerStateEvents)) -> CS.ClientStIntersect - (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) - ChainPoint - ChainTip - m - a + (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) + ChainPoint + ChainTip + m + a -> CS.ClientStIntersect - BlockInMode - ChainPoint - ChainTip - m - a + BlockInMode + ChainPoint + ChainTip + m + a goClientStIntersect history (CS.ClientStIntersect recvMsgIntersectFound recvMsgIntersectNotFound) = CS.ClientStIntersect ( \point tip -> @@ -809,17 +809,17 @@ chainSyncClientPipelinedWithLedgerState -> LedgerState -> ValidationMode -> CSP.ChainSyncClientPipelined - (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) - ChainPoint - ChainTip - m - a + (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) + ChainPoint + ChainTip + m + a -> CSP.ChainSyncClientPipelined - BlockInMode - ChainPoint - ChainTip - m - a + BlockInMode + ChainPoint + ChainTip + m + a chainSyncClientPipelinedWithLedgerState env ledgerState0 validationMode (CSP.ChainSyncClientPipelined clientTop) = CSP.ChainSyncClientPipelined (goClientPipelinedStIdle (Right initialLedgerStateHistory) Zero <$> clientTop) @@ -828,19 +828,19 @@ chainSyncClientPipelinedWithLedgerState env ledgerState0 validationMode (CSP.Cha :: Either LedgerStateError (History (Either LedgerStateError LedgerStateEvents)) -> Nat n -> CSP.ClientPipelinedStIdle - n - (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) - ChainPoint - ChainTip - m - a + n + (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) + ChainPoint + ChainTip + m + a -> CSP.ClientPipelinedStIdle - n - BlockInMode - ChainPoint - ChainTip - m - a + n + BlockInMode + ChainPoint + ChainTip + m + a goClientPipelinedStIdle history n client = case client of CSP.SendMsgRequestNext a b -> CSP.SendMsgRequestNext a (goClientStNext history n b) CSP.SendMsgRequestNextPipelined m a -> CSP.SendMsgRequestNextPipelined m (goClientPipelinedStIdle history (Succ n) a) @@ -858,19 +858,19 @@ chainSyncClientPipelinedWithLedgerState env ledgerState0 validationMode (CSP.Cha :: Either LedgerStateError (History (Either LedgerStateError LedgerStateEvents)) -> Nat n -> CSP.ClientStNext - n - (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) - ChainPoint - ChainTip - m - a + n + (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) + ChainPoint + ChainTip + m + a -> CSP.ClientStNext - n - BlockInMode - ChainPoint - ChainTip - m - a + n + BlockInMode + ChainPoint + ChainTip + m + a goClientStNext (Left err) n (CSP.ClientStNext recvMsgRollForward recvMsgRollBackward) = CSP.ClientStNext ( \blkInMode tip -> @@ -909,9 +909,9 @@ chainSyncClientPipelinedWithLedgerState env ledgerState0 validationMode (CSP.Cha _ Seq.:|> (s, _, _) -> s Seq.Empty -> error "Impossible! History should always be non-empty" history' = ( \h -> - if Seq.null h - then Left (InvalidRollback oldestSlot point) - else Right h + if Seq.null h + then Left (InvalidRollback oldestSlot point) + else Right h ) $ case point of ChainPointAtGenesis -> initialLedgerStateHistory @@ -924,17 +924,17 @@ chainSyncClientPipelinedWithLedgerState env ledgerState0 validationMode (CSP.Cha :: Either LedgerStateError (History (Either LedgerStateError LedgerStateEvents)) -> Nat n -> CSP.ClientPipelinedStIntersect - (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) - ChainPoint - ChainTip - m - a + (BlockInMode, Either LedgerStateError (LedgerState, [LedgerEvent])) + ChainPoint + ChainTip + m + a -> CSP.ClientPipelinedStIntersect - BlockInMode - ChainPoint - ChainTip - m - a + BlockInMode + ChainPoint + ChainTip + m + a goClientPipelinedStIntersect history _ (CSP.ClientPipelinedStIntersect recvMsgIntersectFound recvMsgIntersectNotFound) = CSP.ClientPipelinedStIntersect (\point tip -> goClientPipelinedStIdle history Zero <$> recvMsgIntersectFound point tip) @@ -1252,8 +1252,8 @@ type LedgerStateEvents = (LedgerState, [LedgerEvent]) toLedgerStateEvents :: Ledger.LedgerResult - (Consensus.CardanoLedgerState Consensus.StandardCrypto) - (Consensus.CardanoLedgerState Consensus.StandardCrypto) + (Consensus.CardanoLedgerState Consensus.StandardCrypto) + (Consensus.CardanoLedgerState Consensus.StandardCrypto) -> LedgerStateEvents toLedgerStateEvents lr = (ledgerState, ledgerEvents) where @@ -1288,7 +1288,7 @@ type NodeConfigFile = File NodeConfig mkProtocolInfoCardano :: GenesisConfig -> ( Consensus.ProtocolInfo - (Consensus.CardanoBlock Consensus.StandardCrypto) + (Consensus.CardanoBlock Consensus.StandardCrypto) , IO [BlockForging IO (Consensus.CardanoBlock Consensus.StandardCrypto)] ) mkProtocolInfoCardano (GenesisCardano dnc byronGenesis shelleyGenesisHash transCfg) = @@ -1862,8 +1862,8 @@ nextEpochEligibleLeadershipSlots sbe sGen serCurrEpochState ptclState poolid (Vr snapshot = ShelleyAPI.ssStakeMark $ ShelleyAPI.esSnapshots cEstate markSnapshotPoolDistr :: Map - (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) - (SL.IndividualPoolStake Consensus.StandardCrypto) + (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) + (SL.IndividualPoolStake Consensus.StandardCrypto) markSnapshotPoolDistr = ShelleyAPI.unPoolDistr . ShelleyAPI.calculatePoolDistr $ snapshot let slotRangeOfInterest :: Core.EraPParams ledgerera => Core.PParams ledgerera -> Set SlotNo @@ -1899,8 +1899,8 @@ isLeadingSlotsTPraos => Set SlotNo -> PoolId -> Map - (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) - (SL.IndividualPoolStake Consensus.StandardCrypto) + (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) + (SL.IndividualPoolStake Consensus.StandardCrypto) -> Consensus.Nonce -> Crypto.SignKeyVRF v -> Ledger.ActiveSlotCoeff @@ -1924,8 +1924,8 @@ isLeadingSlotsPraos => Set SlotNo -> PoolId -> Map - (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) - (SL.IndividualPoolStake Consensus.StandardCrypto) + (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) + (SL.IndividualPoolStake Consensus.StandardCrypto) -> Consensus.Nonce -> SL.SignKeyVRF Consensus.StandardCrypto -> Ledger.ActiveSlotCoeff @@ -2149,11 +2149,11 @@ foldEpochState nodeConfigFilePath socketPath validationMode terminationEpoch ini -> Env -> LedgerState -> CSP.ChainSyncClientPipelined - BlockInMode - ChainPoint - ChainTip - IO - () + BlockInMode + ChainPoint + ChainTip + IO + () -- \^ Client returns maybe an error. chainSyncClient pipelineSize stateMv errorIORef' env ledgerState0 = CSP.ChainSyncClientPipelined $ diff --git a/cardano-api/internal/Cardano/Api/OperationalCertificate.hs b/cardano-api/internal/Cardano/Api/OperationalCertificate.hs index b5fe0fc15e..202614d04c 100644 --- a/cardano-api/internal/Cardano/Api/OperationalCertificate.hs +++ b/cardano-api/internal/Cardano/Api/OperationalCertificate.hs @@ -108,18 +108,18 @@ instance Error OperationalCertIssueError where issueOperationalCertificate :: VerificationKey KesKey -> Either - (SigningKey StakePoolKey) - (SigningKey GenesisDelegateExtendedKey) + (SigningKey StakePoolKey) + (SigningKey GenesisDelegateExtendedKey) -- TODO: this may be better with a type that -- captured the three (four?) choices, stake pool -- or genesis delegate, extended or normal. -> Shelley.KESPeriod -> OperationalCertificateIssueCounter -> Either - OperationalCertIssueError - ( OperationalCertificate - , OperationalCertificateIssueCounter - ) + OperationalCertIssueError + ( OperationalCertificate + , OperationalCertificateIssueCounter + ) issueOperationalCertificate (KesVerificationKey kesVKey) skey @@ -154,8 +154,8 @@ issueOperationalCertificate signature :: Shelley.SignedDSIGN - StandardCrypto - (Shelley.OCertSignable StandardCrypto) + StandardCrypto + (Shelley.OCertSignable StandardCrypto) signature = makeShelleySignature (Shelley.OCertSignable kesVKey counter kesPeriod) diff --git a/cardano-api/internal/Cardano/Api/ScriptData.hs b/cardano-api/internal/Cardano/Api/ScriptData.hs index 759f8a743f..082bbeeb58 100644 --- a/cardano-api/internal/Cardano/Api/ScriptData.hs +++ b/cardano-api/internal/Cardano/Api/ScriptData.hs @@ -434,8 +434,8 @@ scriptDataToJsonNoSchema = conv . getScriptData scriptDataFromJsonNoSchema :: Aeson.Value -> Either - ScriptDataJsonSchemaError - HashableScriptData + ScriptDataJsonSchemaError + HashableScriptData scriptDataFromJsonNoSchema = fmap (\sd -> HashableScriptData (serialiseToCBOR sd) sd) . conv where conv @@ -541,8 +541,8 @@ scriptDataToJsonDetailedSchema = conv . getScriptData scriptDataFromJsonDetailedSchema :: Aeson.Value -> Either - ScriptDataJsonSchemaError - HashableScriptData + ScriptDataJsonSchemaError + HashableScriptData scriptDataFromJsonDetailedSchema = fmap (\sd -> HashableScriptData (serialiseToCBOR sd) sd) . conv where conv @@ -583,8 +583,8 @@ scriptDataFromJsonDetailedSchema = fmap (\sd -> HashableScriptData (serialiseToC convKeyValuePair :: Aeson.Value -> Either - ScriptDataJsonSchemaError - (ScriptData, ScriptData) + ScriptDataJsonSchemaError + (ScriptData, ScriptData) convKeyValuePair (Aeson.Object m) | KeyMap.size m == 2 , Just k <- KeyMap.lookup "k" m diff --git a/cardano-api/internal/Cardano/Api/StakePoolMetadata.hs b/cardano-api/internal/Cardano/Api/StakePoolMetadata.hs index 57301b4583..f85670ad3a 100644 --- a/cardano-api/internal/Cardano/Api/StakePoolMetadata.hs +++ b/cardano-api/internal/Cardano/Api/StakePoolMetadata.hs @@ -161,8 +161,8 @@ instance Error StakePoolMetadataValidationError where validateAndHashStakePoolMetadata :: ByteString -> Either - StakePoolMetadataValidationError - (StakePoolMetadata, Hash StakePoolMetadata) + StakePoolMetadataValidationError + (StakePoolMetadata, Hash StakePoolMetadata) validateAndHashStakePoolMetadata bs | BS.length bs <= 512 = do md <- diff --git a/cardano-api/internal/Cardano/Api/Tx/Body.hs b/cardano-api/internal/Cardano/Api/Tx/Body.hs index 15e36019d5..ed05f19315 100644 --- a/cardano-api/internal/Cardano/Api/Tx/Body.hs +++ b/cardano-api/internal/Cardano/Api/Tx/Body.hs @@ -1291,11 +1291,11 @@ data TxCertificates build era where TxCertificates :: ShelleyBasedEra era -> OMap - (Certificate era) - ( BuildTxWith - build - (Maybe (StakeCredential, Witness WitCtxStake era)) - ) + (Certificate era) + ( BuildTxWith + build + (Maybe (StakeCredential, Witness WitCtxStake era)) + ) -> TxCertificates build era deriving instance Eq (TxCertificates build era) @@ -1356,12 +1356,12 @@ data TxMintValue build era where TxMintValue :: MaryEraOnwards era -> Map - PolicyId - [ ( AssetName - , Quantity - , BuildTxWith build (ScriptWitness WitCtxMint era) - ) - ] + PolicyId + [ ( AssetName + , Quantity + , BuildTxWith build (ScriptWitness WitCtxMint era) + ) + ] -> TxMintValue build era deriving instance Eq (TxMintValue build era) @@ -1405,8 +1405,8 @@ data TxVotingProcedures build era where TxVotingProcedures :: L.VotingProcedures (ShelleyLedgerEra era) -> BuildTxWith - build - (Map (Ledger.Voter (Ledger.EraCrypto (ShelleyLedgerEra era))) (ScriptWitness WitCtxStake era)) + build + (Map (Ledger.Voter (Ledger.EraCrypto (ShelleyLedgerEra era))) (ScriptWitness WitCtxStake era)) -> TxVotingProcedures build era deriving instance Eq (TxVotingProcedures build era) @@ -2774,17 +2774,17 @@ convScriptData sbe txOuts scriptWitnesses = [d | TxOut _ _ (TxOutSupplementalDatum _ d) _ <- txOuts] ++ [ d | ( _ - , AnyScriptWitness - ( PlutusScriptWitness - _ - _ - _ - (ScriptDatumForTxIn (Just d)) - _ - _ - ) - ) <- - scriptWitnesses + , AnyScriptWitness + ( PlutusScriptWitness + _ + _ + _ + (ScriptDatumForTxIn (Just d)) + _ + _ + ) + ) <- + scriptWitnesses ] in TxBodyScriptData w datums redeemers ) @@ -3077,17 +3077,17 @@ makeShelleyTransactionBody [d | TxOut _ _ (TxOutSupplementalDatum _ d) _ <- txOuts] ++ [ d | ( _ - , AnyScriptWitness - ( PlutusScriptWitness - _ - _ - _ - (ScriptDatumForTxIn (Just d)) - _ - _ - ) - ) <- - witnesses + , AnyScriptWitness + ( PlutusScriptWitness + _ + _ + _ + (ScriptDatumForTxIn (Just d)) + _ + _ + ) + ) <- + witnesses ] redeemers :: Alonzo.Redeemers StandardAlonzo @@ -3200,17 +3200,17 @@ makeShelleyTransactionBody [d | TxOut _ _ (TxOutSupplementalDatum _ d) _ <- txOuts] ++ [ d | ( _ - , AnyScriptWitness - ( PlutusScriptWitness - _ - _ - _ - (ScriptDatumForTxIn (Just d)) - _ - _ - ) - ) <- - witnesses + , AnyScriptWitness + ( PlutusScriptWitness + _ + _ + _ + (ScriptDatumForTxIn (Just d)) + _ + _ + ) + ) <- + witnesses ] redeemers :: Alonzo.Redeemers StandardBabbage @@ -3338,17 +3338,17 @@ makeShelleyTransactionBody [d | TxOut _ _ (TxOutSupplementalDatum _ d) _ <- txOuts] ++ [ d | ( _ - , AnyScriptWitness - ( PlutusScriptWitness - _ - _ - _ - (ScriptDatumForTxIn (Just d)) - _ - _ - ) - ) <- - witnesses + , AnyScriptWitness + ( PlutusScriptWitness + _ + _ + _ + (ScriptDatumForTxIn (Just d)) + _ + _ + ) + ) <- + witnesses ] redeemers :: Alonzo.Redeemers StandardConway diff --git a/cardano-api/internal/Cardano/Api/Tx/Sign.hs b/cardano-api/internal/Cardano/Api/Tx/Sign.hs index f64639a5c2..bb701cc658 100644 --- a/cardano-api/internal/Cardano/Api/Tx/Sign.hs +++ b/cardano-api/internal/Cardano/Api/Tx/Sign.hs @@ -916,14 +916,14 @@ makeSignedTransaction L.mkBasicTx txbody & L.witsTxL .~ ( L.mkBasicTxWits - & L.addrTxWitsL .~ fromList [w | ShelleyKeyWitness _ w <- witnesses] - & L.scriptTxWitsL - .~ fromList - [ (Ledger.hashScript @ledgerera sw, sw) - | sw <- txscripts - ] - & L.bootAddrTxWitsL - .~ fromList [w | ShelleyBootstrapWitness _ w <- witnesses] + & L.addrTxWitsL .~ fromList [w | ShelleyKeyWitness _ w <- witnesses] + & L.scriptTxWitsL + .~ fromList + [ (Ledger.hashScript @ledgerera sw, sw) + | sw <- txscripts + ] + & L.bootAddrTxWitsL + .~ fromList [w | ShelleyBootstrapWitness _ w <- witnesses] ) & L.auxDataTxL .~ maybeToStrictMaybe txmetadata @@ -1048,8 +1048,8 @@ makeShelleyBasedBootstrapWitness sbe nwOrAddr txbody (ByronSigningKey sk) = -- signature :: Shelley.SignedDSIGN - StandardCrypto - (Shelley.Hash StandardCrypto Ledger.EraIndependentTxBody) + StandardCrypto + (Shelley.Hash StandardCrypto Ledger.EraIndependentTxBody) signature = makeShelleySignature txhash diff --git a/cardano-api/internal/Cardano/Api/TxMetadata.hs b/cardano-api/internal/Cardano/Api/TxMetadata.hs index 9aaaa703b8..155b6b99db 100644 --- a/cardano-api/internal/Cardano/Api/TxMetadata.hs +++ b/cardano-api/internal/Cardano/Api/TxMetadata.hs @@ -446,8 +446,8 @@ metadataFromJson schema = :: Aeson.Key -> Aeson.Value -> Either - TxMetadataJsonError - (Word64, TxMetadataValue) + TxMetadataJsonError + (Word64, TxMetadataValue) metadataKeyPairFromJson k v = do k' <- convTopLevelKey k v' <- @@ -547,8 +547,8 @@ metadataValueToJsonNoSchema = conv metadataValueFromJsonNoSchema :: Aeson.Value -> Either - TxMetadataJsonSchemaError - TxMetadataValue + TxMetadataJsonSchemaError + TxMetadataValue metadataValueFromJsonNoSchema = conv where conv @@ -649,8 +649,8 @@ metadataValueToJsonDetailedSchema = conv metadataValueFromJsonDetailedSchema :: Aeson.Value -> Either - TxMetadataJsonSchemaError - TxMetadataValue + TxMetadataJsonSchemaError + TxMetadataValue metadataValueFromJsonDetailedSchema = conv where conv @@ -683,8 +683,8 @@ metadataValueFromJsonDetailedSchema = conv convKeyValuePair :: Aeson.Value -> Either - TxMetadataJsonSchemaError - (TxMetadataValue, TxMetadataValue) + TxMetadataJsonSchemaError + (TxMetadataValue, TxMetadataValue) convKeyValuePair (Aeson.Object m) | KeyMap.size m == 2 , Just k <- KeyMap.lookup "k" m diff --git a/flake.lock b/flake.lock index 8bd2615d3d..372376d5d1 100644 --- a/flake.lock +++ b/flake.lock @@ -205,11 +205,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1738110484, - "narHash": "sha256-Cxn2nFTYSgdAsg51iQ/aWfa0sEwUT1LqlfNCOVbfNNU=", + "lastModified": 1738283290, + "narHash": "sha256-FmEgw4siadNN9E98iGEPKjTykFXMEY9dZq58tfY9PiE=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "2688306d0e2b6d721040d4e0e7405553cf64cb7e", + "rev": "5adaa9f1550f8cf5b6ae2c9183dd5ac197f5620c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index cfcf10755a..baaa1addb5 100644 --- a/flake.nix +++ b/flake.nix @@ -98,7 +98,7 @@ # tools that work only with default compiler ghcid = "0.8.9"; cabal-gild = "1.3.1.2"; - fourmolu = "0.17.0.0"; + fourmolu = "0.18.0.0"; haskell-language-server.src = nixpkgs.haskell-nix.sources."hls-2.9"; hlint = "3.8"; stylish-haskell = "0.14.6.0"; diff --git a/fourmolu.yaml b/fourmolu.yaml index 9eb66064d3..8fb937cd1d 100644 --- a/fourmolu.yaml +++ b/fourmolu.yaml @@ -3,6 +3,8 @@ column-limit: 100 function-arrows: leading comma-style: leading import-export-style: leading +# we need https://github.com/IntersectMBO/cardano-api/pull/744/ to ditch stylish +import-grouping: legacy indent-wheres: false record-brace-space: false newlines-between-decls: 1 @@ -10,8 +12,14 @@ haddock-style: single-line haddock-style-module: let-style: auto in-style: right-align +single-constraint-parens: never +single-deriving-parens: never +sort-constraints: false +sort-derived-classes: false +sort-deriving-clauses: false +trailing-section-operators: true unicode: never respectful: false fixities: [] -single-constraint-parens: never -single-deriving-parens: never +reexports: [] +local-modules: [] diff --git a/scripts/devshell/prettify b/scripts/devshell/prettify index 6fc16d0bf4..873de484d6 100755 --- a/scripts/devshell/prettify +++ b/scripts/devshell/prettify @@ -2,7 +2,7 @@ # Function to display help message show_help() { - echo "Usage: format " + echo "Usage: $(basename $0) " echo "Format Haskell source files using fourmolu and stylish-haskell." echo "" echo "Options:"