From 322552dde4e088a6e6d15f180226190f2ae9148b Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Fri, 26 Oct 2018 15:28:43 +0200 Subject: [PATCH 1/5] fix: add missing API in list Closes #1653 --- api/src/handlers.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/handlers.rs b/api/src/handlers.rs index d684d4262..301ec9934 100644 --- a/api/src/handlers.rs +++ b/api/src/handlers.rs @@ -821,9 +821,10 @@ pub fn build_router( "get status".to_string(), "get txhashset/roots".to_string(), "get txhashset/lastoutputs?n=10".to_string(), - "get txhashset/lastrangeproofs".to_string(), - "get txhashset/lastkernels".to_string(), + "get txhashset/lastrangeproofs?n=1".to_string(), + "get txhashset/lastkernels?n=1".to_string(), "get txhashset/outputs?start_index=1&max=100".to_string(), + "get txhashset/merkleproof?n=output_id".to_string(), "get pool".to_string(), "post pool/push".to_string(), "post peers/a.b.c.d:p/ban".to_string(), @@ -831,6 +832,7 @@ pub fn build_router( "get peers/all".to_string(), "get peers/connected".to_string(), "get peers/a.b.c.d".to_string(), + "get headers".to_string(), ]; let index_handler = IndexHandler { list: route_list }; From 365814303d02c7accc1e87db0d5c26015df4afd9 Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Fri, 26 Oct 2018 17:07:46 +0200 Subject: [PATCH 2/5] Replace query parameter values with placeholders --- api/src/handlers.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/src/handlers.rs b/api/src/handlers.rs index 301ec9934..47eb6e22b 100644 --- a/api/src/handlers.rs +++ b/api/src/handlers.rs @@ -820,18 +820,18 @@ pub fn build_router( "get chain/outputs".to_string(), "get status".to_string(), "get txhashset/roots".to_string(), - "get txhashset/lastoutputs?n=10".to_string(), - "get txhashset/lastrangeproofs?n=1".to_string(), - "get txhashset/lastkernels?n=1".to_string(), - "get txhashset/outputs?start_index=1&max=100".to_string(), "get txhashset/merkleproof?n=output_id".to_string(), + "get txhashset/lastoutputs?n=".to_string(), + "get txhashset/lastrangeproofs?n=".to_string(), + "get txhashset/lastkernels?n=".to_string(), + "get txhashset/outputs?start_index=&max=".to_string(), "get pool".to_string(), "post pool/push".to_string(), - "post peers/a.b.c.d:p/ban".to_string(), - "post peers/a.b.c.d:p/unban".to_string(), + "post peers/:/ban".to_string(), + "post peers/:/unban".to_string(), "get peers/all".to_string(), "get peers/connected".to_string(), - "get peers/a.b.c.d".to_string(), + "get peers/".to_string(), "get headers".to_string(), ]; let index_handler = IndexHandler { list: route_list }; From 46c862297d59c7698ae78105f82e066a1b3e659f Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Fri, 26 Oct 2018 17:09:07 +0200 Subject: [PATCH 3/5] fix: replace wrong query parameter --- api/src/handlers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/handlers.rs b/api/src/handlers.rs index 47eb6e22b..37eaf3265 100644 --- a/api/src/handlers.rs +++ b/api/src/handlers.rs @@ -249,7 +249,7 @@ impl Handler for OutputHandler { // GET /v1/txhashset/outputs?start_index=1&max=100 // // Build a merkle proof for a given pos -// GET /v1/txhashset/merkleproof?n=1 +// GET /v1/txhashset/merkleproof?id=1 struct TxHashSetHandler { chain: Weak, @@ -820,11 +820,11 @@ pub fn build_router( "get chain/outputs".to_string(), "get status".to_string(), "get txhashset/roots".to_string(), - "get txhashset/merkleproof?n=output_id".to_string(), "get txhashset/lastoutputs?n=".to_string(), "get txhashset/lastrangeproofs?n=".to_string(), "get txhashset/lastkernels?n=".to_string(), "get txhashset/outputs?start_index=&max=".to_string(), + "get txhashset/merkleproof?id=".to_string(), "get pool".to_string(), "post pool/push".to_string(), "post peers/:/ban".to_string(), From 930ceccdbabf72769ca9fcc6c9bf238312213e4c Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Fri, 26 Oct 2018 17:18:06 +0200 Subject: [PATCH 4/5] Extent query explaination --- api/src/handlers.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/api/src/handlers.rs b/api/src/handlers.rs index 37eaf3265..ea37ab306 100644 --- a/api/src/handlers.rs +++ b/api/src/handlers.rs @@ -241,15 +241,19 @@ impl Handler for OutputHandler { // // Last inserted nodes:: // GET /v1/txhashset/lastoutputs (gets last 10) -// GET /v1/txhashset/lastoutputs?n=5 -// GET /v1/txhashset/lastrangeproofs -// GET /v1/txhashset/lastkernels +// GET /v1/txhashset/lastoutputs?n=5 (get last 5) +// +// GET /v1/txhashset/lastrangeproofs (gets last 10) +// GET /v1/txhashset/lastrangeproofs?n=5 (get last 5) +// +// GET /v1/txhashset/lastkernels (gets last 10) +// GET /v1/txhashset/lastkernels?n=5 (get last 5) // UTXO traversal:: // GET /v1/txhashset/outputs?start_index=1&max=100 // // Build a merkle proof for a given pos -// GET /v1/txhashset/merkleproof?id=1 +// GET /v1/txhashset/merkleproof?id=1 (get merkle proof of output commitment 1) struct TxHashSetHandler { chain: Weak, From 456cd0318a3e3da6aa86ddf1d8b8190d3ef4d790 Mon Sep 17 00:00:00 2001 From: hashmap Date: Sat, 27 Oct 2018 10:06:01 +0200 Subject: [PATCH 5/5] Add missing port parameter Co-Authored-By: haarts --- api/src/handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/handlers.rs b/api/src/handlers.rs index ea37ab306..d42bab871 100644 --- a/api/src/handlers.rs +++ b/api/src/handlers.rs @@ -835,7 +835,7 @@ pub fn build_router( "post peers/:/unban".to_string(), "get peers/all".to_string(), "get peers/connected".to_string(), - "get peers/".to_string(), + "get peers/:".to_string(), "get headers".to_string(), ]; let index_handler = IndexHandler { list: route_list };