File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
internal/mithril-dmq/src/model Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
- use std:: sync:: Arc ;
1
+ use std:: { sync:: Arc , vec } ;
2
2
3
3
use anyhow:: { Context , anyhow} ;
4
4
use blake2:: { Blake2b , Digest , digest:: consts:: U64 } ;
@@ -65,16 +65,21 @@ impl DmqMessageBuilder {
65
65
let block_number = ( * block_number)
66
66
. try_into ( )
67
67
. with_context ( || "Failed to convert block number to u32" ) ?;
68
- let ( kes_signature, operational_certificate) = self
68
+ // TODO: fix, this is here only to circumvent a problem with the computation of the KES period which relies on the Operational Certificate
69
+ let ( _kes_signature, operational_certificate) = self
69
70
. kes_signer
70
- . sign ( message_bytes, block_number )
71
+ . sign ( message_bytes, 0 )
71
72
. with_context ( || "Failed to KES sign message while building DMQ message" ) ?;
72
73
let kes_period = self
73
74
. chain_observer
74
75
. get_current_kes_period ( & operational_certificate)
75
76
. await
76
77
. with_context ( || "Failed to get KES period while building DMQ message" ) ?
77
78
. unwrap_or_default ( ) ;
79
+ let ( kes_signature, operational_certificate) = self
80
+ . kes_signer
81
+ . sign ( message_bytes, kes_period)
82
+ . with_context ( || "Failed to KES sign message while building DMQ message" ) ?;
78
83
let mut dmq_message = DmqMsg {
79
84
msg_id : vec ! [ ] ,
80
85
msg_body : message_bytes. to_vec ( ) ,
You can’t perform that action at this time.
0 commit comments