@@ -54,6 +54,7 @@ dijkstraCDDL =
5454 collectFromInit
5555 [ HIRule $ huddleRule @ " block" (Proxy @ DijkstraEra )
5656 , HIRule $ huddleRule @ " transaction" (Proxy @ DijkstraEra )
57+ , HIRule $ huddleRule @ " transaction_mempool" (Proxy @ DijkstraEra )
5758 , HIRule $ huddleRule @ " kes_signature" (Proxy @ DijkstraEra )
5859 , HIRule $ huddleRule @ " language" (Proxy @ DijkstraEra )
5960 , HIRule $ huddleRule @ " potential_languages" (Proxy @ DijkstraEra )
@@ -780,16 +781,32 @@ instance HuddleRule "script_data_hash" DijkstraEra where
780781 |]
781782 $ scriptDataHashRule pname p
782783
784+ instance HuddleRule " transaction_mempool" DijkstraEra where
785+ huddleRuleNamed pname p =
786+ comment
787+ [str | In Dijkstra we're deprecating the `is_valid` flag, but for backwards
788+ | compatibility we still allow this flag to be present in incoming
789+ | transactions. Once the transaction is added to a block, the flag will
790+ | be stripped, so the `is_valid` flag cannot appear in transactions that
791+ | are in a block.
792+ |
793+ | In the next era `is_valid` flags will not be allowed even in mempool
794+ | transactions, so it's strongly recommended to encode transactions
795+ | according to the `transaction` rule.
796+ |]
797+ $ pname
798+ =.= huddleRule @ " transaction" p
799+ / sarr
800+ [ a $ huddleRule @ " transaction_body" p
801+ , a $ huddleRule @ " transaction_witness_set" p
802+ , a $ bool True
803+ , a (huddleRule @ " auxiliary_data" p / VNil )
804+ ]
805+
783806instance HuddleRule " transaction" DijkstraEra where
784807 huddleRuleNamed pname p =
785808 pname
786809 =.= arr
787- [ a $ huddleRule @ " transaction_body" p
788- , a $ huddleRule @ " transaction_witness_set" p
789- , a $ (bool True )
790- , a (huddleRule @ " auxiliary_data" p / VNil )
791- ]
792- / arr
793810 [ a $ huddleRule @ " transaction_body" p
794811 , a $ huddleRule @ " transaction_witness_set" p
795812 , a (huddleRule @ " auxiliary_data" p / VNil )
0 commit comments