@@ -7,7 +7,9 @@ use tokio::sync::{Mutex, MutexGuard};
7
7
8
8
use mithril_common:: {
9
9
CardanoNetwork , StdResult ,
10
- crypto_helper:: { OpCert , TryFromBytes } ,
10
+ crypto_helper:: {
11
+ OpCert , OpCertWithoutColdVerificationKey , TryFromBytes , ed25519:: Ed25519VerificationKey ,
12
+ } ,
11
13
entities:: PartyId ,
12
14
logging:: LoggerExtensions ,
13
15
} ;
@@ -113,8 +115,17 @@ impl<M: TryFromBytes + Debug> DmqConsumerClientPallas<M> {
113
115
. 0
114
116
. into_iter ( )
115
117
. map ( |dmq_message| {
116
- let opcert = OpCert :: try_from_bytes ( & dmq_message. operational_certificate )
118
+ let opcert_without_verification_key =
119
+ OpCertWithoutColdVerificationKey :: try_from_bytes (
120
+ & dmq_message. operational_certificate ,
121
+ )
117
122
. with_context ( || "Failed to parse operational certificate" ) ?;
123
+ let cold_verification_key =
124
+ Ed25519VerificationKey :: from_bytes ( & dmq_message. cold_verification_key )
125
+ . with_context ( || "Failed to parse cold verification key" ) ?
126
+ . into_inner ( ) ;
127
+ let opcert: OpCert =
128
+ ( opcert_without_verification_key, cold_verification_key) . into ( ) ;
118
129
let party_id = opcert. compute_protocol_party_id ( ) ?;
119
130
let payload = M :: try_from_bytes ( & dmq_message. msg_payload . msg_body )
120
131
. with_context ( || "Failed to parse DMQ message body" ) ?;
@@ -184,16 +195,17 @@ mod tests {
184
195
} ,
185
196
kes_signature: vec![ 0 , 1 , 2 , 3 ] ,
186
197
operational_certificate: vec![
187
- 130 , 132 , 88 , 32 , 230 , 80 , 215 , 83 , 21 , 9 , 187 , 108 , 255 , 215 , 153 , 140 , 40 ,
188
- 198 , 142 , 78 , 200 , 250 , 98 , 26 , 9 , 82 , 32 , 110 , 161 , 30 , 176 , 63 , 205 , 125 ,
189
- 203 , 41 , 0 , 0 , 88 , 64 , 212 , 171 , 206 , 39 , 218 , 5 , 255 , 3 , 193 , 52 , 44 , 198 ,
190
- 171 , 83 , 19 , 80 , 114 , 225 , 186 , 191 , 156 , 192 , 84 , 146 , 245 , 159 , 31 , 240 , 9 ,
191
- 247 , 4 , 87 , 170 , 168 , 98 , 199 , 21 , 139 , 19 , 190 , 12 , 251 , 65 , 215 , 169 , 26 , 86 ,
192
- 37 , 137 , 188 , 17 , 14 , 178 , 205 , 175 , 93 , 39 , 86 , 4 , 138 , 187 , 234 , 95 , 5 , 88 ,
193
- 32 , 32 , 253 , 186 , 201 , 177 , 11 , 117 , 135 , 187 , 167 , 181 , 188 , 22 , 59 , 206 , 105 ,
198
+ 132 , 88 , 32 , 230 , 80 , 215 , 83 , 21 , 9 , 187 , 108 , 255 , 215 , 153 , 140 , 40 , 198 ,
199
+ 142 , 78 , 200 , 250 , 98 , 26 , 9 , 82 , 32 , 110 , 161 , 30 , 176 , 63 , 205 , 125 , 203 , 41 ,
200
+ 0 , 0 , 88 , 64 , 212 , 171 , 206 , 39 , 218 , 5 , 255 , 3 , 193 , 52 , 44 , 198 , 171 , 83 , 19 ,
201
+ 80 , 114 , 225 , 186 , 191 , 156 , 192 , 84 , 146 , 245 , 159 , 31 , 240 , 9 , 247 , 4 , 87 ,
202
+ 170 , 168 , 98 , 199 , 21 , 139 , 19 , 190 , 12 , 251 , 65 , 215 , 169 , 26 , 86 , 37 , 137 ,
203
+ 188 , 17 , 14 , 178 , 205 , 175 , 93 , 39 , 86 , 4 , 138 , 187 , 234 , 95 , 5 ,
204
+ ] ,
205
+ cold_verification_key: vec![
206
+ 32 , 253 , 186 , 201 , 177 , 11 , 117 , 135 , 187 , 167 , 181 , 188 , 22 , 59 , 206 , 105 ,
194
207
231 , 150 , 215 , 30 , 78 , 212 , 76 , 16 , 252 , 180 , 72 , 134 , 137 , 247 , 161 , 68 ,
195
208
] ,
196
- cold_verification_key: vec![ 0 , 1 , 2 , 3 , 4 , 5 ] ,
197
209
} ,
198
210
DmqMsg {
199
211
msg_payload: DmqMsgPayload {
@@ -204,17 +216,17 @@ mod tests {
204
216
} ,
205
217
kes_signature: vec![ 1 , 2 , 3 , 4 ] ,
206
218
operational_certificate: vec![
207
- 130 , 132 , 88 , 32 , 230 , 80 , 215 , 83 , 21 , 9 , 187 , 108 , 255 , 215 , 153 , 140 , 40 ,
208
- 198 , 142 , 78 , 200 , 250 , 98 , 26 , 9 , 82 , 32 , 110 , 161 , 30 , 176 , 63 , 205 , 125 ,
209
- 203 , 41 , 0 , 0 , 88 , 64 , 132 , 4 , 199 , 39 , 190 , 173 , 88 , 102 , 121 , 117 , 55 , 62 ,
210
- 39 , 189 , 113 , 96 , 175 , 24 , 171 , 240 , 74 , 42 , 139 , 202 , 128 , 185 , 44 , 130 , 209 ,
211
- 77 , 191 , 122 , 196 , 224 , 33 , 158 , 187 , 156 , 203 , 190 , 173 , 150 , 247 , 87 , 172 ,
212
- 58 , 153 , 185 , 157 , 87 , 128 , 14 , 187 , 107 , 187 , 215 , 105 , 195 , 107 , 135 , 172 ,
213
- 43 , 173 , 9 , 88 , 32 , 77 , 75 , 24 , 6 , 47 , 133 , 2 , 89 , 141 , 224 , 69 , 202 , 123 , 105 ,
214
- 240 , 103 , 245 , 159 , 147 , 177 , 110 , 58 , 248 , 115 , 58 , 152 , 138 , 220 , 35 , 65 ,
215
- 245 , 200 ,
219
+ 132 , 88 , 32 , 230 , 80 , 215 , 83 , 21 , 9 , 187 , 108 , 255 , 215 , 153 , 140 , 40 , 198 ,
220
+ 142 , 78 , 200 , 250 , 98 , 26 , 9 , 82 , 32 , 110 , 161 , 30 , 176 , 63 , 205 , 125 , 203 , 41 ,
221
+ 0 , 0 , 88 , 64 , 212 , 171 , 206 , 39 , 218 , 5 , 255 , 3 , 193 , 52 , 44 , 198 , 171 , 83 , 19 ,
222
+ 80 , 114 , 225 , 186 , 191 , 156 , 192 , 84 , 146 , 245 , 159 , 31 , 240 , 9 , 247 , 4 , 87 ,
223
+ 170 , 168 , 98 , 199 , 21 , 139 , 19 , 190 , 12 , 251 , 65 , 215 , 169 , 26 , 86 , 37 , 137 ,
224
+ 188 , 17 , 14 , 178 , 205 , 175 , 93 , 39 , 86 , 4 , 138 , 187 , 234 , 95 , 5 ,
225
+ ] ,
226
+ cold_verification_key: vec![
227
+ 77 , 75 , 24 , 6 , 47 , 133 , 2 , 89 , 141 , 224 , 69 , 202 , 123 , 105 , 240 , 103 , 245 , 159 ,
228
+ 147 , 177 , 110 , 58 , 248 , 115 , 58 , 152 , 138 , 220 , 35 , 65 , 245 , 200 ,
216
229
] ,
217
- cold_verification_key: vec![ 0 , 1 , 2 , 3 , 4 , 5 ] ,
218
230
} ,
219
231
]
220
232
}
0 commit comments