Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed cbor/conformance_dump_ctx.cbor
Binary file not shown.
Binary file removed cbor/conformance_dump_env.cbor
Binary file not shown.
Binary file removed cbor/conformance_dump_sig.cbor
Binary file not shown.
Binary file removed cbor/conformance_dump_st.cbor
Binary file not shown.
21 changes: 3 additions & 18 deletions eras/allegra/impl/cddl/data/allegra.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ transaction_id = hash32

transaction_output = [address, amount : coin]

; address = bytes
;
; address format:
; [ 8 bit header | payload ];
;
Expand Down Expand Up @@ -112,15 +110,7 @@ transaction_output = [address, amount : coin]
; 1110: account address: keyhash28
; 1111: account address: scripthash28
; 1001-1101: future formats
address =
h'001000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000'
/ h'102000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000'
/ h'203000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000'
/ h'304000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000'
/ h'405000000000000000000000000000000000000000000000000000000087680203'
/ h'506000000000000000000000000000000000000000000000000000000087680203'
/ h'6070000000000000000000000000000000000000000000000000000000'
/ h'7080000000000000000000000000000000000000000000000000000000'
address = bytes

coin = uint

Expand Down Expand Up @@ -181,8 +171,6 @@ pool_params =

vrf_keyhash = hash32

; The real unit_interval is: #6.30([uint, uint])
;
; A unit interval is a number in the range between 0 and 1, which
; means there are two extra constraints:
; 1. numerator <= denominator
Expand All @@ -195,12 +183,9 @@ vrf_keyhash = hash32
; generate random valid data for testing implementation of
; our encoders/decoders. Which means we cannot use the actual
; definition here and we hard code the value to 1/2
unit_interval = #6.30([1, 2])
unit_interval = #6.30([uint, uint])

; reward_account = bytes
reward_account =
h'e090000000000000000000000000000000000000000000000000000000'
/ h'f0a0000000000000000000000000000000000000000000000000000000'
reward_account = bytes

relay = [single_host_addr// single_host_name// multi_host_name]

Expand Down
21 changes: 3 additions & 18 deletions eras/alonzo/impl/cddl/data/alonzo.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ transaction_id = hash32

transaction_output = [address, amount : value, ? datum_hash : hash32]

; address = bytes
;
; address format:
; [ 8 bit header | payload ];
;
Expand Down Expand Up @@ -122,15 +120,7 @@ transaction_output = [address, amount : value, ? datum_hash : hash32]
; 1110: account address: keyhash28
; 1111: account address: scripthash28
; 1001-1101: future formats
address =
h'001000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000'
/ h'102000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000'
/ h'203000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000'
/ h'304000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000'
/ h'405000000000000000000000000000000000000000000000000000000087680203'
/ h'506000000000000000000000000000000000000000000000000000000087680203'
/ h'6070000000000000000000000000000000000000000000000000000000'
/ h'7080000000000000000000000000000000000000000000000000000000'
address = bytes

value = coin/ [coin, multiasset<uint>]

Expand Down Expand Up @@ -199,8 +189,6 @@ pool_params =

vrf_keyhash = hash32

; The real unit_interval is: #6.30([uint, uint])
;
; A unit interval is a number in the range between 0 and 1, which
; means there are two extra constraints:
; 1. numerator <= denominator
Expand All @@ -213,12 +201,9 @@ vrf_keyhash = hash32
; generate random valid data for testing implementation of
; our encoders/decoders. Which means we cannot use the actual
; definition here and we hard code the value to 1/2
unit_interval = #6.30([1, 2])
unit_interval = #6.30([uint, uint])

; reward_account = bytes
reward_account =
h'e090000000000000000000000000000000000000000000000000000000'
/ h'f0a0000000000000000000000000000000000000000000000000000000'
reward_account = bytes

relay = [single_host_addr// single_host_name// multi_host_name]

Expand Down
21 changes: 3 additions & 18 deletions eras/babbage/impl/cddl/data/babbage.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ transaction_output = alonzo_transaction_output/ babbage_transaction_output

alonzo_transaction_output = [address, amount : value, ? datum_hash : hash32]

; address = bytes
;
; address format:
; [ 8 bit header | payload ];
;
Expand Down Expand Up @@ -130,15 +128,7 @@ alonzo_transaction_output = [address, amount : value, ? datum_hash : hash32]
; 1110: account address: keyhash28
; 1111: account address: scripthash28
; 1001-1101: future formats
address =
h'001000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000'
/ h'102000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000'
/ h'203000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000'
/ h'304000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000'
/ h'405000000000000000000000000000000000000000000000000000000087680203'
/ h'506000000000000000000000000000000000000000000000000000000087680203'
/ h'6070000000000000000000000000000000000000000000000000000000'
/ h'7080000000000000000000000000000000000000000000000000000000'
address = bytes

value = coin/ [coin, multiasset<uint>]

Expand Down Expand Up @@ -321,8 +311,6 @@ pool_params =

vrf_keyhash = hash32

; The real unit_interval is: #6.30([uint, uint])
;
; A unit interval is a number in the range between 0 and 1, which
; means there are two extra constraints:
; 1. numerator <= denominator
Expand All @@ -335,12 +323,9 @@ vrf_keyhash = hash32
; generate random valid data for testing implementation of
; our encoders/decoders. Which means we cannot use the actual
; definition here and we hard code the value to 1/2
unit_interval = #6.30([1, 2])
unit_interval = #6.30([uint, uint])

; reward_account = bytes
reward_account =
h'e090000000000000000000000000000000000000000000000000000000'
/ h'f0a0000000000000000000000000000000000000000000000000000000'
reward_account = bytes

relay = [single_host_addr// single_host_name// multi_host_name]

Expand Down
21 changes: 3 additions & 18 deletions eras/conway/impl/cddl/data/conway.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ transaction_output = alonzo_transaction_output/ babbage_transaction_output

alonzo_transaction_output = [address, amount : value, ? datum_hash : hash32]

; address = bytes
;
; address format:
; [ 8 bit header | payload ];
;
Expand Down Expand Up @@ -177,15 +175,7 @@ alonzo_transaction_output = [address, amount : value, ? datum_hash : hash32]
; 1110: account address: keyhash28
; 1111: account address: scripthash28
; 1001-1101: future formats
address =
h'001000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000'
/ h'102000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000'
/ h'203000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000'
/ h'304000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000'
/ h'405000000000000000000000000000000000000000000000000000000087680203'
/ h'506000000000000000000000000000000000000000000000000000000087680203'
/ h'6070000000000000000000000000000000000000000000000000000000'
/ h'7080000000000000000000000000000000000000000000000000000000'
address = bytes

value = coin/ [coin, multiasset<positive_coin>]

Expand Down Expand Up @@ -375,8 +365,6 @@ pool_params =

vrf_keyhash = hash32

; The real unit_interval is: #6.30([uint, uint])
;
; A unit interval is a number in the range between 0 and 1, which
; means there are two extra constraints:
; 1. numerator <= denominator
Expand All @@ -389,12 +377,9 @@ vrf_keyhash = hash32
; generate random valid data for testing implementation of
; our encoders/decoders. Which means we cannot use the actual
; definition here and we hard code the value to 1/2
unit_interval = #6.30([1, 2])
unit_interval = #6.30([uint, uint])

; reward_account = bytes
reward_account =
h'e090000000000000000000000000000000000000000000000000000000'
/ h'f0a0000000000000000000000000000000000000000000000000000000'
reward_account = bytes

relay = [single_host_addr// single_host_name// multi_host_name]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ import Cardano.Ledger.Conway.Governance (GovAction, ProposalProcedure, VotingPro
import Cardano.Ledger.Conway.HuddleSpec (conwayCDDL)
import Cardano.Ledger.Core
import Cardano.Ledger.Plutus.Data (Data, Datum)
import Test.Cardano.Ledger.Alonzo.Arbitrary (genNonEmptyRedeemers)
import Test.Cardano.Ledger.Binary.Cuddle (
huddleDecoderEquivalenceSpec,
huddleRoundTripAnnCborSpec,
huddleRoundTripArbitraryValidate,
huddleRoundTripCborSpec,
huddleRoundTripGenValidate,
specWithHuddle,
)
import Test.Cardano.Ledger.Common
Expand All @@ -38,7 +40,8 @@ spec = do
-- TxBody
huddleRoundTripAnnCborSpec @(TxBody TopTx ConwayEra) v "transaction_body"
-- TODO enable this once map/list expansion has been optimized in cuddle
xdescribe "hangs" $ huddleRoundTripArbitraryValidate @(TxBody TopTx ConwayEra) v "transaction_body"
xdescribe "fix scripts" $
huddleRoundTripArbitraryValidate @(TxBody TopTx ConwayEra) v "transaction_body"
huddleRoundTripCborSpec @(TxBody TopTx ConwayEra) v "transaction_body"
-- AuxData
huddleRoundTripAnnCborSpec @(TxAuxData ConwayEra) v "auxiliary_data"
Expand All @@ -57,7 +60,7 @@ spec = do
-- TxOut
huddleRoundTripCborSpec @(TxOut ConwayEra) v "transaction_output"
-- TODO fails because of `address`
xdescribe "fix address" $ huddleRoundTripArbitraryValidate @(TxOut ConwayEra) v "transaction_output"
xdescribe "fix scripts" $ huddleRoundTripArbitraryValidate @(TxOut ConwayEra) v "transaction_output"
-- Script
huddleRoundTripAnnCborSpec @(Script ConwayEra) v "script"
-- TODO fails because of `plutus_v1_script`
Expand All @@ -75,16 +78,13 @@ spec = do
huddleRoundTripCborSpec @(TxWits ConwayEra) v "transaction_witness_set"
-- PParamsUpdate
huddleRoundTripCborSpec @(PParamsUpdate ConwayEra) v "protocol_param_update"
-- TODO enable this once map/list expansion has been optimized in cuddle
xdescribe "hangs" $
huddleRoundTripArbitraryValidate @(PParamsUpdate ConwayEra) v "protocol_param_update"
huddleRoundTripArbitraryValidate @(PParamsUpdate ConwayEra) v "protocol_param_update"
-- CostModels
huddleRoundTripCborSpec @CostModels v "cost_models"
huddleRoundTripArbitraryValidate @CostModels v "cost_models"
-- Redeemers
huddleRoundTripAnnCborSpec @(Redeemers ConwayEra) v "redeemers"
-- TODO arbitrary can generate empty redeemers, which is not allowed in the CDDL
xdescribe "fix redeemers" $ huddleRoundTripArbitraryValidate @(Redeemers ConwayEra) v "redeemers"
huddleRoundTripGenValidate @(Redeemers ConwayEra) genNonEmptyRedeemers v "redeemers"
huddleRoundTripCborSpec @(Redeemers ConwayEra) v "redeemers"
-- Tx
huddleRoundTripAnnCborSpec @(Tx TopTx ConwayEra) v "transaction"
Expand All @@ -96,17 +96,13 @@ spec = do
huddleRoundTripArbitraryValidate @(VotingProcedure ConwayEra) v "voting_procedure"
-- ProposalProcedure
huddleRoundTripCborSpec @(ProposalProcedure ConwayEra) v "proposal_procedure"
-- TODO This fails because of the hard-coded `reward_account` in the CDDL
xdescribe "fix reward_account" $
huddleRoundTripArbitraryValidate @(ProposalProcedure ConwayEra) v "proposal_procedure"
huddleRoundTripArbitraryValidate @(ProposalProcedure ConwayEra) v "proposal_procedure"
-- GovAction
huddleRoundTripCborSpec @(GovAction ConwayEra) v "gov_action"
-- TODO enable this once map/list expansion has been optimized in cuddle
xdescribe "hangs" $ huddleRoundTripArbitraryValidate @(GovAction ConwayEra) v "gov_action"
huddleRoundTripArbitraryValidate @(GovAction ConwayEra) v "gov_action"
-- TxCert
huddleRoundTripCborSpec @(TxCert ConwayEra) v "certificate"
-- TODO this fails because of the hard-coded `unit_interval` in the CDDL
xdescribe "fix unit_interval" $ huddleRoundTripArbitraryValidate @(TxCert ConwayEra) v "certificate"
huddleRoundTripArbitraryValidate @(TxCert ConwayEra) v "certificate"
describe "DecCBOR instances equivalence via CDDL" $ do
huddleDecoderEquivalenceSpec @(TxBody TopTx ConwayEra) v "transaction_body"
huddleDecoderEquivalenceSpec @(TxAuxData ConwayEra) v "auxiliary_data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Test.Cardano.Ledger.Conway.Arbitrary (
) where

import Cardano.Ledger.Alonzo.Plutus.Evaluate (CollectError)
import Cardano.Ledger.BaseTypes (StrictMaybe (..))
import Cardano.Ledger.BaseTypes (ProtVer (..), StrictMaybe (..))
import Cardano.Ledger.Conway (ApplyTxError (ConwayApplyTxError), ConwayEra, Tx (..))
import Cardano.Ledger.Conway.Core
import Cardano.Ledger.Conway.Genesis (ConwayGenesis (..))
Expand Down Expand Up @@ -505,8 +505,11 @@ instance
genParameterChange :: Arbitrary (PParamsUpdate era) => Gen (GovAction era)
genParameterChange = ParameterChange <$> arbitrary <*> arbitrary <*> arbitrary

genHardForkInitiation :: Gen (GovAction era)
genHardForkInitiation = HardForkInitiation <$> arbitrary <*> arbitrary
genHardForkInitiation :: forall era. Era era => Gen (GovAction era)
genHardForkInitiation =
HardForkInitiation
<$> arbitrary
<*> (ProtVer <$> elements [eraProtVerLow @era .. succ $ eraProtVerHigh @era] <*> arbitrary)

genTreasuryWithdrawals :: Gen (GovAction era)
genTreasuryWithdrawals = TreasuryWithdrawals <$> arbitrary <*> arbitrary
Expand Down
21 changes: 3 additions & 18 deletions eras/dijkstra/impl/cddl/data/dijkstra.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ transaction_output = alonzo_transaction_output/ babbage_transaction_output

alonzo_transaction_output = [address, amount : value, ? datum_hash : hash32]

; address = bytes
;
; address format:
; [ 8 bit header | payload ];
;
Expand Down Expand Up @@ -170,15 +168,7 @@ alonzo_transaction_output = [address, amount : value, ? datum_hash : hash32]
; 1110: account address: keyhash28
; 1111: account address: scripthash28
; 1001-1101: future formats
address =
h'001000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000'
/ h'102000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000'
/ h'203000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000'
/ h'304000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000'
/ h'405000000000000000000000000000000000000000000000000000000087680203'
/ h'506000000000000000000000000000000000000000000000000000000087680203'
/ h'6070000000000000000000000000000000000000000000000000000000'
/ h'7080000000000000000000000000000000000000000000000000000000'
address = bytes

value = coin/ [coin, multiasset<positive_coin>]

Expand Down Expand Up @@ -373,8 +363,6 @@ pool_params =

vrf_keyhash = hash32

; The real unit_interval is: #6.30([uint, uint])
;
; A unit interval is a number in the range between 0 and 1, which
; means there are two extra constraints:
; 1. numerator <= denominator
Expand All @@ -387,12 +375,9 @@ vrf_keyhash = hash32
; generate random valid data for testing implementation of
; our encoders/decoders. Which means we cannot use the actual
; definition here and we hard code the value to 1/2
unit_interval = #6.30([1, 2])
unit_interval = #6.30([uint, uint])

; reward_account = bytes
reward_account =
h'e090000000000000000000000000000000000000000000000000000000'
/ h'f0a0000000000000000000000000000000000000000000000000000000'
reward_account = bytes

relay = [single_host_addr// single_host_name// multi_host_name]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ spec = do
huddleRoundTripAnnCborSpec @(Data DijkstraEra) v "plutus_data"
huddleRoundTripArbitraryValidate @(Data DijkstraEra) v "plutus_data"
huddleRoundTripCborSpec @(Data DijkstraEra) v "plutus_data"
xdescribe "fix TxOut" $ do
xdescribe "fix Script" $ do
huddleRoundTripCborSpec @(TxOut DijkstraEra) v "transaction_output"
-- TODO fails because of `address`
xdescribe "fix address" $
huddleRoundTripArbitraryValidate @(TxOut DijkstraEra) v "transaction_output"
xdescribe "fix Script" $ do
huddleRoundTripAnnCborSpec @(Script DijkstraEra) v "script"
Expand Down Expand Up @@ -97,16 +95,13 @@ spec = do
huddleRoundTripArbitraryValidate @(VotingProcedure DijkstraEra) v "voting_procedure"
huddleRoundTripCborSpec @(ProposalProcedure DijkstraEra) v "proposal_procedure"
-- TODO This fails because of the hard-coded `reward_account` in the CDDL
xdescribe "fix reward_account" $
huddleRoundTripArbitraryValidate @(ProposalProcedure DijkstraEra) v "proposal_procedure"
huddleRoundTripArbitraryValidate @(ProposalProcedure DijkstraEra) v "proposal_procedure"
huddleRoundTripCborSpec @(GovAction DijkstraEra) v "gov_action"
-- TODO enable this once map/list expansion has been optimized in cuddle
xdescribe "hangs" $ huddleRoundTripArbitraryValidate @(GovAction DijkstraEra) v "gov_action"
describe "TxCert" $ do
huddleRoundTripArbitraryValidate @(GovAction DijkstraEra) v "gov_action"
describe "fix TxCert" $ do
huddleRoundTripCborSpec @(TxCert DijkstraEra) v "certificate"
-- TODO this fails because of the hard-coded `unit_interval` in the CDDL
xdescribe "fix unit_interval" $
huddleRoundTripArbitraryValidate @(TxCert DijkstraEra) v "certificate"
huddleRoundTripArbitraryValidate @(TxCert DijkstraEra) v "certificate"
describe "DecCBOR instances equivalence via CDDL" $ do
huddleDecoderEquivalenceSpec @(TxBody TopTx DijkstraEra) v "transaction_body"
huddleDecoderEquivalenceSpec @(TxBody SubTx DijkstraEra) v "sub_transaction_body"
Expand Down
Loading
Loading