btcruby 1.1.4 → 1.1.5
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/RELEASE_NOTES.md +7 -0
- data/lib/btcruby.rb +1 -1
- data/lib/btcruby/address.rb +1 -0
- data/lib/btcruby/open_assets/asset_marker.rb +1 -0
- data/lib/btcruby/script/opcode.rb +3 -0
- data/lib/btcruby/script/script.rb +2 -1
- data/lib/btcruby/script/script_chunk.rb +1 -0
- data/lib/btcruby/script/script_error.rb +41 -37
- data/lib/btcruby/script/script_interpreter.rb +2 -0
- data/lib/btcruby/script/script_interpreter_plugin.rb +2 -0
- data/lib/btcruby/transaction_builder.rb +1 -0
- data/lib/btcruby/version.rb +1 -1
- data/spec/address_spec.rb +22 -22
- data/spec/base58_spec.rb +8 -8
- data/spec/block_header_spec.rb +4 -4
- data/spec/block_spec.rb +4 -4
- data/spec/currency_formatter_spec.rb +30 -30
- data/spec/data_spec.rb +3 -3
- data/spec/key_spec.rb +11 -11
- data/spec/keychain_spec.rb +12 -12
- data/spec/merkle_tree_spec.rb +3 -3
- data/spec/open_assets/asset_address_spec.rb +7 -7
- data/spec/open_assets/asset_id_spec.rb +3 -3
- data/spec/open_assets/asset_marker_spec.rb +5 -5
- data/spec/open_assets/asset_processor_spec.rb +48 -48
- data/spec/open_assets/asset_transaction_builder_spec.rb +26 -26
- data/spec/open_assets/asset_transaction_spec.rb +9 -9
- data/spec/open_assets/issuance_id_spec.rb +3 -3
- data/spec/script_interpreter_spec.rb +4 -4
- data/spec/script_spec.rb +23 -23
- data/spec/spec_helper.rb +33 -31
- data/spec/transaction_builder_spec.rb +33 -33
- data/spec/transaction_spec.rb +18 -18
- data/spec/wire_format_spec.rb +5 -5
- metadata +2 -2
@@ -2,7 +2,7 @@ require_relative 'spec_helper'
|
|
2
2
|
describe BTC::TransactionBuilder do
|
3
3
|
|
4
4
|
class SignerByKey
|
5
|
-
include TransactionBuilder::Signer
|
5
|
+
include BTC::TransactionBuilder::Signer
|
6
6
|
def initialize(&block)
|
7
7
|
@block = block
|
8
8
|
end
|
@@ -12,7 +12,7 @@ describe BTC::TransactionBuilder do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
class SignerBySignatureScript
|
15
|
-
include TransactionBuilder::Signer
|
15
|
+
include BTC::TransactionBuilder::Signer
|
16
16
|
def initialize(&block)
|
17
17
|
@block = block
|
18
18
|
end
|
@@ -23,17 +23,17 @@ describe BTC::TransactionBuilder do
|
|
23
23
|
|
24
24
|
describe "TransactionBuilder with no outputs" do
|
25
25
|
before do
|
26
|
-
@builder = TransactionBuilder.new
|
26
|
+
@builder = BTC::TransactionBuilder.new
|
27
27
|
@all_utxos = self.mock_utxos
|
28
28
|
|
29
29
|
@builder.input_addresses = self.mock_addresses
|
30
|
-
@builder.provider = TransactionBuilder::Provider.new do |txb|
|
30
|
+
@builder.provider = BTC::TransactionBuilder::Provider.new do |txb|
|
31
31
|
addrs = txb.public_addresses
|
32
32
|
addrs.must_equal self.mock_addresses
|
33
33
|
scripts = addrs.map{|a| a.script }.uniq
|
34
34
|
@all_utxos.find_all{|utxo| scripts.include?(utxo.script) }
|
35
35
|
end
|
36
|
-
@builder.change_address = Address.parse("1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG")
|
36
|
+
@builder.change_address = BTC::Address.parse("1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG")
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should fill unspent_outputs using Provider" do
|
@@ -41,12 +41,12 @@ describe BTC::TransactionBuilder do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should have a default fee rate" do
|
44
|
-
@builder.fee_rate.must_equal Transaction::DEFAULT_FEE_RATE
|
44
|
+
@builder.fee_rate.must_equal BTC::Transaction::DEFAULT_FEE_RATE
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should return a result" do
|
48
48
|
result = @builder.build
|
49
|
-
result.class.must_equal TransactionBuilder::Result
|
49
|
+
result.class.must_equal BTC::TransactionBuilder::Result
|
50
50
|
end
|
51
51
|
|
52
52
|
it "should compose a fully-spending transaction when no outputs are given" do
|
@@ -64,7 +64,7 @@ describe BTC::TransactionBuilder do
|
|
64
64
|
it "should have a reasonable fee" do
|
65
65
|
result = @builder.build
|
66
66
|
size = result.transaction.data.bytesize # size of unsigned transaction
|
67
|
-
result.fee.must_be :>=, (size / 1000)*Transaction::DEFAULT_FEE_RATE
|
67
|
+
result.fee.must_be :>=, (size / 1000)*BTC::Transaction::DEFAULT_FEE_RATE
|
68
68
|
result.fee.must_be :<, 0.01 * BTC::COIN
|
69
69
|
end
|
70
70
|
|
@@ -111,7 +111,7 @@ describe BTC::TransactionBuilder do
|
|
111
111
|
|
112
112
|
it "should sign if signer provides a signature script" do
|
113
113
|
@builder.signer = SignerBySignatureScript.new do |txin, txout|
|
114
|
-
Script.new << "signature" << "pubkey"
|
114
|
+
BTC::Script.new << "signature" << "pubkey"
|
115
115
|
end
|
116
116
|
result = @builder.build
|
117
117
|
result.unsigned_input_indexes.must_equal []
|
@@ -126,7 +126,7 @@ describe BTC::TransactionBuilder do
|
|
126
126
|
it "should include all prepended unspents AND all normal unspents" do
|
127
127
|
@builder.prepended_unspent_outputs = [ BTC::TransactionOutput.new(
|
128
128
|
value: 6_666_666,
|
129
|
-
script: Address.parse("3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX").script,
|
129
|
+
script: BTC::Address.parse("3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX").script,
|
130
130
|
index: 0,
|
131
131
|
transaction_hash: "some mock tx".hash256
|
132
132
|
) ]
|
@@ -141,18 +141,18 @@ describe BTC::TransactionBuilder do
|
|
141
141
|
|
142
142
|
describe "TransactionBuilder with some outputs" do
|
143
143
|
before do
|
144
|
-
@builder = TransactionBuilder.new
|
144
|
+
@builder = BTC::TransactionBuilder.new
|
145
145
|
@all_utxos = self.mock_utxos
|
146
146
|
@builder.input_addresses = self.mock_addresses
|
147
|
-
@builder.provider = TransactionBuilder::Provider.new do |txb|
|
147
|
+
@builder.provider = BTC::TransactionBuilder::Provider.new do |txb|
|
148
148
|
addrs = txb.public_addresses
|
149
149
|
addrs.must_equal self.mock_addresses
|
150
150
|
scripts = addrs.map{|a| a.script }.uniq
|
151
151
|
@all_utxos.find_all{|utxo| scripts.include?(utxo.script) }
|
152
152
|
end
|
153
|
-
@builder.change_address = Address.parse("1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG")
|
154
|
-
@builder.outputs = [ TransactionOutput.new(value: 1000_500,
|
155
|
-
script: Address.parse("1TipsuQ7CSqfQsjA9KU5jarSB1AnrVLLo").script) ]
|
153
|
+
@builder.change_address = BTC::Address.parse("1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG")
|
154
|
+
@builder.outputs = [ BTC::TransactionOutput.new(value: 1000_500,
|
155
|
+
script: BTC::Address.parse("1TipsuQ7CSqfQsjA9KU5jarSB1AnrVLLo").script) ]
|
156
156
|
end
|
157
157
|
|
158
158
|
it "should fill unspent_outputs using provider" do
|
@@ -160,7 +160,7 @@ describe BTC::TransactionBuilder do
|
|
160
160
|
end
|
161
161
|
|
162
162
|
it "should have a default fee rate" do
|
163
|
-
@builder.fee_rate.must_equal Transaction::DEFAULT_FEE_RATE
|
163
|
+
@builder.fee_rate.must_equal BTC::Transaction::DEFAULT_FEE_RATE
|
164
164
|
end
|
165
165
|
|
166
166
|
it "should compose a minimal transaction to pay necessary amount" do
|
@@ -186,7 +186,7 @@ describe BTC::TransactionBuilder do
|
|
186
186
|
it "should have a reasonable fee" do
|
187
187
|
result = @builder.build
|
188
188
|
size = result.transaction.data.bytesize # size of unsigned transaction
|
189
|
-
result.fee.must_be :>=, (size / 1000)*Transaction::DEFAULT_FEE_RATE
|
189
|
+
result.fee.must_be :>=, (size / 1000)*BTC::Transaction::DEFAULT_FEE_RATE
|
190
190
|
result.fee.must_be :<, 0.01 * BTC::COIN
|
191
191
|
end
|
192
192
|
|
@@ -219,7 +219,7 @@ describe BTC::TransactionBuilder do
|
|
219
219
|
it "should include all prepended unspents and none of normal unspents if amount is covered" do
|
220
220
|
@builder.prepended_unspent_outputs = [ BTC::TransactionOutput.new(
|
221
221
|
value: 6_666_666,
|
222
|
-
script: Address.parse("3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX").script,
|
222
|
+
script: BTC::Address.parse("3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX").script,
|
223
223
|
index: 0,
|
224
224
|
transaction_hash: "some mock tx".hash256
|
225
225
|
) ]
|
@@ -231,7 +231,7 @@ describe BTC::TransactionBuilder do
|
|
231
231
|
it "should include all prepended unspents and just enough of normal unspents" do
|
232
232
|
@builder.prepended_unspent_outputs = [ BTC::TransactionOutput.new(
|
233
233
|
value: @builder.outputs.first.value - (self.mock_utxos.first.value / 2),
|
234
|
-
script: Address.parse("3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX").script,
|
234
|
+
script: BTC::Address.parse("3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX").script,
|
235
235
|
index: 0,
|
236
236
|
transaction_hash: "some mock tx".hash256
|
237
237
|
) ]
|
@@ -243,54 +243,54 @@ describe BTC::TransactionBuilder do
|
|
243
243
|
|
244
244
|
describe "TransactionBuilder edge cases" do
|
245
245
|
before do
|
246
|
-
@builder = TransactionBuilder.new
|
246
|
+
@builder = BTC::TransactionBuilder.new
|
247
247
|
@all_utxos = self.mock_utxos
|
248
248
|
@builder.input_addresses = self.mock_addresses
|
249
|
-
@builder.provider = TransactionBuilder::Provider.new do |txb|
|
249
|
+
@builder.provider = BTC::TransactionBuilder::Provider.new do |txb|
|
250
250
|
addrs = txb.public_addresses
|
251
251
|
addrs.must_equal self.mock_addresses
|
252
252
|
scripts = addrs.map{|a| a.script }.uniq
|
253
253
|
@all_utxos.find_all{|utxo| scripts.include?(utxo.script) }
|
254
254
|
end
|
255
|
-
@builder.change_address = Address.parse("1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG")
|
255
|
+
@builder.change_address = BTC::Address.parse("1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG")
|
256
256
|
end
|
257
257
|
|
258
258
|
it "should detect missing change address" do
|
259
259
|
@builder.change_address = nil
|
260
260
|
lambda do
|
261
261
|
result = @builder.build
|
262
|
-
end.must_raise TransactionBuilder::MissingChangeAddressError
|
262
|
+
end.must_raise BTC::TransactionBuilder::MissingChangeAddressError
|
263
263
|
end
|
264
264
|
|
265
265
|
it "should detect missing unspents" do
|
266
266
|
@builder.provider = nil
|
267
267
|
lambda do
|
268
268
|
result = @builder.build
|
269
|
-
end.must_raise TransactionBuilder::MissingUnspentOutputsError
|
269
|
+
end.must_raise BTC::TransactionBuilder::MissingUnspentOutputsError
|
270
270
|
end
|
271
271
|
|
272
272
|
it "should detect missing unspents" do
|
273
273
|
@builder.unspent_outputs = [ ]
|
274
274
|
lambda do
|
275
275
|
result = @builder.build
|
276
|
-
end.must_raise TransactionBuilder::MissingUnspentOutputsError
|
276
|
+
end.must_raise BTC::TransactionBuilder::MissingUnspentOutputsError
|
277
277
|
end
|
278
278
|
|
279
279
|
it "should detect not enough unspents" do
|
280
|
-
@builder.outputs = [ TransactionOutput.new(value: 100*COIN, script: @builder.change_address.script) ]
|
280
|
+
@builder.outputs = [ BTC::TransactionOutput.new(value: 100*BTC::COIN, script: @builder.change_address.script) ]
|
281
281
|
lambda do
|
282
282
|
result = @builder.build
|
283
|
-
end.must_raise TransactionBuilder::InsufficientFundsError
|
283
|
+
end.must_raise BTC::TransactionBuilder::InsufficientFundsError
|
284
284
|
end
|
285
285
|
|
286
286
|
it "should detect not enough unspents because of change constraints" do
|
287
287
|
@builder.dust_change = 0 # no coins are allowed to be lost
|
288
288
|
@builder.minimum_change = 10000
|
289
289
|
@builder.unspent_outputs = mock_utxos[0, 1]
|
290
|
-
@builder.outputs = [ TransactionOutput.new(value: 1000_00 - @builder.fee_rate - 10, script: @builder.change_address.script) ]
|
290
|
+
@builder.outputs = [ BTC::TransactionOutput.new(value: 1000_00 - @builder.fee_rate - 10, script: @builder.change_address.script) ]
|
291
291
|
lambda do
|
292
292
|
result = @builder.build
|
293
|
-
end.must_raise TransactionBuilder::InsufficientFundsError
|
293
|
+
end.must_raise BTC::TransactionBuilder::InsufficientFundsError
|
294
294
|
end
|
295
295
|
|
296
296
|
it "should forgo change if it's below dust level" do
|
@@ -299,7 +299,7 @@ describe BTC::TransactionBuilder do
|
|
299
299
|
@builder.unspent_outputs = mock_utxos[0, 1]
|
300
300
|
assumed_fee = 2590 #@builder.fee_rate # we assume we'll have sub-1K transaction
|
301
301
|
amount = 1000_00 - assumed_fee - @builder.dust_change
|
302
|
-
@builder.outputs = [ TransactionOutput.new(value: amount, script: @builder.change_address.script) ]
|
302
|
+
@builder.outputs = [ BTC::TransactionOutput.new(value: amount, script: @builder.change_address.script) ]
|
303
303
|
|
304
304
|
result = @builder.build
|
305
305
|
result.fee.must_equal assumed_fee
|
@@ -312,8 +312,8 @@ describe BTC::TransactionBuilder do
|
|
312
312
|
|
313
313
|
def mock_keys
|
314
314
|
@mock_keys ||= [
|
315
|
-
Key.new(private_key: "Wallet1".sha256),
|
316
|
-
Key.new(private_key: "Wallet2".sha256)
|
315
|
+
BTC::Key.new(private_key: "Wallet1".sha256),
|
316
|
+
BTC::Key.new(private_key: "Wallet2".sha256)
|
317
317
|
]
|
318
318
|
end
|
319
319
|
|
@@ -328,7 +328,7 @@ describe BTC::TransactionBuilder do
|
|
328
328
|
def mock_utxos
|
329
329
|
scripts = mock_addresses.map{|a| a.script }
|
330
330
|
(0...32).map do |i|
|
331
|
-
TransactionOutput.new(value: 100_000,
|
331
|
+
BTC::TransactionOutput.new(value: 100_000,
|
332
332
|
script: scripts[i % scripts.size],
|
333
333
|
transaction_hash: ((16+i).to_s(16)*32).from_hex,
|
334
334
|
index: i)
|
data/spec/transaction_spec.rb
CHANGED
@@ -49,17 +49,17 @@ describe BTC::Transaction do
|
|
49
49
|
raise "Bad test: input is an array of 3 items: #{test.inspect}" if input.size != 3
|
50
50
|
previd, previndex, scriptstring = input
|
51
51
|
|
52
|
-
outpoint = Outpoint.new(transaction_id: previd, index: previndex)
|
52
|
+
outpoint = BTC::Outpoint.new(transaction_id: previd, index: previndex)
|
53
53
|
|
54
54
|
mapprevOutScriptPubKeys[outpoint] = parse_script(scriptstring)
|
55
55
|
end
|
56
56
|
|
57
|
-
tx = Transaction.new(hex: test[1])
|
57
|
+
tx = BTC::Transaction.new(hex: test[1])
|
58
58
|
flags = parse_flags(test[2])
|
59
59
|
|
60
60
|
if debug_filter(test)
|
61
61
|
validation_proc = lambda do
|
62
|
-
validation_passed = Validation.new.check_transaction(tx, ValidationState.new)
|
62
|
+
validation_passed = BTC::Validation.new.check_transaction(tx, BTC::ValidationState.new)
|
63
63
|
if expected_result
|
64
64
|
validation_passed.must_equal expected_result
|
65
65
|
end
|
@@ -71,14 +71,14 @@ describe BTC::Transaction do
|
|
71
71
|
raise "Bad test: output script not found: #{test.inspect}" if !output_script
|
72
72
|
sig_script = txin.signature_script
|
73
73
|
if !sig_script
|
74
|
-
sig_script = Script.new(data: txin.coinbase_data)
|
74
|
+
sig_script = BTC::Script.new(data: txin.coinbase_data)
|
75
75
|
end
|
76
76
|
|
77
|
-
checker = TransactionSignatureChecker.new(transaction: tx, input_index: txin.index)
|
77
|
+
checker = BTC::TransactionSignatureChecker.new(transaction: tx, input_index: txin.index)
|
78
78
|
plugins = []
|
79
|
-
plugins << P2SHPlugin.new if (flags & ScriptFlags::SCRIPT_VERIFY_P2SH) != 0
|
80
|
-
plugins << CLTVPlugin.new if (flags & ScriptFlags::SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY) != 0
|
81
|
-
interpreter = ScriptInterpreter.new(
|
79
|
+
plugins << BTC::P2SHPlugin.new if (flags & BTC::ScriptFlags::SCRIPT_VERIFY_P2SH) != 0
|
80
|
+
plugins << BTC::CLTVPlugin.new if (flags & BTC::ScriptFlags::SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY) != 0
|
81
|
+
interpreter = BTC::ScriptInterpreter.new(
|
82
82
|
flags: flags,
|
83
83
|
plugins: plugins,
|
84
84
|
signature_checker: checker,
|
@@ -190,7 +190,7 @@ describe BTC::Transaction do
|
|
190
190
|
end
|
191
191
|
|
192
192
|
it "should convert hash to/from id for TransactionOutput" do
|
193
|
-
txout = TransactionOutput.new
|
193
|
+
txout = BTC::TransactionOutput.new
|
194
194
|
txout.transaction_hash = @txhash
|
195
195
|
txout.transaction_id.must_equal @txid
|
196
196
|
txout.transaction_id = "deadbeef"
|
@@ -201,11 +201,11 @@ describe BTC::Transaction do
|
|
201
201
|
|
202
202
|
describe "Amounts calculation" do
|
203
203
|
before do
|
204
|
-
@tx = Transaction.new
|
205
|
-
@tx.add_input(TransactionInput.new)
|
206
|
-
@tx.add_input(TransactionInput.new)
|
207
|
-
@tx.add_output(TransactionOutput.new(value: 123))
|
208
|
-
@tx.add_output(TransactionOutput.new(value: 50_000))
|
204
|
+
@tx = BTC::Transaction.new
|
205
|
+
@tx.add_input(BTC::TransactionInput.new)
|
206
|
+
@tx.add_input(BTC::TransactionInput.new)
|
207
|
+
@tx.add_output(BTC::TransactionOutput.new(value: 123))
|
208
|
+
@tx.add_output(BTC::TransactionOutput.new(value: 50_000))
|
209
209
|
end
|
210
210
|
|
211
211
|
it "should have good defaults" do
|
@@ -257,8 +257,8 @@ describe BTC::Transaction do
|
|
257
257
|
"2ac0ba2afa7ada4660bd38e27585aac7d4e6e435ffffffff02c0791817000000" +
|
258
258
|
"0017a914bd224370f93a2b0435ded92c7f609e71992008fc87ac7b4d1d000000" +
|
259
259
|
"001976a914450c22770eebb00d376edabe7bb548aa64aa235688ac00000000").from_hex
|
260
|
-
@tx = Transaction.new(hex: @txdata.to_hex)
|
261
|
-
@tx = Transaction.new(data: @txdata)
|
260
|
+
@tx = BTC::Transaction.new(hex: @txdata.to_hex)
|
261
|
+
@tx = BTC::Transaction.new(data: @txdata)
|
262
262
|
end
|
263
263
|
|
264
264
|
it "should decode inputs and outputs correctly" do
|
@@ -291,7 +291,7 @@ describe BTC::Transaction do
|
|
291
291
|
"043304596050ca119efccada1dd7ca8e511a76d8e1ddb7ad050298d208455b8bcd09593d823ca252355bf0b41c2ac0ba2afa7ada4660bd38e27585aac7d4e6e435"
|
292
292
|
]
|
293
293
|
|
294
|
-
Diagnostics.current.trace do
|
294
|
+
BTC::Diagnostics.current.trace do
|
295
295
|
BTC::Key.validate_script_signature(@tx.inputs.first.signature_script.to_a[0], verify_lower_s: true).must_equal true
|
296
296
|
end
|
297
297
|
end
|
@@ -304,7 +304,7 @@ describe BTC::Transaction do
|
|
304
304
|
"0000000000ffffffff130301e6040654188d181202119700de00000fccffffff" +
|
305
305
|
"ff0108230595000000001976a914ca6ecc7d4d671d8c5c964a48dbb0bc194407" +
|
306
306
|
"a30688ac00000000").from_hex
|
307
|
-
@tx = Transaction.new(data: @txdata)
|
307
|
+
@tx = BTC::Transaction.new(data: @txdata)
|
308
308
|
end
|
309
309
|
|
310
310
|
it "should encode coinbase inputs correctly" do
|
data/spec/wire_format_spec.rb
CHANGED
@@ -299,16 +299,16 @@ describe BTC::WireFormat do
|
|
299
299
|
it "should encode/decode varint-prefixed arrays" do
|
300
300
|
|
301
301
|
txs = [
|
302
|
-
Transaction.new,
|
303
|
-
Transaction.new(inputs:[TransactionInput.new]),
|
304
|
-
Transaction.new(outputs:[TransactionOutput.new])
|
302
|
+
BTC::Transaction.new,
|
303
|
+
BTC::Transaction.new(inputs:[BTC::TransactionInput.new]),
|
304
|
+
BTC::Transaction.new(outputs:[BTC::TransactionOutput.new])
|
305
305
|
]
|
306
|
-
data = WireFormat.encode_array(txs) {|t|t.data}
|
306
|
+
data = BTC::WireFormat.encode_array(txs) {|t|t.data}
|
307
307
|
data.bytes[0].must_equal txs.size
|
308
308
|
data.must_equal txs.inject("\x03".b){|d,t| d+t.data}
|
309
309
|
|
310
310
|
stream = StringIO.new(data)
|
311
|
-
txs2 = WireFormat.read_array(stream: stream){ Transaction.new(stream: stream) }
|
311
|
+
txs2 = BTC::WireFormat.read_array(stream: stream){ BTC::Transaction.new(stream: stream) }
|
312
312
|
txs2[0].data.must_equal txs[0].data
|
313
313
|
txs2[1].data.must_equal txs[1].data
|
314
314
|
txs2[2].data.must_equal txs[2].data
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: btcruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Andreev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-08-
|
12
|
+
date: 2015-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|