Skip to content

Commit

Permalink
Add FromText, ToText instances for ByronWalletStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Feb 24, 2020
1 parent 52281d9 commit 2ef8c65
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/core/src/Cardano/Wallet/Api/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,13 @@ import Data.Quantity
import Data.Text
( Text, split )
import Data.Text.Class
( FromText (..), TextDecodingError (..), ToText (..) )
( CaseStyle (..)
, FromText (..)
, TextDecodingError (..)
, ToText (..)
, fromTextToBoundedEnum
, toTextFromBoundedEnum
)
import Data.Time.Clock
( NominalDiffTime, UTCTime )
import Data.Time.Text
Expand Down Expand Up @@ -230,6 +236,13 @@ data ByronWalletStyle
| Icarus
| Trezor
| Ledger
deriving (Show, Generic, Eq, Bounded, Enum)

instance FromText ByronWalletStyle where
fromText = fromTextToBoundedEnum SnakeLowerCase

instance ToText ByronWalletStyle where
toText = toTextFromBoundedEnum SnakeLowerCase

data SndFactor
= SndFactor
Expand Down

0 comments on commit 2ef8c65

Please sign in to comment.