pub fn route(
        ctx: &TransactionContext,
        tx: String,
        args: &[Vec<u8>],
        transient: &HashMap<String,Vec<u8>>,
    ) -> Result<WireBuffer, ContractError> {
        trace!("contractmanager::route>>");

        // parse out the contract_name here
        let namespace: String;
        let fn_name: String;
        match tx.find(':') {
            None => {
                namespace = "default".to_string();
                fn_name = tx.clone();
            }
            Some(s) => {
                namespace = tx[..s].to_string();
                fn_name = tx[s + 1..].to_string();
            }
        }

        // two early checks on the validity of the requested function
        if namespace.is_empty() {
            return Err(ContractError::from(String::from("Emptry namespace, for default just give fn name")));
        };

        if fn_name.is_empty() {
            return Err(ContractError::from(String::from("Empty function name")));
        };

        // let r = CONTRACT_MGR
        //     .lock()
        //     .unwrap()
        //     .evaluate(ctx, namespace, fn_name, args, transient);


        let r = match CONTRACT_MGR
            .lock() {
                Ok(mut ccm) => {            
                    ccm.evaluate(ctx, namespace, fn_name, args, transient)
                }
                Err(poisoned) => {panic!("I've been poisoned")}
            };

        trace!("contractmanager::route<<");
        r
    }
/// Route the call to the correct contract
Route the call to the correct contract
Route the call to the correct contract
pub fn route(
        ctx: &TransactionContext,
        tx: String,
        args: &[Vec<u8>],
        transient: &HashMap<String,Vec<u8>>,
    ) -> Result<WireBuffer, ContractError> {
        trace!("contractmanager::route>>");
        // parse out the contract_name here
        let namespace: String;
        let fn_name: String;
        match tx.find(':') {
            None => {
                namespace = "default".to_string();
                fn_name = tx.clone();
            }
            Some(s) => {
                namespace = tx[..s].to_string();
                fn_name = tx[s + 1..].to_string();
            }
        }
        // two early checks on the validity of the requested function
        if namespace.is_empty() {
            return Err(ContractError::from(String::from("Emptry namespace, for default just give fn name")));
        };
        if fn_name.is_empty() {
            return Err(ContractError::from(String::from("Empty function name")));
        };
        // let r = CONTRACT_MGR
        //     .lock()
        //     .unwrap()
        //     .evaluate(ctx, namespace, fn_name, args, transient);
        let r = match CONTRACT_MGR
            .lock() {
                Ok(mut ccm) => {            
                    ccm.evaluate(ctx, namespace, fn_name, args, transient)
                }
                Err(poisoned) => {panic!("I've been poisoned")}
            };
        trace!("contractmanager::route<<");
        r
    }
pub fn route ( ctx : & TransactionContext , tx : String , args : & [ Vec < u8 > ] , transient : & HashMap < String , Vec < u8 > > , ) -> Result < WireBuffer , ContractError > { trace ! ( " " ) ; // parse out the contract_name here let namespace : String ; let fn_name : String ; match tx . find ( ':' ) { None => { namespace = " " . to_string ( ) ; fn_name = tx . clone ( ) ; } Some ( s ) => { namespace = tx [ .. s ] . to_string ( ) ; fn_name = tx [ s + 1 .. ] . to_string ( ) ; } } // two early checks on the validity of the requested function if namespace . is_empty ( ) { return Err ( ContractError :: from ( String :: from ( " " ) ) ) ; } ; if fn_name . is_empty ( ) { return Err ( ContractError :: from ( String :: from ( " " ) ) ) ; } ; // let r = CONTRACT_MGR //     .lock() //     .unwrap() //     .evaluate(ctx, namespace, fn_name, args, transient); let r = match CONTRACT_MGR . lock ( ) { Ok ( mut ccm ) => { ccm . evaluate ( ctx , namespace , fn_name , args , transient ) } Err ( poisoned ) => { panic ! ( " " ) } } ; trace ! ( " " ) ; r }
Route the call to the correct contract
Route the call to the correct contract
ctx
&TransactionContext
tx
String
args
&[Vec<u8>]
transient
&HashMap<String,Vec<u8>>