Skip to content

Commit 921420b

Browse files
authored
Fix instance FromData PlutusTx.Data.List (#7492)
Co-authored-by: Nikolaos Bezirgiannis <[email protected]>
1 parent 2aaccb0 commit 921420b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Fixed
2+
3+
- The FromData instance of PlutusTx.Data.List

plutus-tx/src/PlutusTx/Data/List.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,14 @@ instance ToData (List a) where
106106

107107
instance FromData (List a) where
108108
{-# INLINEABLE fromBuiltinData #-}
109-
fromBuiltinData = Just . List . BI.unsafeDataAsList
109+
fromBuiltinData d =
110+
B.matchData'
111+
d
112+
(\_ _ -> Nothing)
113+
(\_ -> Nothing)
114+
(Just . List)
115+
(\_ -> Nothing)
116+
(\_ -> Nothing)
110117

111118
instance UnsafeFromData (List a) where
112119
{-# INLINEABLE unsafeFromBuiltinData #-}

0 commit comments

Comments
 (0)