@@ -230,8 +230,16 @@ mod serialization {
230230 } ;
231231 readable. serialize ( serializer)
232232 } else {
233- let bytes = self . to_bytes ( ) ;
234- serializer. serialize_bytes ( & bytes)
233+ let mut buf = Vec :: new ( ) ;
234+ buf. push ( SignatureScheme :: Multisig as u8 ) ;
235+
236+ let multisig = MultisigRef {
237+ signatures : & self . signatures ,
238+ bitmap : self . bitmap ,
239+ committee : & self . committee ,
240+ } ;
241+ bcs:: serialize_into ( & mut buf, & multisig) . expect ( "serialization cannot fail" ) ;
242+ serializer. serialize_bytes ( & buf)
235243 }
236244 }
237245 }
@@ -260,25 +268,12 @@ mod serialization {
260268 let mut buf = Vec :: new ( ) ;
261269 buf. push ( SignatureScheme :: Multisig as u8 ) ;
262270
263- if let Some ( bitmap) = & self . legacy_bitmap {
264- let legacy = LegacyMultisigRef {
265- signatures : & self . signatures ,
266- bitmap,
267- committee : LegacyMultisigCommitteeRef {
268- members : & self . committee . members ,
269- threshold : self . committee . threshold ,
270- } ,
271- } ;
272-
273- bcs:: serialize_into ( & mut buf, & legacy) . expect ( "serialization cannot fail" ) ;
274- } else {
275- let multisig = MultisigRef {
276- signatures : & self . signatures ,
277- bitmap : self . bitmap ,
278- committee : & self . committee ,
279- } ;
280- bcs:: serialize_into ( & mut buf, & multisig) . expect ( "serialization cannot fail" ) ;
281- }
271+ let multisig = MultisigRef {
272+ signatures : & self . signatures ,
273+ bitmap : self . bitmap ,
274+ committee : & self . committee ,
275+ } ;
276+ bcs:: serialize_into ( & mut buf, & multisig) . expect ( "serialization cannot fail" ) ;
282277 buf
283278 }
284279
0 commit comments