-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from input-output-hk/jordan/basic-tx
Isolation of Byron era 1/n
- Loading branch information
Showing
10 changed files
with
265 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE RankNTypes #-} | ||
|
||
module Test.Gen.Cardano.Api.Byron | ||
( tests | ||
) where | ||
|
||
import Cardano.Api hiding (txIns) | ||
|
||
import Data.Proxy | ||
|
||
import Test.Gen.Cardano.Api.Typed | ||
|
||
import Hedgehog | ||
import Test.Hedgehog.Roundtrip.CBOR | ||
import Test.Tasty | ||
import Test.Tasty.Hedgehog | ||
|
||
prop_byron_roundtrip_txbody_CBOR :: Property | ||
prop_byron_roundtrip_txbody_CBOR = property $ do | ||
let byron = ByronEra | ||
x <- forAll $ makeSignedTransaction [] <$> genTxBodyByron | ||
tripping x (serialiseTxLedgerCddl byron) (deserialiseTxLedgerCddl byron) | ||
|
||
|
||
prop_byron_roundtrip_tx_CBOR :: Property | ||
prop_byron_roundtrip_tx_CBOR = property $ do | ||
let byron = ByronEra | ||
x <- forAll genTxByron | ||
cardanoEraConstraints byron $ trippingCbor (proxyToAsType Proxy) x | ||
|
||
|
||
prop_byron_roundtrip_witness_CBOR :: Property | ||
prop_byron_roundtrip_witness_CBOR = property $ do | ||
let byron = ByronEra | ||
x <- forAll genByronKeyWitness | ||
cardanoEraConstraints byron $ trippingCbor (AsKeyWitness (proxyToAsType Proxy)) x | ||
|
||
|
||
prop_byron_roundtrip_Tx_Cddl :: Property | ||
prop_byron_roundtrip_Tx_Cddl = property $ do | ||
let byron = ByronEra | ||
x <- forAll genTxByron | ||
tripping x (serialiseTxLedgerCddl byron) (deserialiseTxLedgerCddl byron) | ||
|
||
tests :: TestTree | ||
tests = testGroup "Test.Gen.Cardano.Api.Byron" | ||
[ testProperty "Byron roundtrip txbody CBOR" prop_byron_roundtrip_txbody_CBOR | ||
, testProperty "Byron roundtrip tx certificate CBOR" prop_byron_roundtrip_tx_CBOR | ||
, testProperty "Byron roundtrip witness CBOR" prop_byron_roundtrip_witness_CBOR | ||
, testProperty "Byron roundtrip tx CBOR" prop_byron_roundtrip_Tx_Cddl | ||
] | ||
|
Oops, something went wrong.