File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -582,6 +582,17 @@ impl encoding::Encodable for Amount {
582582#[ cfg( feature = "encoding" ) ]
583583pub struct AmountDecoder ( encoding:: ArrayDecoder < 8 > ) ;
584584
585+ #[ cfg( feature = "encoding" ) ]
586+ impl AmountDecoder {
587+ /// Constructs a new [`Amount`] decoder.
588+ pub fn new ( ) -> Self { Self ( encoding:: ArrayDecoder :: new ( ) ) }
589+ }
590+
591+ #[ cfg( feature = "encoding" ) ]
592+ impl Default for AmountDecoder {
593+ fn default ( ) -> Self { Self :: new ( ) }
594+ }
595+
585596#[ cfg( feature = "encoding" ) ]
586597impl encoding:: Decoder for AmountDecoder {
587598 type Output = Amount ;
Original file line number Diff line number Diff line change @@ -165,6 +165,17 @@ impl encoding::Encodable for BlockHeight {
165165#[ cfg( feature = "encoding" ) ]
166166pub struct BlockHeightDecoder ( encoding:: ArrayDecoder < 4 > ) ;
167167
168+ #[ cfg( feature = "encoding" ) ]
169+ impl Default for BlockHeightDecoder {
170+ fn default ( ) -> Self { Self :: new ( ) }
171+ }
172+
173+ #[ cfg( feature = "encoding" ) ]
174+ impl BlockHeightDecoder {
175+ /// Constructs a new [`BlockHeight`] decoder.
176+ pub fn new ( ) -> Self { Self ( encoding:: ArrayDecoder :: new ( ) ) }
177+ }
178+
168179#[ cfg( feature = "encoding" ) ]
169180impl encoding:: Decoder for BlockHeightDecoder {
170181 type Output = BlockHeight ;
Original file line number Diff line number Diff line change @@ -423,6 +423,17 @@ impl encoding::Encodable for LockTime {
423423#[ cfg( feature = "encoding" ) ]
424424pub struct LockTimeDecoder ( encoding:: ArrayDecoder < 4 > ) ;
425425
426+ #[ cfg( feature = "encoding" ) ]
427+ impl LockTimeDecoder {
428+ /// Constructs a new [`LockTime`] decoder.
429+ pub fn new ( ) -> Self { Self ( encoding:: ArrayDecoder :: new ( ) ) }
430+ }
431+
432+ #[ cfg( feature = "encoding" ) ]
433+ impl Default for LockTimeDecoder {
434+ fn default ( ) -> Self { Self :: new ( ) }
435+ }
436+
426437#[ cfg( feature = "encoding" ) ]
427438impl encoding:: Decoder for LockTimeDecoder {
428439 type Output = LockTime ;
Original file line number Diff line number Diff line change @@ -288,6 +288,17 @@ impl encoding::Encodable for Sequence {
288288#[ cfg( feature = "encoding" ) ]
289289pub struct SequenceDecoder ( encoding:: ArrayDecoder < 4 > ) ;
290290
291+ #[ cfg( feature = "encoding" ) ]
292+ impl Default for SequenceDecoder {
293+ fn default ( ) -> Self { Self :: new ( ) }
294+ }
295+
296+ #[ cfg( feature = "encoding" ) ]
297+ impl SequenceDecoder {
298+ /// Constructs a new [`Sequence`] decoder.
299+ pub fn new ( ) -> Self { Self ( encoding:: ArrayDecoder :: new ( ) ) }
300+ }
301+
291302#[ cfg( feature = "encoding" ) ]
292303impl encoding:: Decoder for SequenceDecoder {
293304 type Output = Sequence ;
Original file line number Diff line number Diff line change @@ -98,6 +98,17 @@ impl encoding::Encodable for BlockTime {
9898#[ cfg( feature = "encoding" ) ]
9999pub struct BlockTimeDecoder ( encoding:: ArrayDecoder < 4 > ) ;
100100
101+ #[ cfg( feature = "encoding" ) ]
102+ impl Default for BlockTimeDecoder {
103+ fn default ( ) -> Self { Self :: new ( ) }
104+ }
105+
106+ #[ cfg( feature = "encoding" ) ]
107+ impl BlockTimeDecoder {
108+ /// Constructs a new [`BlockTime`] decoder.
109+ pub fn new ( ) -> Self { Self ( encoding:: ArrayDecoder :: new ( ) ) }
110+ }
111+
101112#[ cfg( feature = "encoding" ) ]
102113impl encoding:: Decoder for BlockTimeDecoder {
103114 type Output = BlockTime ;
You can’t perform that action at this time.
0 commit comments