diff --git a/nearx/src/hint.rs b/nearx/src/hint.rs index 16587df..2836b90 100644 --- a/nearx/src/hint.rs +++ b/nearx/src/hint.rs @@ -302,18 +302,11 @@ mod tests { 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() {