Skip to content

Commit

Permalink
Merge eefd13d into 0bf2582
Browse files Browse the repository at this point in the history
  • Loading branch information
genaromadrid committed Mar 16, 2017
2 parents 0bf2582 + eefd13d commit 562ded9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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
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 562ded9

Please sign in to comment.