@@ -439,6 +439,8 @@ pub struct MockSignature {
439
439
signature : MessageSignature ,
440
440
/// The mock block proposal that was signed across
441
441
pub mock_proposal : MockProposal ,
442
+ /// The signature metadata
443
+ pub metadata : SignerMessageMetadata ,
442
444
}
443
445
444
446
impl MockSignature {
@@ -447,6 +449,7 @@ impl MockSignature {
447
449
let mut sig = Self {
448
450
signature : MessageSignature :: empty ( ) ,
449
451
mock_proposal,
452
+ metadata : SignerMessageMetadata :: default ( ) ,
450
453
} ;
451
454
sig. sign ( stacks_private_key)
452
455
. expect ( "Failed to sign MockSignature" ) ;
@@ -476,15 +479,18 @@ impl StacksMessageCodec for MockSignature {
476
479
fn consensus_serialize < W : Write > ( & self , fd : & mut W ) -> Result < ( ) , CodecError > {
477
480
write_next ( fd, & self . signature ) ?;
478
481
self . mock_proposal . consensus_serialize ( fd) ?;
482
+ self . metadata . consensus_serialize ( fd) ?;
479
483
Ok ( ( ) )
480
484
}
481
485
482
486
fn consensus_deserialize < R : Read > ( fd : & mut R ) -> Result < Self , CodecError > {
483
487
let signature = read_next :: < MessageSignature , _ > ( fd) ?;
484
488
let mock_proposal = MockProposal :: consensus_deserialize ( fd) ?;
489
+ let metadata = SignerMessageMetadata :: consensus_deserialize ( fd) ?;
485
490
Ok ( Self {
486
491
signature,
487
492
mock_proposal,
493
+ metadata,
488
494
} )
489
495
}
490
496
}
@@ -1206,6 +1212,7 @@ mod test {
1206
1212
let mut mock_signature = MockSignature {
1207
1213
signature : MessageSignature :: empty ( ) ,
1208
1214
mock_proposal : random_mock_proposal ( ) ,
1215
+ metadata : SignerMessageMetadata :: default ( ) ,
1209
1216
} ;
1210
1217
mock_signature
1211
1218
. sign ( & StacksPrivateKey :: new ( ) )
0 commit comments