pub fn customer_close<E: Engine>(channel_state: &ChannelState<E>, cust_state: &CustomerState<E>) -> ChannelcloseC<E> {
        if !channel_state.channel_established {
            panic!("Cannot close a channel that has not been established!");
        }

        let mut wallet = cust_state.get_wallet();
        let close_token = cust_state.get_close_token();

        let cp = channel_state.cp.as_ref().unwrap();
        let pk = cp.pub_params.pk.get_pub_key();
        let close_wallet = wallet.with_close(String::from("close"));

        assert!(pk.verify(&cp.pub_params.mpk, &close_wallet, &close_token));
        ChannelcloseC { wpk: cust_state.wpk, message: wallet, signature: close_token }
    }
// for customer => on input a wallet w, it outputs a customer channel closure message
///
/// customer_close - takes as input the channel state, merchant's verification
/// key, and customer state. Generates a channel closure message for customer.
///
for customer => on input a wallet w, it outputs a customer channel closure message
customer_close - takes as input the channel state, merchant's verification
key, and customer state. Generates a channel closure message for customer.
for customer = > on input a wallet w it outputs a customer channel closure message customer_close - takes as input the channel state merchant ' s verification key and customer state . Generates a channel closure message for customer .
pub fn customer_close<E: Engine>(channel_state: &ChannelState<E>, cust_state: &CustomerState<E>) -> ChannelcloseC<E> {
        if !channel_state.channel_established {
            panic!("Cannot close a channel that has not been established!");
        }
        let mut wallet = cust_state.get_wallet();
        let close_token = cust_state.get_close_token();
        let cp = channel_state.cp.as_ref().unwrap();
        let pk = cp.pub_params.pk.get_pub_key();
        let close_wallet = wallet.with_close(String::from("close"));
        assert!(pk.verify(&cp.pub_params.mpk, &close_wallet, &close_token));
        ChannelcloseC { wpk: cust_state.wpk, message: wallet, signature: close_token }
    }
pub fn customer_close < E : Engine > ( channel_state : & ChannelState < E > , cust_state : & CustomerState < E > ) -> ChannelcloseC < E > { if ! channel_state . channel_established { panic ! ( " " ) ; } let mut wallet = cust_state . get_wallet ( ) ; let close_token = cust_state . get_close_token ( ) ; let cp = channel_state . cp . as_ref ( ) . unwrap ( ) ; let pk = cp . pub_params . pk . get_pub_key ( ) ; let close_wallet = wallet . with_close ( String :: from ( " " ) ) ; assert ! ( pk verify ( cp pub_params mpk close_wallet close_token ) ) ; ChannelcloseC { wpk : cust_state . wpk , message : wallet , signature : close_token } }
for customer => on input a wallet w, it outputs a customer channel closure message
customer_close - takes as input the channel state, merchant's verification
key, and customer state.
for customer = > on input a wallet w it outputs a customer channel closure message customer_close - takes as input the channel state merchant ' s verification key and customer state .
channel_state
&ChannelState<E>
cust_state
&CustomerState<E>
channel_state
&ChannelState<E>
cust_state
&CustomerState<E>