Skip to content

Commit 03e0875

Browse files
committed
Temporarly remove Client MultiSignature verification
The multi signature verification is temporarily skipped, until the real certificate hash is computed and stored in a local store instead of in remote manifest file
1 parent f27d364 commit 03e0875

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

mithril-client/src/client.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use hex::ToHex;
21
use log::debug;
3-
use mithril_common::fake_data;
2+
43
use std::str;
54
use thiserror::Error;
65

@@ -9,6 +8,7 @@ use crate::entities::*;
98
use crate::verifier;
109

1110
pub const MISSING_AGGREGATOR_HANDLER: &str = "missing aggregator handler";
11+
#[allow(dead_code)]
1212
pub const MISSING_VERIFIER: &str = "missing verifier";
1313

1414
/// AggregatorHandlerWrapper wraps an AggregatorHandler
@@ -128,11 +128,15 @@ impl Client {
128128
let aggregator_handler = &self.aggregator_handler.as_ref().ok_or_else(|| {
129129
ClientError::MissingDependency(MISSING_AGGREGATOR_HANDLER.to_string())
130130
})?;
131-
let verifier = &self
131+
// TODO: Reactivate when real certificate hash is available
132+
/*let verifier = &self
132133
.verifier
133134
.as_ref()
134135
.ok_or_else(|| ClientError::MissingDependency(MISSING_VERIFIER.to_string()))?;
135-
let fake_digest = &fake_data::digest();
136+
137+
let mut beacon = fake_data::beacon();
138+
beacon.immutable_file_number = 0;
139+
let fake_digest = &fake_data::digest(&beacon);
136140
let certificate_hash = &fake_digest.encode_hex::<String>();
137141
debug!("Fake certificate hash {:?}", certificate_hash);
138142
let certificate_details = aggregator_handler
@@ -146,7 +150,7 @@ impl Client {
146150
&certificate_details.participants,
147151
&certificate_details.protocol_parameters,
148152
)
149-
.map_err(ClientError::VerifierError)?;
153+
.map_err(ClientError::VerifierError)?;*/
150154
aggregator_handler
151155
.unpack_snapshot(digest)
152156
.await
@@ -293,7 +297,9 @@ mod tests {
293297
restore.expect("unexpected error");
294298
}
295299

296-
#[tokio::test]
300+
#[allow(dead_code)]
301+
// TODO: To reactivate once real snapshot available
302+
//#[tokio::test]
297303
async fn test_restore_snapshot_ko_get_certificate_details() {
298304
let certificate_hash = "certhash123";
299305
let mut mock_aggregator_handler = MockAggregatorHandler::new();
@@ -305,6 +311,7 @@ mod tests {
305311
"error occurred".to_string(),
306312
))
307313
});
314+
308315
let mut client = Client::new("testnet".to_string());
309316
client
310317
.with_aggregator_handler(Box::new(mock_aggregator_handler))
@@ -313,7 +320,9 @@ mod tests {
313320
assert!(restore.is_err(), "an error should have occurred");
314321
}
315322

316-
#[tokio::test]
323+
#[allow(dead_code)]
324+
// TODO: To reactivate once real snapshot available
325+
//#[tokio::test]
317326
async fn test_restore_snapshot_ko_verify_multi_signature() {
318327
let certificate_hash = "certhash123";
319328
let fake_certificate = fake_data::certificate(certificate_hash.to_string());

mithril-test-lab/mithril-end-to-end/test/Test/EndToEndSpec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ assertNodeIsProducingSnapshot _tracer _cardanoNode aggregatorPort = go 10
9898
200 -> do
9999
CertificatePending {beacon} <- getResponseBody <$> httpJSON request
100100
let digest = digestOf beacon
101-
putStrLn $ "Got beacon : " <> show beacon <> ", computed certificate hash : " <> show digest
101+
putStrLn $ "Got beacon : " <> show beacon <> ", computed digest : " <> show digest
102102
pure $ digest
103103
other -> failure $ "unexpected status code: " <> show other
104104

0 commit comments

Comments
 (0)