Unverified Commit c157185d authored by Roman Zeyde's avatar Roman Zeyde
Browse files

Add some TODOs

parent 7b858f99
......@@ -62,9 +62,10 @@ impl Daemon {
}
}
// TODO: use error_chain for errors here.
fn request(&self, resource: &str) -> reqwest::Response {
let url = format!("{}/rest/{}", self.url, resource);
reqwest::get(&url).unwrap()
reqwest::get(&url).unwrap().error_for_status().unwrap()
}
pub fn get(&self, resource: &str) -> Bytes {
......
......@@ -15,6 +15,7 @@ use daemon::{Daemon, HeaderEntry, HeaderList};
use store::{Row, Store};
use types::{Bytes, HeaderMap};
// TODO: consolidate serialization/deserialize code for bincode/bitcoin.
const HASH_LEN: usize = 32;
pub const HASH_PREFIX_LEN: usize = 8;
......@@ -265,6 +266,8 @@ impl<'a> Iterator for BatchIter<'a> {
}
pub struct Index {
// TODO: store also a &HeaderMap.
// TODO: store also latest snapshot.
headers: Option<HeaderList>,
}
......
......@@ -58,6 +58,7 @@ impl<'a> Handler<'a> {
}
fn blockchain_transaction_get(&self, params: &[&str]) -> Result<Value> {
// TODO: handle 'verbose' param
let tx_hash_hex = params.get(0).chain_err(|| "missing tx_hash")?;
let tx_hash = Sha256dHash::from_hex(tx_hash_hex).chain_err(|| "invalid tx_hash")?;
let tx_hex = util::hexlify(&self.query.get_tx(tx_hash));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment