@@ -725,6 +725,38 @@ mod tests {
725725 assert_eq ! ( client. get_contributor_count( & campaign_id) , 1 ) ;
726726 }
727727
728+
729+ #[ test]
730+ fn test_contributor_count_no_double_count_multiple_tokens ( ) {
731+ let env = Env :: default ( ) ;
732+ env. mock_all_auths ( ) ;
733+
734+ let creator = Address :: generate ( & env) ;
735+ let contributor = Address :: generate ( & env) ;
736+ let admin = Address :: generate ( & env) ;
737+
738+ let token1 = deploy_token ( & env, & admin, & contributor, 1_000 ) ;
739+ let token2 = deploy_token ( & env, & admin, & contributor, 1_000 ) ;
740+ let client = deploy_contract ( & env) ;
741+
742+ let campaign_id = client. create_campaign (
743+ & creator,
744+ & soroban_sdk:: vec![ & env, token1. clone( ) , token2. clone( ) ] ,
745+ & 1_000_i128 ,
746+ & ( env. ledger ( ) . timestamp ( ) + 1_000 ) ,
747+ & String :: from_str ( & env, "multiple tokens pledge test" ) ,
748+ & 0_i128 ,
749+ ) ;
750+
751+ // Contributor pledges with token1
752+ client. contribute ( & campaign_id, & contributor, & token1, & 400 ) ;
753+ assert_eq ! ( client. get_contributor_count( & campaign_id) , 1 ) ;
754+
755+ // Contributor pledges with token2 - count should remain 1
756+ client. contribute ( & campaign_id, & contributor, & token2, & 300 ) ;
757+ assert_eq ! ( client. get_contributor_count( & campaign_id) , 1 ) ;
758+ }
759+
728760 // ── #184: minimum contribution tests ──────────────────────────────────────
729761
730762 #[ test]
0 commit comments