@@ -371,23 +371,21 @@ fn cmz_wallet_spend_relation<G: PrimeGroup, R: RngCore>(
371371}
372372
373373
374- fn test_another_relation < G : PrimeGroup , R : RngCore > (
374+ fn nested_affine_relation < G : PrimeGroup , R : RngCore > (
375375 mut rng : & mut R ,
376376) -> ( CanonicalLinearRelation < G > , Vec < G :: Scalar > ) {
377377 let mut instance = LinearRelation :: < G > :: new ( ) ;
378- let r = instance. allocate_scalar ( ) ;
378+ let var_r = instance. allocate_scalar ( ) ;
379379 let var_A = instance. allocate_element ( ) ;
380380 let var_B = instance. allocate_element ( ) ;
381381 let eq1 = instance. allocate_eq (
382- var_A * G :: Scalar :: from ( 4 )
383- + ( r * G :: Scalar :: from ( 2 ) + G :: Scalar :: from ( 3 ) ) * var_B,
382+ var_A * G :: Scalar :: from ( 4 ) + ( var_r * G :: Scalar :: from ( 2 ) + G :: Scalar :: from ( 3 ) ) * var_B,
384383 ) ;
385384
386385 let A = G :: random ( & mut rng) ;
387386 let B = G :: random ( & mut rng) ;
388387 let r = G :: Scalar :: random ( & mut rng) ;
389- let C = A * G :: Scalar :: from ( 4 )
390- + ( r * G :: Scalar :: from ( 2 ) + G :: Scalar :: from ( 3 ) ) * var_B;
388+ let C = A * G :: Scalar :: from ( 4 ) + B * ( r * G :: Scalar :: from ( 2 ) + G :: Scalar :: from ( 3 ) ) ;
391389 instance. set_element ( var_A, A ) ;
392390 instance. set_element ( var_B, B ) ;
393391 instance. set_element ( eq1, C ) ;
@@ -478,6 +476,7 @@ fn test_relations() {
478476 "cmz_wallet_spend_relation" ,
479477 Box :: new( cmz_wallet_spend_relation) ,
480478 ) ,
479+ ( "nested_affine_relation" , Box :: new( nested_affine_relation) ) ,
481480 ] ;
482481
483482 for ( relation_name, relation_sampler) in instance_generators. iter ( ) {
0 commit comments