Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Chiguireitor
addrindexrs
Commits
c157185d
Unverified
Commit
c157185d
authored
May 01, 2018
by
Roman Zeyde
Browse files
Add some TODOs
parent
7b858f99
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletion
+6
-1
src/daemon.rs
src/daemon.rs
+2
-1
src/index.rs
src/index.rs
+3
-0
src/rpc.rs
src/rpc.rs
+1
-0
No files found.
src/daemon.rs
View file @
c157185d
...
...
@@ -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
{
...
...
src/index.rs
View file @
c157185d
...
...
@@ -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
>
,
}
...
...
src/rpc.rs
View file @
c157185d
...
...
@@ -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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment