pub fn verify_payment_proof<R: Rng, E: Engine>(csprng: &mut R, channel_state: &ChannelState<E>,
                                                   payment: &Payment<E>, merch_state: &mut MerchantState<E>) -> cl::Signature<E> {
        // if payment proof verifies, then returns close-token and records wpk => pay-token
        // if valid revoke_token is provided later for wpk, then release pay-token
        let tx_fee = channel_state.get_channel_fee();
        let payment_amount = match tx_fee > 0 {
            true => payment.amount + tx_fee,
            false => payment.amount
        };
        let new_close_token = merch_state.verify_payment(csprng, &channel_state,
                                                         &payment.proof, &payment.com, &payment.wpk, payment_amount).unwrap();
        // store the wpk since it has been revealed
        update_merchant_state(&mut merch_state.keys, &payment.wpk, None);
        return new_close_token;
    }
///
/// verify_payment (phase 1) - takes as input the public params, channel state, payment proof
/// and merchant keys. If proof is valid, then merchant returns the refund token
/// (i.e., partially blind signature on IOU with updated balance)
///
verify_payment (phase 1) - takes as input the public params, channel state, payment proof
and merchant keys. If proof is valid, then merchant returns the refund token
verify_payment ( phase 1 ) - takes as input the public params channel state payment proof and merchant keys . If proof is valid then merchant returns the refund token
pub fn verify_payment_proof<R: Rng, E: Engine>(csprng: &mut R, channel_state: &ChannelState<E>,
                                                   payment: &Payment<E>, merch_state: &mut MerchantState<E>) -> cl::Signature<E> {
        // if payment proof verifies, then returns close-token and records wpk => pay-token
        // if valid revoke_token is provided later for wpk, then release pay-token
        let tx_fee = channel_state.get_channel_fee();
        let payment_amount = match tx_fee > 0 {
            true => payment.amount + tx_fee,
            false => payment.amount
        };
        let new_close_token = merch_state.verify_payment(csprng, &channel_state,
                                                         &payment.proof, &payment.com, &payment.wpk, payment_amount).unwrap();
        // store the wpk since it has been revealed
        update_merchant_state(&mut merch_state.keys, &payment.wpk, None);
        return new_close_token;
    }
pub fn verify_payment_proof < R : Rng , E : Engine > ( csprng : & mut R , channel_state : & ChannelState < E > , payment : & Payment < E > , merch_state : & mut MerchantState < E > ) -> cl :: Signature < E > { // if payment proof verifies, then returns close-token and records wpk => pay-token // if valid revoke_token is provided later for wpk, then release pay-token let tx_fee = channel_state . get_channel_fee ( ) ; let payment_amount = match tx_fee > 0 { true => payment . amount + tx_fee , false => payment . amount } ; let new_close_token = merch_state . verify_payment ( csprng , & channel_state , & payment . proof , & payment . com , & payment . wpk , payment_amount ) . unwrap ( ) ; // store the wpk since it has been revealed update_merchant_state ( & mut merch_state . keys , & payment . wpk , None ) ; return new_close_token ; }
verify_payment (phase 1) - takes as input the public params, channel state, payment proof
and merchant keys.
verify_payment ( phase 1 ) - takes as input the public params channel state payment proof and merchant keys .
csprng
&mut R
channel_state
&ChannelState<E>
payment
&Payment<E>
merch_state
&mut MerchantState<E>
csprng
&mut R
channel_state
&ChannelState<E>
payment
&Payment<E>
merch_state
&mut MerchantState<E>