Commit c8e19c1d authored by kenshin-samourai's avatar kenshin-samourai
Browse files

reactivate scripthash.get_balance endpoint (with null balances)

parent 745d51ee
...@@ -60,6 +60,12 @@ impl Connection { ...@@ -60,6 +60,12 @@ impl Connection {
])) ]))
} }
fn blockchain_scripthash_get_balance(&self, _params: &[Value]) -> Result<Value> {
Ok(
json!({ "confirmed": null, "unconfirmed": null }),
)
}
fn blockchain_scripthash_get_history(&self, params: &[Value]) -> Result<Value> { fn blockchain_scripthash_get_history(&self, params: &[Value]) -> Result<Value> {
let script_hash = hash_from_value(params.get(0)).chain_err(|| "bad script_hash")?; let script_hash = hash_from_value(params.get(0)).chain_err(|| "bad script_hash")?;
let status = self.query.status(&script_hash[..])?; let status = self.query.status(&script_hash[..])?;
...@@ -74,6 +80,7 @@ impl Connection { ...@@ -74,6 +80,7 @@ impl Connection {
fn handle_command(&mut self, method: &str, params: &[Value], id: &Value) -> Result<Value> { fn handle_command(&mut self, method: &str, params: &[Value], id: &Value) -> Result<Value> {
let result = match method { let result = match method {
"blockchain.scripthash.get_balance" => self.blockchain_scripthash_get_balance(&params),
"blockchain.scripthash.get_history" => self.blockchain_scripthash_get_history(&params), "blockchain.scripthash.get_history" => self.blockchain_scripthash_get_history(&params),
"server.ping" => Ok(Value::Null), "server.ping" => Ok(Value::Null),
"server.version" => self.server_version(), "server.version" => self.server_version(),
......
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