coloredcoins 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Guardfile +5 -0
- data/lib/coloredcoins/transaction.rb +3 -2
- data/lib/coloredcoins/version.rb +1 -1
- data/spec/coloredcoins/multisig_tx_spec.rb +22 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ff06df2a3869d6b48c15bd1bfa61955e4910393
|
4
|
+
data.tar.gz: af62dad99c005945113dcfdedfd5e65b7fefcdb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbfecf418c0d040f8e6778acf9ab24c0a43970afe6a1224ae792e98e36e702ff1fed7e063db70096e98f13b5bfa9630215c068a9eb785596c88e59de5b237f40
|
7
|
+
data.tar.gz: a7535aefe05fb8632af482a3b52592a31e5de1be113718be45c1b6466ea4993d83cb596519aae446f9b455d8124be9b8ea1446d112a602f8571e727d9ef5f989
|
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -21,3 +21,8 @@ guard :rspec, rspec_options do
|
|
21
21
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
22
22
|
watch(rspec.spec_helper) { rspec.spec_dir }
|
23
23
|
end
|
24
|
+
|
25
|
+
guard :rubocop, all_on_start: true do
|
26
|
+
watch(/.+\.rb$/)
|
27
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
28
|
+
end
|
@@ -35,8 +35,9 @@ module Coloredcoins
|
|
35
35
|
|
36
36
|
def broadcast
|
37
37
|
response = Coloredcoins.broadcast(to_hex)
|
38
|
-
return response
|
39
|
-
response
|
38
|
+
return response unless response[:txid]
|
39
|
+
txid = response[:txid]
|
40
|
+
txid.is_a?(Array) ? txid.first[:txid] : txid
|
40
41
|
end
|
41
42
|
end
|
42
43
|
end
|
data/lib/coloredcoins/version.rb
CHANGED
@@ -206,16 +206,31 @@ describe Coloredcoins::MultisigTx do
|
|
206
206
|
end
|
207
207
|
|
208
208
|
describe '#broadcast' do
|
209
|
-
|
210
|
-
|
209
|
+
shared_examples 'a success broadcast' do
|
210
|
+
before do
|
211
|
+
allow(Coloredcoins).to receive(:broadcast).and_return(broadcast_response)
|
212
|
+
end
|
213
|
+
before { @response = subject.broadcast }
|
214
|
+
|
215
|
+
it { expect(Coloredcoins).to have_received(:broadcast).once }
|
216
|
+
|
217
|
+
it { expect(@response).to eq(tx_id) }
|
218
|
+
end
|
211
219
|
|
212
|
-
|
213
|
-
|
220
|
+
context 'when receive an object - as mark in the documentation' do
|
221
|
+
let!(:tx_id) { 'some-transaction-hash' }
|
222
|
+
|
223
|
+
it_behaves_like 'a success broadcast' do
|
224
|
+
let!(:broadcast_response) { { txid: tx_id } }
|
225
|
+
end
|
214
226
|
end
|
215
|
-
before { @response = subject.broadcast }
|
216
227
|
|
217
|
-
|
228
|
+
context 'when receive an array' do
|
229
|
+
let!(:tx_id) { 'some-transaction-hash' }
|
218
230
|
|
219
|
-
|
231
|
+
it_behaves_like 'a success broadcast' do
|
232
|
+
let!(:broadcast_response) { { txid: [{ txid: tx_id }] } }
|
233
|
+
end
|
234
|
+
end
|
220
235
|
end
|
221
236
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coloredcoins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genaro Madrid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|