fn calculate_approval_threshold(
    proposal: &Proposal,
    voteplan: &VoteProposalStatus,
    threshold: f64,
    total_stake_threshold: f64
) -> Result<(i64, bool)>