Skip to content

Commit

Permalink
Add TokenBundle type and related types.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Nov 23, 2020
1 parent 99db929 commit 2c1e771
Show file tree
Hide file tree
Showing 11 changed files with 2,501 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/core/cardano-wallet-core.cabal
Expand Up @@ -165,6 +165,9 @@ library
Cardano.Wallet.Primitive.Types.Coin
Cardano.Wallet.Primitive.Types.Hash
Cardano.Wallet.Primitive.Types.RewardAccount
Cardano.Wallet.Primitive.Types.TokenBundle
Cardano.Wallet.Primitive.Types.TokenPolicy
Cardano.Wallet.Primitive.Types.TokenQuantity
Cardano.Wallet.Primitive.Types.Tx
Cardano.Wallet.Primitive.Types.UTxO
Cardano.Wallet.Registry
Expand Down Expand Up @@ -245,6 +248,7 @@ test-suite unit
, OddWord
, ouroboros-consensus
, QuickCheck
, quickcheck-classes
, quickcheck-state-machine >= 0.6.0
, random
, retry
Expand All @@ -255,6 +259,7 @@ test-suite unit
, stm
, openapi3 >= 3.0.0.1
, servant-openapi3
, string-qq
, temporary
, text
, text-class
Expand Down Expand Up @@ -318,6 +323,8 @@ test-suite unit
Cardano.Wallet.Primitive.SyncProgressSpec
Cardano.Wallet.Primitive.TypesSpec
Cardano.Wallet.Primitive.Types.HashSpec
Cardano.Wallet.Primitive.Types.TokenBundleSpec
Cardano.Wallet.Primitive.Types.TokenQuantitySpec
Cardano.Wallet.RegistrySpec
Cardano.Wallet.TransactionSpec
Cardano.WalletSpec
Expand Down
3 changes: 2 additions & 1 deletion lib/core/src/Cardano/Wallet/Primitive/Types/Hash.hs
Expand Up @@ -48,7 +48,7 @@ import qualified Data.Text.Encoding as T
newtype Hash (tag :: Symbol) = Hash { getHash :: ByteString }
deriving stock (Generic, Eq, Ord)
deriving newtype (ByteArrayAccess)
deriving Show via (Quiet (Hash tag))
deriving (Read, Show) via (Quiet (Hash tag))

instance NFData (Hash tag)

Expand All @@ -67,6 +67,7 @@ instance FromText (Hash "Genesis") where fromText = hashFromText 32
instance FromText (Hash "Block") where fromText = hashFromText 32
instance FromText (Hash "BlockHeader") where fromText = hashFromText 32
instance FromText (Hash "RewardAccount") where fromText = hashFromText 28
instance FromText (Hash "TokenPolicy") where fromText = hashFromText 28

hashFromText
:: forall t. (KnownSymbol t)
Expand Down

0 comments on commit 2c1e771

Please sign in to comment.