@@ -2105,7 +2105,7 @@ where
21052105}
21062106
21072107#[ test]
2108- fn cellc_check_reports_checked_pool_invariant_families_without_runtime_blockers ( ) {
2108+ fn cellc_check_reports_amm_pool_without_runtime_blockers ( ) {
21092109 let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
21102110 let root = temp. path ( ) ;
21112111 let manifest_dir = std:: path:: PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
@@ -2130,36 +2130,37 @@ version = "0.1.0"
21302130 assert ! ( json_output. status. success( ) , "unexpected failure: {}" , String :: from_utf8_lossy( & json_output. stderr) ) ;
21312131 let stdout: serde_json:: Value = serde_json:: from_slice ( & json_output. stdout ) . unwrap ( ) ;
21322132 let target = & stdout[ "checked_targets" ] [ 0 ] ;
2133- assert ! ( target[ "checked_pool_invariant_families" ] . as_u64( ) . unwrap( ) > 0 , "unexpected stdout: {}" , stdout) ;
2134- assert ! ( target[ "runtime_required_pool_invariant_families" ] . as_u64( ) . unwrap( ) > 0 , "unexpected stdout: {}" , stdout) ;
2135- assert ! ( target[ "runtime_required_pool_invariant_blocker_classes" ] . as_u64( ) . unwrap( ) > 0 , "unexpected stdout: {}" , stdout) ;
2133+ assert_eq ! ( target[ "checked_pool_invariant_families" ] . as_u64( ) . unwrap( ) , 0 , "unexpected stdout: {}" , stdout) ;
2134+ assert_eq ! ( target[ "runtime_required_pool_invariant_families" ] . as_u64( ) . unwrap( ) , 0 , "unexpected stdout: {}" , stdout) ;
2135+ assert_eq ! ( target[ "runtime_required_pool_invariant_blocker_classes" ] . as_u64( ) . unwrap( ) , 0 , "unexpected stdout: {}" , stdout) ;
21362136 let blocker_classes = target[ "runtime_required_pool_invariant_blocker_class_summaries" ]
21372137 . as_array ( )
21382138 . expect ( "runtime-required Pool invariant blocker class summaries array" ) ;
2139+ assert ! ( blocker_classes. is_empty( ) , "AMM pool admission should not leave runtime-required blockers: {}" , stdout) ;
2140+ let runtime_inputs = target[ "pool_runtime_input_requirement_summaries" ] . as_array ( ) . expect ( "runtime input summaries array" ) ;
21392141 assert ! (
2140- blocker_classes . iter( ) . any( |value| value. as_str( ) . is_some_and( |summary| summary. contains( "pool-create:Pool" ) ) ) ,
2141- "AMM pool admission blockers should remain explicit : {}" ,
2142+ !runtime_inputs . iter( ) . any( |value| value. as_str( ) . is_some_and( |summary| { summary. contains( "reserve-conservation=" ) } ) ) ,
2143+ "AMM reserve-conservation should not appear in Pool runtime input summaries : {}" ,
21422144 stdout
21432145 ) ;
2144- assert ! (
2145- !blocker_classes. iter( ) . any( |value| value
2146- . as_str( )
2147- . is_some_and( |summary| { summary. contains( "pool-mutation-invariants:Pool:reserve-conservation" ) } ) ) ,
2148- "reserve-conservation should be checked-runtime, not in blocker classes: {}" ,
2146+ assert_eq ! (
2147+ target[ "runtime_required_transaction_runtime_input_requirements" ] . as_u64( ) . unwrap( ) ,
2148+ 0 ,
2149+ "unexpected stdout: {}" ,
21492150 stdout
21502151 ) ;
2151- let runtime_inputs = target [ "pool_runtime_input_requirement_summaries" ] . as_array ( ) . expect ( "runtime input summaries array" ) ;
2152- assert ! (
2153- !runtime_inputs . iter ( ) . any ( |value| value . as_str ( ) . is_some_and ( |summary| { summary . contains ( "reserve-conservation=" ) } ) ) ,
2154- "checked reserve-conservation should not appear in runtime input summaries : {}" ,
2152+ assert_eq ! (
2153+ target [ "runtime_required_transaction_runtime_input_blocker_classes" ] . as_u64 ( ) . unwrap ( ) ,
2154+ 0 ,
2155+ "unexpected stdout : {}" ,
21552156 stdout
21562157 ) ;
21572158
21582159 let output = cellc_command ( ) . current_dir ( root) . arg ( "check" ) . arg ( "--deny-runtime-obligations" ) . output ( ) . unwrap ( ) ;
21592160 assert ! (
2160- ! output. status. success( ) ,
2161- "full AMM policy debt should still fail deny-runtime-obligations: {}" ,
2162- String :: from_utf8_lossy( & output. stdout )
2161+ output. status. success( ) ,
2162+ "full AMM policy should satisfy deny-runtime-obligations: {}" ,
2163+ String :: from_utf8_lossy( & output. stderr )
21632164 ) ;
21642165}
21652166
0 commit comments