use super::identity_registry::{IdentityRegistry, DeveloperIdentity, ContributionRecord};
use super::contribution_analyzer::{ContributionAnalyzer, ContributionReport, ContributionMetrics};
use super::reward_proposal::RewardProposalGenerator;
#[test]
fn test_dev_rewards_pipeline() {
let mut registry = IdentityRegistry::default();
registry.register_identity(DeveloperIdentity {
github_username: "alice".to_string(),
gpg_key_hash: "abc123".to_string(),
payment_address: "ST1...ALICE".to_string(),
web5_did: None,
reputation_score: 100,
contribution_history: vec![ContributionRecord {
commit_hash: "deadbeef".to_string(),
timestamp: 1_700_000_000,
weight: 10,
}],
});
let reports = vec![
ContributionReport {
github_username: "alice".to_string(),
gpg_key_id: "abc123".to_string(),
time_period: (1_700_000_000, 1_700_100_000),
metrics: ContributionMetrics {
commit_count: 5,
lines_added: 100,
lines_removed: 10,
files_changed: 3,
complexity_score: 1.2,
documentation_score: 0.8,
test_coverage_delta: 0.05,
issue_references: vec!["#42".to_string()],
},
calculated_weight: 1.0,
}
];
let proposal = RewardProposalGenerator::generate(reports, 100_000, (1_700_000_000, 1_700_100_000));
assert_eq!(proposal.contributors.len(), 1);
assert_eq!(proposal.total_distribution_amount, 100_000);
assert_eq!(proposal.contributors[0].0, "alice");
}