Skip to content

Commit

Permalink
Merge branch 'release/v0.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
genaromadrid committed Mar 17, 2017
2 parents 0bf2582 + b8b05e3 commit f4e1357
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ Style/Documentation:

Style/HashSyntax:
EnforcedStyle: ruby19

Metrics/BlockLength:
Exclude:
- 'spec/**/*'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ group :development, :test do
gem 'guard-rubocop'
gem 'terminal-notifier-guard'
# force gems for ruby <2.1.2
gem 'ruby_dep', '1.3.1'
gem 'listen', '3.0.8'
gem 'ruby_dep', '1.3.1'
end
5 changes: 5 additions & 0 deletions lib/coloredcoins/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def send_asset(asset)
@connection.post('/sendasset', asset)
end

# http://coloredcoins.org/documentation/#BurnAsset
def burn_asset(args)
@connection.post('/burnasset', args)
end

# http://coloredcoins.org/documentation/#BroadcastTransaction
def broadcast(tx_hex)
@connection.post('/broadcast', txHex: tx_hex)
Expand Down
2 changes: 1 addition & 1 deletion lib/coloredcoins/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Coloredcoins
VERSION = '0.0.4'.freeze
VERSION = '0.0.5'.freeze
end
11 changes: 11 additions & 0 deletions spec/coloredcoins/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@
end
end

describe '#burn_asset' do
it 'should call connection' do
args = {
from: ['blah'],
burn: [{ assetId: 'blah', amount: 1 }]
}
subject.burn_asset(args)
expect(subject.connection).to have_received(:post).with(/burnasset/, args)
end
end

describe '#asset_metadata' do
it 'should call connection' do
subject.asset_metadata('asset_id', 'utxo:1')
Expand Down

0 comments on commit f4e1357

Please sign in to comment.