pub fn new_from_difficulty(pow: &ProofOfWork, added_difficulty: Difficulty) -> ProofOfWork {
        let (m, b) = match pow.pow_algo {
            PowAlgorithm::Monero => (
                pow.accumulated_monero_difficulty + added_difficulty,
                pow.accumulated_blake_difficulty,
            ),
            PowAlgorithm::Blake => (
                pow.accumulated_monero_difficulty,
                pow.accumulated_blake_difficulty + added_difficulty,
            ),
            PowAlgorithm::Sha3 => (
                pow.accumulated_monero_difficulty,
                pow.accumulated_blake_difficulty + added_difficulty,
            ),
        };
        ProofOfWork {
            accumulated_monero_difficulty: m,
            accumulated_blake_difficulty: b,
            target_difficulty: pow.target_difficulty,
            pow_algo: pow.pow_algo,
            pow_data: pow.pow_data.clone(),
        }
    }
/// Creates a new proof of work from the provided proof of work difficulty with the sum of this proof of work's
/// total cumulative difficulty and the provided `added_difficulty`.
Creates a new proof of work from the provided proof of work difficulty with the sum of this proof of work's
total cumulative difficulty and the provided `added_difficulty`.
Creates a new proof of work from the provided proof of work difficulty with the sum of this proof of work ' s total cumulative difficulty and the provided ` added_difficulty ` .
pub fn new_from_difficulty(pow: &ProofOfWork, added_difficulty: Difficulty) -> ProofOfWork {
        let (m, b) = match pow.pow_algo {
            PowAlgorithm::Monero => (
                pow.accumulated_monero_difficulty + added_difficulty,
                pow.accumulated_blake_difficulty,
            ),
            PowAlgorithm::Blake => (
                pow.accumulated_monero_difficulty,
                pow.accumulated_blake_difficulty + added_difficulty,
            ),
            PowAlgorithm::Sha3 => (
                pow.accumulated_monero_difficulty,
                pow.accumulated_blake_difficulty + added_difficulty,
            ),
        };
        ProofOfWork {
            accumulated_monero_difficulty: m,
            accumulated_blake_difficulty: b,
            target_difficulty: pow.target_difficulty,
            pow_algo: pow.pow_algo,
            pow_data: pow.pow_data.clone(),
        }
    }
pub fn new_from_difficulty ( pow : & ProofOfWork , added_difficulty : Difficulty ) -> ProofOfWork { let ( m , b ) = match pow . pow_algo { PowAlgorithm :: Monero => ( pow . accumulated_monero_difficulty + added_difficulty , pow . accumulated_blake_difficulty , ) , PowAlgorithm :: Blake => ( pow . accumulated_monero_difficulty , pow . accumulated_blake_difficulty + added_difficulty , ) , PowAlgorithm :: Sha3 => ( pow . accumulated_monero_difficulty , pow . accumulated_blake_difficulty + added_difficulty , ) , } ; ProofOfWork { accumulated_monero_difficulty : m , accumulated_blake_difficulty : b , target_difficulty : pow . target_difficulty , pow_algo : pow . pow_algo , pow_data : pow . pow_data . clone ( ) , } }
Creates a new proof of work from the provided proof of work difficulty with the sum of this proof of work's
total cumulative difficulty and the provided `added_difficulty`.
Creates a new proof of work from the provided proof of work difficulty with the sum of this proof of work ' s total cumulative difficulty and the provided ` added_difficulty ` .
pow
&ProofOfWork
added_difficulty
Difficulty
pow
&ProofOfWork
added_difficulty
Difficulty