Skip to content

Commit

Permalink
Merge pull request #19 from piotr-iohk/tx_by_id
Browse files Browse the repository at this point in the history
Tx by id + show pledge
  • Loading branch information
piotr-iohk committed Jun 26, 2020
2 parents 94a3f09 + 48bb83f commit 2f73cfd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 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'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions app.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions views/stake_pools.erb
Expand Up @@ -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"
Expand Down Expand Up @@ -67,6 +69,9 @@ end
<% unless stake_pools.first['metrics']['saturation'].nil? %>
| <small><a href="<%= ep %>&sort_by=saturation">by saturation</a></small>
<% end %>
<% unless stake_pools.first['pledge'].nil? %>
| <small><a href="<%= ep %>&sort_by=pledge">by pledge</a></small>
<% end %>
<%# jorm specific: %>
<% unless stake_pools.first['desirability'].nil? %>
| <small><a href="<%= ep %>&sort_by=desirability">by desirability</a></small>
Expand Down Expand Up @@ -97,6 +102,12 @@ end
<% end %>
<%# end %>
<%# Cardano-node: %>
<% if s['pledge'] %>
<small><b>Pledge:</b> <%= "#{s['pledge']['quantity']} #{s['pledge']['unit']}" %></small><br/>
<% end %>
<%# end %>
<% if s['metrics'] %>
<small><b>Metrics:</b></small></br>
<%# Cardano-node metrics: %>
Expand Down

0 comments on commit 2f73cfd

Please sign in to comment.