Skip to content

Commit

Permalink
add tx_idx to name json
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanne committed Jun 25, 2016
1 parent ff4916a commit c4c7faa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Expand Up @@ -32,7 +32,7 @@ GIT

GIT
remote: git://github.com/mhanne/namecoin-ruby
revision: fa34c3432710e8281b31ae9e107a1cd83115d714
revision: 4f3a23aea4564c9b552de2b88ca1b0788539baaf
specs:
namecoin-ruby (0.0.1)

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/names_controller.rb
Expand Up @@ -35,7 +35,7 @@ def heights

def parse_output_options
@opts = Hash[params.keys.grep(/^with_(.*?)$/).map {|n| [n.to_sym, true] }]
[:block, :height, :rawtx, :mrkl_branch].each {|n|
[:block, :height, :tx_idx, :rawtx, :mrkl_branch].each {|n|
@opts["with_#{n}".to_sym] = true } if params.keys.include?('with_all')
end

Expand Down
7 changes: 7 additions & 0 deletions app/views/api/name.html.haml
Expand Up @@ -24,6 +24,9 @@ The following parameters are accepted to influence the detail of returned data:
%tr
%th with_height
%td Add the block height to the name data
%tr
%th with_tx_idx
%td Add the transaction index in the block
%tr
%th with_rawtx
%td Add the raw transaction the name operation appears in (in hex)
Expand Down Expand Up @@ -73,6 +76,10 @@ The following parameters are accepted to influence the detail of returned data:
%th height
%td Height of the block this name was registered in
%td 23406
%tr
%th tx_idx
%td The index of the transaction within the block
%td 1
%tr
%th rawtx
%td The raw transaction in which this name operation appears (in hex)
Expand Down

0 comments on commit c4c7faa

Please sign in to comment.