Compare commits
No commits in common. "998ff44733654d11d77c3ffa946cfc8a332d45d2" and "a7adee13de4c8f6024ff101b8f1eab30c4dc5e2a" have entirely different histories.
998ff44733
...
a7adee13de
1 changed files with 6 additions and 6 deletions
|
@ -36,12 +36,12 @@ import qualified Generics.SOP as SOP
|
|||
|
||||
-- | Represents a Hex string. Guarantees that all characters it contains
|
||||
-- are valid hex characters.
|
||||
newtype HexString = HexString
|
||||
{ bytes :: BS.ByteString
|
||||
} deriving stock (Eq, Prelude.Show, GHC.Generic)
|
||||
deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo)
|
||||
deriving anyclass (Data.Structured.Show)
|
||||
deriving (BorshSize, ToBorsh, FromBorsh) via AsStruct HexString
|
||||
data HexString =
|
||||
HexString BS.ByteString
|
||||
deriving stock (Eq, Prelude.Show, GHC.Generic)
|
||||
deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo)
|
||||
deriving anyclass (Data.Structured.Show)
|
||||
deriving (BorshSize, ToBorsh, FromBorsh) via AsStruct HexString
|
||||
|
||||
instance FromJSON HexString where
|
||||
parseJSON = withText "HexString" $ pure . hexString . TE.encodeUtf8
|
||||
|
|
Loading…
Reference in a new issue