Skip to content

Commit

Permalink
Add tests for TxOut serialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Mar 16, 2023
1 parent 603c3dc commit fc8bd26
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/wallet/cardano-wallet.cabal
Expand Up @@ -857,6 +857,7 @@ test-suite unit
Cardano.Wallet.DB.Sqlite.TypesSpec
Cardano.Wallet.DB.StateMachine
Cardano.Wallet.DB.Store.DeltaUTxO.ModelSpec
Cardano.Wallet.DB.Store.DeltaUTxO.TxOutBinarySpec
Cardano.Wallet.DB.Store.Meta.ModelSpec
Cardano.Wallet.DB.Store.Meta.StoreSpec
Cardano.Wallet.DB.Store.Submissions.StoreSpec
Expand Down
@@ -0,0 +1,23 @@
{-# LANGUAGE ScopedTypeVariables #-}
module Cardano.Wallet.DB.Store.DeltaUTxO.TxOutBinarySpec
( spec
)
where

import Prelude

import Cardano.Wallet.DB.Arbitrary
()
import Cardano.Wallet.DB.Store.DeltaUTxO.TxOutBinary
( deserializeTxOut, serializeTxOut )
import Test.Hspec
( Spec, describe, it )
import Test.QuickCheck
( Testable (property), (===) )

spec :: Spec
spec = do
describe "TxOutBinary" $ do
it "can serialize and deserialize TxOut" $
property $ \txOut ->
deserializeTxOut (serializeTxOut txOut) === Right txOut

0 comments on commit fc8bd26

Please sign in to comment.