From f201fbcbaefc21bcfb8e7a123935789716556ba0 Mon Sep 17 00:00:00 2001 From: Edgar Goetzendorff Date: Thu, 9 May 2019 16:54:08 +0200 Subject: [PATCH 1/2] feat: add node/fees endpoint --- src/API/Node.php | 12 ++++++++++++ tests/API/NodeTest.php | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/src/API/Node.php b/src/API/Node.php index a49163f..c12b9e2 100644 --- a/src/API/Node.php +++ b/src/API/Node.php @@ -49,4 +49,16 @@ public function configuration(): array { return $this->get('node/configuration'); } + + /** + * Get the node fee statistics. + * + * @param integer|null $days + * + * @return array + */ + public function fees(integer $days = null): array + { + return $this->get('node/fees', ['query' => ['days' => $days]]); + } } diff --git a/tests/API/NodeTest.php b/tests/API/NodeTest.php index 4c4af73..0952827 100644 --- a/tests/API/NodeTest.php +++ b/tests/API/NodeTest.php @@ -46,4 +46,12 @@ public function configuration_calls_correct_url() return $connection->node()->configuration(); }); } + + /** @test */ + public function fees_calls_correct_url() + { + $this->assertResponse(2, 'GET', 'node/fees', function ($connection) { + return $connection->node()->fees(); + }); + } } From e8fc01d02d3ae9b83282b1e135e0ee059084236a Mon Sep 17 00:00:00 2001 From: Edgar Goetzendorff Date: Thu, 9 May 2019 17:01:56 +0200 Subject: [PATCH 2/2] fix: int instead of integer --- src/API/Node.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/API/Node.php b/src/API/Node.php index c12b9e2..20643e9 100644 --- a/src/API/Node.php +++ b/src/API/Node.php @@ -53,11 +53,11 @@ public function configuration(): array /** * Get the node fee statistics. * - * @param integer|null $days - * + * @param int|null $days + * * @return array */ - public function fees(integer $days = null): array + public function fees(int $days = null): array { return $this->get('node/fees', ['query' => ['days' => $days]]); }