pub fn txn_info(&mut self, block_num: u64, block_index: u32) -> TxnInfo {
        let mut txn_info = self.txn_by_block_idx(block_num, block_index)
            .unwrap_or(JsonValue::Null);

        let from = txn_info["result"]["from"]
            .take_string()
            .unwrap_or_else(|| String::new());
        let to = txn_info["result"]["to"]
            .take_string()
            .unwrap_or_else(|| String::new());
        let gas_price = {
            let px = txn_info["result"]["gasPrice"].as_str().unwrap_or("0x0");
            hex_to_u64(px).unwrap_or(0)
        };

        TxnInfo {
            block_num,
            block_index,
            gas_price,
            from,
            to,
        }
    }
/// Obtain transaction information for transaction in the given block at the given
/// transaction index.
Obtain transaction information for transaction in the given block at the given
transaction index.
Obtain transaction information for transaction in the given block at the given transaction index .
pub fn txn_info(&mut self, block_num: u64, block_index: u32) -> TxnInfo {
        let mut txn_info = self.txn_by_block_idx(block_num, block_index)
            .unwrap_or(JsonValue::Null);
        let from = txn_info["result"]["from"]
            .take_string()
            .unwrap_or_else(|| String::new());
        let to = txn_info["result"]["to"]
            .take_string()
            .unwrap_or_else(|| String::new());
        let gas_price = {
            let px = txn_info["result"]["gasPrice"].as_str().unwrap_or("0x0");
            hex_to_u64(px).unwrap_or(0)
        };
        TxnInfo {
            block_num,
            block_index,
            gas_price,
            from,
            to,
        }
    }
pub fn txn_info ( & mut self , block_num : u64 , block_index : u32 ) -> TxnInfo { let mut txn_info = self . txn_by_block_idx ( block_num , block_index ) . unwrap_or ( JsonValue :: Null ) ; let from = txn_info [ " " ] [ " " ] . take_string ( ) . unwrap_or_else ( | | String :: new ( ) ) ; let to = txn_info [ " " ] [ " " ] . take_string ( ) . unwrap_or_else ( | | String :: new ( ) ) ; let gas_price = { let px = txn_info [ " " ] [ " " ] . as_str ( ) . unwrap_or ( " " ) ; hex_to_u64 ( px ) . unwrap_or ( 0 ) } ; TxnInfo { block_num , block_index , gas_price , from , to , } }
Obtain transaction information for transaction in the given block at the given
transaction index.
Obtain transaction information for transaction in the given block at the given transaction index .
&mut self
block_num
u64
block_index
u32
&mut self
block_num
u64
block_index
u32