diff --git a/bin/operator/tests/succinct.rs b/bin/operator/tests/succinct.rs index 773a1cd..48f8499 100644 --- a/bin/operator/tests/succinct.rs +++ b/bin/operator/tests/succinct.rs @@ -1,8 +1,6 @@ #![allow(dead_code)] // Justification: Until we decide on test feature flags -use std::str::FromStr; use nearx_operator::{config::Config, succinct::*, BaseConfig}; -use uuid::Uuid; async fn client() -> Client { let _ = tracing_subscriber::fmt::try_init(); diff --git a/nearx/src/hint.rs b/nearx/src/hint.rs index 16587df..2740c53 100644 --- a/nearx/src/hint.rs +++ b/nearx/src/hint.rs @@ -295,25 +295,18 @@ mod tests { }; type Testnet = FixturesConfig; - type Mainnet = FixturesConfig; + type _Mainnet = FixturesConfig; #[test] fn test_fetch_header() { let (main_h, _, main_nb) = test_state(); let (test_h, _, test_nb) = testnet_state(); + type Mainnet = FixturesConfig; + let define = |b: &mut B| { - let header = b.read::(); - let trusted_header_hash = header.hash(b); - let (_header, _bps, next_block) = - InputFetcher::(Default::default()).fetch_sync(b, &trusted_header_hash); - b.write::>(next_block); - - let header = b.read::(); - let trusted_header_hash = header.hash(b); - let (_header, _bps, next_block) = - InputFetcher::(Default::default()).fetch_sync(b, &trusted_header_hash); - b.write::>(next_block); + test_fetch_data::(b); + test_fetch_data::(b); }; let writer = |input: &mut PI| { @@ -333,6 +326,22 @@ mod tests { builder_suite(define, writer, assertions); } + // This is a compiler bug because we use the [();BPS] syntax to constrain the + // const generic + #[allow(unused)] + fn test_fetch_data(b: &mut CircuitBuilder) + where + C: Config, + [(); C::BPS]:, + { + let header = b.read::(); + let trusted_header_hash = header.hash(b); + + let (_header, _bps, next_block) = + InputFetcher::(Default::default()).fetch_sync(b, &trusted_header_hash); + b.write::>(next_block); + } + // TODO: turns out this resolved itself on live after 2 weeks without doing // anything, probably platform issue #[test] // fn test_fetch_corner_cases() {