From 309b261531fc408f73d06bfcab9fc196108853c7 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 18 Jun 2020 21:37:38 +0200 Subject: [PATCH 1/2] stake pools listed with stake --- lib/cardano_wallet/shelley.rb | 5 +++-- spec/shelley_spec.rb | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/cardano_wallet/shelley.rb b/lib/cardano_wallet/shelley.rb index cabc1ad..2b1bd65 100644 --- a/lib/cardano_wallet/shelley.rb +++ b/lib/cardano_wallet/shelley.rb @@ -230,8 +230,9 @@ def initialize opt # List all stake pools # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listStakePools - def list(wid) - self.class.get("/wallets/#{wid}/stake-pools") + def list(stake = {}) + stake.empty? ? query = '' : query = Utils.to_query(stake) + self.class.get("/stake-pools#{query}") end # Join stake pool diff --git a/spec/shelley_spec.rb b/spec/shelley_spec.rb index c603e15..fe794ee 100644 --- a/spec/shelley_spec.rb +++ b/spec/shelley_spec.rb @@ -238,10 +238,12 @@ teardown end - it "Can list stake pools" do - id = create_shelley_wallet + it "Can list stake pools only when stake is provided" do pools = SHELLEY.stake_pools - expect(pools.list(id).code).to eq 200 + expect(pools.list({stake: 1000}).code).to eq 200 + + expect(pools.list.code).to eq 400 + expect(pools.list).to include "query_param_missing" end it "I could join Stake Pool - if I knew it's id" do From 4a05daf47e1867b06c785f0c0f3784ed31b858db Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 18 Jun 2020 21:38:12 +0200 Subject: [PATCH 2/2] Bump version to 0.1.3 --- lib/cardano_wallet/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cardano_wallet/version.rb b/lib/cardano_wallet/version.rb index 3eeb596..48a847c 100644 --- a/lib/cardano_wallet/version.rb +++ b/lib/cardano_wallet/version.rb @@ -1,3 +1,3 @@ module CardanoWallet - VERSION = "0.1.2" + VERSION = "0.1.3" end