From b887f95755cbe38a42c5f3a5bd788796dab78c6d Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 26 Jun 2020 15:51:04 +0200 Subject: [PATCH 1/4] Bump cardano_wallet to 0.1.4 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index e5c5745..867591e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'cardano_wallet', '~> 0.1.3' +gem 'cardano_wallet', '~> 0.1.4' gem 'sys-proctable', '~> 1.2.3' gem 'docopt', '~> 0.6.1' gem 'bip_mnemonic', '~> 0.0.4' diff --git a/Gemfile.lock b/Gemfile.lock index d650182..7925b9b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,7 +12,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - cardano_wallet (0.1.3) + cardano_wallet (0.1.4) httparty (~> 0.18.0) chartkick (3.3.1) codecov (0.1.16) @@ -80,7 +80,7 @@ PLATFORMS DEPENDENCIES bip_mnemonic (~> 0.0.4) capybara - cardano_wallet (~> 0.1.3) + cardano_wallet (~> 0.1.4) chartkick (~> 3.3.1) codecov docopt (~> 0.6.1) From 42710a079b1de2ecaada53fe9c6e75fa1a830be4 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 26 Jun 2020 15:52:52 +0200 Subject: [PATCH 2/4] Use get tx by id --- app.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app.rb b/app.rb index 373d62c..d0ab088 100644 --- a/app.rb +++ b/app.rb @@ -283,7 +283,7 @@ get "/wallets/:wal_id/txs/:tx_id" do wid = params[:wal_id] txid = params[:tx_id] - tx = @cw.shelley.transactions.list(wid).select{ |tx| tx['id'] == txid }[0] + tx = @cw.shelley.transactions.get(wid, txid) erb :tx_details, { :locals => { :tx => tx, :wid => wid } } end @@ -464,8 +464,7 @@ get "/byron-wallets/:wal_id/txs/:tx_id" do wid = params[:wal_id] - tx = @cw.byron.transactions.list(params[:wal_id]). - select{ |tx| tx['id'] == params[:tx_id]}[0] + tx = @cw.byron.transactions.get(params[:wal_id], params[:tx_id]) erb :tx_details, { :locals => { :tx => tx, :wid => wid } } end From 013bb1a90438e9e29d89002641140728b348fc74 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 26 Jun 2020 16:03:52 +0200 Subject: [PATCH 3/4] View pledge in stake-pool list for cardano-node --- views/stake_pools.erb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/views/stake_pools.erb b/views/stake_pools.erb index 7c46e6e..f8f3a45 100644 --- a/views/stake_pools.erb +++ b/views/stake_pools.erb @@ -13,6 +13,8 @@ when "cost" when "margin" sp = stake_pools.sort_by {|s| -s['margin']['quantity']} # cardano-node specific +when "pledge" + sp = stake_pools.sort_by {|s| -s['pledge']['quantity']} when "stake" sp = stake_pools.sort_by {|s| -s['metrics']['relative_stake']['quantity']} when "non_myopic_member_rewards" @@ -67,6 +69,9 @@ end <% unless stake_pools.first['metrics']['saturation'].nil? %> | by saturation <% end %> + <% unless stake_pools.first['pledge'].nil? %> + | by pledge + <% end %> <%# jorm specific: %> <% unless stake_pools.first['desirability'].nil? %> | by desirability @@ -97,6 +102,12 @@ end <% end %> <%# end %> + <%# Cardano-node: %> + <% if s['pledge'] %> + Pledge: <%= "#{s['pledge']['quantity']} #{s['pledge']['unit']}" %>
+ <% end %> + <%# end %> + <% if s['metrics'] %> Metrics:
<%# Cardano-node metrics: %> From 48bb83f89e55c13538775c25c1d8bb8f60008001 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 26 Jun 2020 16:13:53 +0200 Subject: [PATCH 4/4] Update testnet config in CI --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c140df..d089712 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,9 +35,9 @@ jobs: - name: Set up cardano-wallet & cardano-node on Shelley testnet run: | wget https://raw.githubusercontent.com/piotr-iohk/cardano-wallet-rb/master/docker-compose-shelley.yml - wget https://raw.githubusercontent.com/piotr-iohk/cardano-wallet-rb/master/spec/shelley-testnet/configuration.yaml - wget https://raw.githubusercontent.com/piotr-iohk/cardano-wallet-rb/master/spec/shelley-testnet/ff-genesis.json - wget https://raw.githubusercontent.com/piotr-iohk/cardano-wallet-rb/master/spec/shelley-testnet/topology.json + wget https://raw.githubusercontent.com/piotr-iohk/cardano-wallet-rb/master/spec/shelley-testnet/shelley_testnet-config.json + wget https://raw.githubusercontent.com/piotr-iohk/cardano-wallet-rb/master/spec/shelley-testnet/shelley_testnet-genesis.json + wget https://raw.githubusercontent.com/piotr-iohk/cardano-wallet-rb/master/spec/shelley-testnet/shelley_testnet-topology.json NODE_CONFIG_PATH=`pwd` docker-compose -f docker-compose-shelley.yml up --detach - name: Run tests run: rspec tests