@@ -708,7 +708,7 @@ pub struct Block<'b> {
708708#[ deprecated( since = "1.0.0-alpha" , note = "use `Block` instead" ) ]
709709pub type MintedBlock < ' b > = Block < ' b > ;
710710
711- #[ derive( Clone , Serialize , Deserialize , Encode , Decode , Debug ) ]
711+ #[ derive( Clone , Serialize , Deserialize , Encode , Debug ) ]
712712pub struct Tx < ' b > {
713713 #[ b( 0 ) ]
714714 pub transaction_body : KeepRaw < ' b , TransactionBody < ' b > > ,
@@ -723,6 +723,29 @@ pub struct Tx<'b> {
723723 pub auxiliary_data : Nullable < KeepRaw < ' b , AuxiliaryData > > ,
724724}
725725
726+ impl < ' b , C > minicbor:: Decode < ' b , C > for Tx < ' b >
727+ where
728+ KeepRaw < ' b , TransactionBody < ' b > > : minicbor:: Decode < ' b , C > ,
729+ KeepRaw < ' b , WitnessSet < ' b > > : minicbor:: Decode < ' b , C > ,
730+ Nullable < KeepRaw < ' b , AuxiliaryData > > : minicbor:: Decode < ' b , C > ,
731+ {
732+ fn decode ( d : & mut minicbor:: Decoder < ' b > , ctx : & mut C ) -> Result < Self , minicbor:: decode:: Error > {
733+ d. array ( ) ?;
734+
735+ let transaction_body = d. decode_with ( ctx) ?;
736+ let transaction_witness_set = d. decode_with ( ctx) ?;
737+ let success = d. decode_with ( ctx) . unwrap_or ( true ) ;
738+ let auxiliary_data = d. decode_with ( ctx) . unwrap_or ( Nullable :: Null ) ;
739+
740+ Ok ( Self {
741+ transaction_body,
742+ transaction_witness_set,
743+ success,
744+ auxiliary_data,
745+ } )
746+ }
747+ }
748+
726749#[ deprecated( since = "1.0.0-alpha" , note = "use `Tx` instead" ) ]
727750pub type MintedTx < ' b > = Tx < ' b > ;
728751
0 commit comments