Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add encodeUtf8/decodeUtf8 for bytestrings and strings. #3288

Merged
merged 3 commits into from
Jun 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add haddock for encodeUtf8/decodeUtf8
  • Loading branch information
Evgenii Akentev committed Jun 3, 2021
commit f88a107416aeeda28af5209a558b4251b69329b5
2 changes: 2 additions & 0 deletions plutus-tx/src/PlutusTx/Builtins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ greaterThanByteString :: ByteString -> ByteString -> Bool
greaterThanByteString = (>)

{-# NOINLINE decodeUtf8 #-}
-- | Converts a ByteString to a String.
decodeUtf8 :: ByteString -> String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haddock for these. Yes, it's somewhat obvious, but it never hurts.

decodeUtf8 = mustBeReplaced "decodeUtf8"

Expand Down Expand Up @@ -233,5 +234,6 @@ trace :: String -> ()
trace _ = () --mustBeReplaced "trace"

{-# NOINLINE encodeUtf8 #-}
-- | Convert a String into a ByteString.
encodeUtf8 :: String -> ByteString
encodeUtf8 = mustBeReplaced "encodeUtf8"