fn handle_tx_invoke(msg: &[u8]) -> CallResult {
    trace!("handler_tx_invoke>>");

    // decode the message and arguments
    let invoke_request = parse_from_bytes::<InvokeTransactionRequest>(&msg).unwrap();
    let fn_name = invoke_request.get_transaction_name();
    let args = invoke_request.get_args();
    let transient_args = invoke_request.get_transient_args();
    let request_ctx = invoke_request.get_context();
    set_context(TransactionContext::new(request_ctx));
    let ctx = get_context();

    // pass over to the contract manager to route
    trace!(
        "making the routing call tx::{}  fn::{}",
        request_ctx.get_transaction_id(),
        fn_name
    );

    let mut response_msg = InvokeTransactionResponse::new();

    let ret = match ContractManager::route(&ctx, fn_name.to_string(), args, transient_args) {
        Ok(r) => {
            let buffer = match r.buffer {
                Some(r) => r,
                None => Vec::new(),
            };
            response_msg.set_payload(buffer)
        }
        Err(e) => response_msg.set_payload(e.to_string().into_bytes()),
    };

    let buffer: Vec<u8> = response_msg.write_to_bytes()?;
    trace!("handler_tx_invoke<<");
    Ok(buffer)
}
/// handle_tx_invoke called with the buffer that contains the request
/// of what transaction function should be invoked
handle_tx_invoke called with the buffer that contains the request
of what transaction function should be invoked
handle_tx_invoke called with the buffer that contains the request of what transaction function should be invoked
fn handle_tx_invoke(msg: &[u8]) -> CallResult {
    trace!("handler_tx_invoke>>");
    // decode the message and arguments
    let invoke_request = parse_from_bytes::<InvokeTransactionRequest>(&msg).unwrap();
    let fn_name = invoke_request.get_transaction_name();
    let args = invoke_request.get_args();
    let transient_args = invoke_request.get_transient_args();
    let request_ctx = invoke_request.get_context();
    set_context(TransactionContext::new(request_ctx));
    let ctx = get_context();
    // pass over to the contract manager to route
    trace!(
        "making the routing call tx::{}  fn::{}",
        request_ctx.get_transaction_id(),
        fn_name
    );
    let mut response_msg = InvokeTransactionResponse::new();
    let ret = match ContractManager::route(&ctx, fn_name.to_string(), args, transient_args) {
        Ok(r) => {
            let buffer = match r.buffer {
                Some(r) => r,
                None => Vec::new(),
            };
            response_msg.set_payload(buffer)
        }
        Err(e) => response_msg.set_payload(e.to_string().into_bytes()),
    };
    let buffer: Vec<u8> = response_msg.write_to_bytes()?;
    trace!("handler_tx_invoke<<");
    Ok(buffer)
}
fn handle_tx_invoke ( msg : & [ u8 ] ) -> CallResult { trace ! ( " " ) ; // decode the message and arguments let invoke_request = parse_from_bytes :: < InvokeTransactionRequest > ( & msg ) . unwrap ( ) ; let fn_name = invoke_request . get_transaction_name ( ) ; let args = invoke_request . get_args ( ) ; let transient_args = invoke_request . get_transient_args ( ) ; let request_ctx = invoke_request . get_context ( ) ; set_context ( TransactionContext :: new ( request_ctx ) ) ; let ctx = get_context ( ) ; // pass over to the contract manager to route trace ! ( " " request_ctx get_transaction_id ( ) fn_name ) ; let mut response_msg = InvokeTransactionResponse :: new ( ) ; let ret = match ContractManager :: route ( & ctx , fn_name . to_string ( ) , args , transient_args ) { Ok ( r ) => { let buffer = match r . buffer { Some ( r ) => r , None => Vec :: new ( ) , } ; response_msg . set_payload ( buffer ) } Err ( e ) => response_msg . set_payload ( e . to_string ( ) . into_bytes ( ) ) , } ; let buffer : Vec < u8 > = response_msg . write_to_bytes ( ) ? ; trace ! ( " " ) ; Ok ( buffer ) }
handle_tx_invoke called with the buffer that contains the request
of what transaction function should be invoked
handle_tx_invoke called with the buffer that contains the request of what transaction function should be invoked
msg
&[u8]