 ;;--------------------------------
 
 
-(defn get-block-hashes []
-  (map (partial btc-rpc "getblockhash") (range (btc-rpc "getblockcount"))))
+(defn get-block-hashes [] (map getblockhash (range (getblockcount))))
 
 (defn block-of [block-hash] (getblock block-hash))
 


(s/fdef getblockhash
  :args ::height      
  :ret string?)
(def-rpc getblockhash height)

(s/fdef getblockheader 
  :args (s/alt :verbose (s/cat :hash string?), :choice (s/cat :hash string?, :verbose boolean?)))
(def-rpc-opt getblockheader hash verbose)

(s/fdef getchaintips :ret vector?) 

  `(defn ~name ~(get-description name) 
     ([~@args] (btc-rpc ~(str name) ~@args))
     ([~@(butlast args)] (btc-rpc ~(str name) ~@(butlast args)))
     ))
(defmacro def-rpc-all-opt [name & args]
  `(defn ~name ~(get-description name) 
     ([~@args] (btc-rpc ~(str name) ~@args))
     ([] (btc-rpc ~(str name)))
     ))

;;--------RPC calls-----------

