Skip to content

Commit 941e87b

Browse files
authored
Merge pull request #1252 from IntersectMBO/mgalazyn/remove-deprecated-pattern-block
Remove deprecated `pattern Block` synonym from `Cardano.Api.Block`
2 parents c1e087e + ad33978 commit 941e87b

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
project: cardano-api
2+
pr: 1252
3+
kind:
4+
- breaking
5+
description: |
6+
Remove the deprecated 'pattern Block :: BlockHeader -> [Tx era] -> Block era' pattern synonym from 'Cardano.Api.Block'. Use 'getBlockHeader' and 'getBlockTxs' instead. The 'Block' data type and its constructors ('ByronBlock', 'ShelleyBlock') are unchanged.

cardano-api/src/Cardano/Api/Block.hs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,16 @@
44
{-# LANGUAGE GADTs #-}
55
{-# LANGUAGE LambdaCase #-}
66
{-# LANGUAGE NamedFieldPuns #-}
7-
{-# LANGUAGE PatternSynonyms #-}
87
{-# LANGUAGE RankNTypes #-}
98
{-# LANGUAGE ScopedTypeVariables #-}
109
{-# LANGUAGE StandaloneDeriving #-}
1110
{-# LANGUAGE TypeFamilies #-}
1211
{-# LANGUAGE TypeOperators #-}
13-
{-# LANGUAGE ViewPatterns #-}
14-
-- TODO Delete me when the patterns of this file are removed (they are the ones using deprecated - other - patterns)
15-
{-# OPTIONS_GHC -Wno-deprecations #-}
1612

1713
-- | Blocks in the blockchain
1814
module Cardano.Api.Block
1915
( -- * Blocks in the context of an era
2016
Block (..)
21-
, pattern Block
2217
, BlockHeader (..)
2318
, getBlockHeader
2419
, getBlockTxs
@@ -96,16 +91,6 @@ data Block era where
9691
-> Consensus.ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era)
9792
-> Block era
9893

99-
-- | A block consists of a header and a body containing transactions.
100-
{-# DEPRECATED Block "Use getBlockHeader instead " #-}
101-
pattern Block :: BlockHeader -> [Tx era] -> Block era
102-
pattern Block header txs <- (getBlockHeaderAndTxs -> (header, txs))
103-
104-
{-# COMPLETE Block #-}
105-
106-
getBlockHeaderAndTxs :: Block era -> (BlockHeader, [Tx era])
107-
getBlockHeaderAndTxs block = (getBlockHeader block, getBlockTxs block)
108-
10994
-- The GADT in the ShelleyBlock case requires a custom instance
11095
instance Show (Block era) where
11196
showsPrec p (ByronBlock block) =

0 commit comments

Comments
 (0)