bitcoin-ruby 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. data/.gitignore +4 -1
  2. data/Gemfile +21 -0
  3. data/README.rdoc +85 -25
  4. data/Rakefile +7 -3
  5. data/bin/bitcoin_node +39 -42
  6. data/bin/bitcoin_shell +1 -0
  7. data/bin/bitcoin_wallet +129 -53
  8. data/bitcoin-ruby.gemspec +4 -7
  9. data/concept-examples/blockchain-pow.rb +1 -1
  10. data/doc/CONFIG.rdoc +5 -5
  11. data/doc/EXAMPLES.rdoc +9 -5
  12. data/doc/NAMECOIN.rdoc +34 -0
  13. data/doc/NODE.rdoc +147 -10
  14. data/examples/balance.rb +10 -4
  15. data/examples/bbe_verify_tx.rb +7 -2
  16. data/examples/forwarder.rb +73 -0
  17. data/examples/generate_tx.rb +34 -0
  18. data/examples/simple_network_monitor_and_util.rb +187 -0
  19. data/examples/verify_tx.rb +1 -1
  20. data/lib/bitcoin.rb +308 -18
  21. data/lib/bitcoin/builder.rb +62 -36
  22. data/lib/bitcoin/config.rb +2 -0
  23. data/lib/bitcoin/connection.rb +11 -8
  24. data/lib/bitcoin/electrum/mnemonic.rb +162 -0
  25. data/lib/bitcoin/ffi/openssl.rb +187 -21
  26. data/lib/bitcoin/gui/addr_view.rb +2 -0
  27. data/lib/bitcoin/gui/conn_view.rb +2 -0
  28. data/lib/bitcoin/gui/connection.rb +2 -0
  29. data/lib/bitcoin/gui/em_gtk.rb +2 -0
  30. data/lib/bitcoin/gui/gui.rb +2 -0
  31. data/lib/bitcoin/gui/helpers.rb +2 -0
  32. data/lib/bitcoin/gui/tree_view.rb +2 -0
  33. data/lib/bitcoin/gui/tx_view.rb +2 -0
  34. data/lib/bitcoin/key.rb +77 -11
  35. data/lib/bitcoin/litecoin.rb +81 -0
  36. data/lib/bitcoin/logger.rb +20 -1
  37. data/lib/bitcoin/namecoin.rb +279 -0
  38. data/lib/bitcoin/network/command_client.rb +7 -6
  39. data/lib/bitcoin/network/command_handler.rb +229 -43
  40. data/lib/bitcoin/network/connection_handler.rb +182 -70
  41. data/lib/bitcoin/network/node.rb +231 -106
  42. data/lib/bitcoin/protocol.rb +44 -23
  43. data/lib/bitcoin/protocol/address.rb +5 -3
  44. data/lib/bitcoin/protocol/alert.rb +3 -4
  45. data/lib/bitcoin/protocol/aux_pow.rb +123 -0
  46. data/lib/bitcoin/protocol/block.rb +98 -18
  47. data/lib/bitcoin/protocol/handler.rb +6 -5
  48. data/lib/bitcoin/protocol/parser.rb +44 -19
  49. data/lib/bitcoin/protocol/tx.rb +105 -52
  50. data/lib/bitcoin/protocol/txin.rb +39 -19
  51. data/lib/bitcoin/protocol/txout.rb +28 -13
  52. data/lib/bitcoin/protocol/version.rb +16 -7
  53. data/lib/bitcoin/script.rb +579 -122
  54. data/lib/bitcoin/storage/{dummy.rb → dummy/dummy_store.rb} +8 -14
  55. data/lib/bitcoin/storage/models.rb +20 -7
  56. data/lib/bitcoin/storage/{sequel_store/sequel_migrations.rb → sequel/migrations.rb} +22 -7
  57. data/lib/bitcoin/storage/sequel/migrations/001_base_schema.rb +52 -0
  58. data/lib/bitcoin/storage/sequel/migrations/002_tx.rb +50 -0
  59. data/lib/bitcoin/storage/sequel/migrations/003_change_txin_script_sig_to_blob.rb +18 -0
  60. data/lib/bitcoin/storage/sequel/sequel_store.rb +436 -0
  61. data/lib/bitcoin/storage/storage.rb +233 -28
  62. data/lib/bitcoin/storage/utxo/migrations/001_base_schema.rb +52 -0
  63. data/lib/bitcoin/storage/utxo/migrations/002_utxo.rb +18 -0
  64. data/lib/bitcoin/storage/utxo/utxo_store.rb +361 -0
  65. data/lib/bitcoin/validation.rb +369 -0
  66. data/lib/bitcoin/version.rb +1 -1
  67. data/lib/bitcoin/wallet/coinselector.rb +3 -0
  68. data/lib/bitcoin/wallet/keygenerator.rb +3 -1
  69. data/lib/bitcoin/wallet/keystore.rb +6 -2
  70. data/lib/bitcoin/wallet/txdp.rb +6 -4
  71. data/lib/bitcoin/wallet/wallet.rb +54 -16
  72. data/spec/bitcoin/bitcoin_spec.rb +48 -3
  73. data/spec/bitcoin/builder_spec.rb +40 -17
  74. data/spec/bitcoin/fixtures/000000000000056b1a3d84a1e2b33cde8915a4b61c0cae14fca6d3e1490b4f98.json +3697 -0
  75. data/spec/bitcoin/fixtures/03d7e1fa4d5fefa169431f24f7798552861b255cd55d377066fedcd088fb0e99.json +23 -0
  76. data/spec/bitcoin/fixtures/0961c660358478829505e16a1f028757e54b5bbf9758341a7546573738f31429.json +24 -0
  77. data/spec/bitcoin/fixtures/0f24294a1d23efbb49c1765cf443fba7930702752aba6d765870082fe4f13cae.json +37 -0
  78. data/spec/bitcoin/fixtures/315ac7d4c26d69668129cc352851d9389b4a6868f1509c6c8b66bead11e2619f.json +31 -0
  79. data/spec/bitcoin/fixtures/35e2001b428891fefa0bfb73167c7360669d3cbd7b3aa78e7cad125ddfc51131.json +27 -0
  80. data/spec/bitcoin/fixtures/3a17dace09ffb919ed627a93f1873220f4c975c1248558b18d16bce25d38c4b7.json +72 -0
  81. data/spec/bitcoin/fixtures/3e58b7eed0fdb599019af08578effea25c8666bbe8e200845453cacce6314477.json +27 -0
  82. data/spec/bitcoin/fixtures/514c46f0b61714092f15c8dfcb576c9f79b3f959989b98de3944b19d98832b58.json +24 -0
  83. data/spec/bitcoin/fixtures/51bf528ecf3c161e7c021224197dbe84f9a8564212f6207baa014c01a1668e1e.json +30 -0
  84. data/spec/bitcoin/fixtures/69216b8aaa35b76d6613e5f527f4858640d986e1046238583bdad79b35e938dc.json +28 -0
  85. data/spec/bitcoin/fixtures/7208e5edf525f04e705fb3390194e316205b8f995c8c9fcd8c6093abe04fa27d.json +27 -0
  86. data/spec/bitcoin/fixtures/761d8c5210fdfd505f6dff38f740ae3728eb93d7d0971fb433f685d40a4c04f6.json +27 -0
  87. data/spec/bitcoin/fixtures/aea682d68a3ea5e3583e088dcbd699a5d44d4b083f02ad0aaf2598fe1fa4dfd4.json +27 -0
  88. data/spec/bitcoin/fixtures/bd1715f1abfdc62bea3f605bdb461b3ba1f2cca6ec0d73a18a548b7717ca8531.json +34 -0
  89. data/spec/bitcoin/fixtures/block-testnet-0000000000ac85bb2530a05a4214a387e6be02b22d3348abc5e7a5d9c4ce8dab.bin +0 -0
  90. data/spec/bitcoin/fixtures/cd874fa8cb0e2ec2d385735d5e1fd482c4fe648533efb4c50ee53bda58e15ae2.json +24 -0
  91. data/spec/bitcoin/fixtures/ce5fad9b4ef094d8f4937b0707edaf0a6e6ceeaf67d5edbfd51f660eac8f398b.json +41 -0
  92. data/spec/bitcoin/fixtures/f003f0c1193019db2497a675fd05d9f2edddf9b67c59e677c48d3dbd4ed5f00b.json +23 -0
  93. data/spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.bin +0 -0
  94. data/spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.json +43 -0
  95. data/spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.bin +0 -0
  96. data/spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.json +67 -0
  97. data/spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.bin +0 -0
  98. data/spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.json +39 -0
  99. data/spec/bitcoin/fixtures/litecoin-genesis-block-12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2.bin +0 -0
  100. data/spec/bitcoin/fixtures/litecoin-genesis-block-12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2.json +39 -0
  101. data/spec/bitcoin/fixtures/rawblock-auxpow.bin +0 -0
  102. data/spec/bitcoin/fixtures/tx-313897799b1e37e9ecae15010e56156dddde4e683c96b0e713af95272c38aee0.json +30 -0
  103. data/spec/bitcoin/fixtures/tx-3da75972766f0ad13319b0b461fd16823a731e44f6e9de4eb3c52d6a6fb6c8ae.json +23 -0
  104. data/spec/bitcoin/fixtures/tx-44b833074e671120ba33106877b49e86ece510824b9af477a3853972bcd8d06a.json +30 -0
  105. data/spec/bitcoin/fixtures/tx-d3d77d63709e47d9ef58f0b557800115a6b676c6a423012fbb96f45d8fcef830.json +28 -0
  106. data/spec/bitcoin/key_spec.rb +128 -3
  107. data/spec/bitcoin/namecoin_spec.rb +182 -0
  108. data/spec/bitcoin/network_spec.rb +5 -3
  109. data/spec/bitcoin/node/command_api_spec.rb +376 -0
  110. data/spec/bitcoin/protocol/addr_spec.rb +2 -0
  111. data/spec/bitcoin/protocol/alert_spec.rb +2 -0
  112. data/spec/bitcoin/protocol/aux_pow_spec.rb +44 -0
  113. data/spec/bitcoin/protocol/block_spec.rb +134 -39
  114. data/spec/bitcoin/protocol/getblocks_spec.rb +32 -0
  115. data/spec/bitcoin/protocol/inv_spec.rb +10 -8
  116. data/spec/bitcoin/protocol/notfound_spec.rb +31 -0
  117. data/spec/bitcoin/protocol/ping_spec.rb +2 -0
  118. data/spec/bitcoin/protocol/tx_spec.rb +83 -17
  119. data/spec/bitcoin/protocol/version_spec.rb +7 -5
  120. data/spec/bitcoin/script/opcodes_spec.rb +412 -133
  121. data/spec/bitcoin/script/script_spec.rb +112 -13
  122. data/spec/bitcoin/spec_helper.rb +68 -0
  123. data/spec/bitcoin/storage/reorg_spec.rb +199 -0
  124. data/spec/bitcoin/storage/storage_spec.rb +337 -0
  125. data/spec/bitcoin/storage/validation_spec.rb +261 -0
  126. data/spec/bitcoin/wallet/coinselector_spec.rb +10 -7
  127. data/spec/bitcoin/wallet/keygenerator_spec.rb +2 -0
  128. data/spec/bitcoin/wallet/keystore_spec.rb +2 -0
  129. data/spec/bitcoin/wallet/txdp_spec.rb +2 -0
  130. data/spec/bitcoin/wallet/wallet_spec.rb +91 -58
  131. metadata +105 -51
  132. data/lib/bitcoin/storage/sequel.rb +0 -335
  133. data/spec/bitcoin/fixtures/0d0affb5964abe804ffe85e53f1dbb9f29e406aa3046e2db04fba240e63c7fdd.json +0 -27
  134. data/spec/bitcoin/fixtures/477fff140b363ec2cc51f3a65c0c58eda38f4d41f04a295bbd62babf25e4c590.json +0 -27
  135. data/spec/bitcoin/reorg_spec.rb +0 -129
  136. data/spec/bitcoin/storage_spec.rb +0 -229
@@ -1,3 +1,5 @@
1
+ # encoding: ascii-8bit
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
  include MiniTest
@@ -6,13 +8,14 @@ include Bitcoin::Wallet
6
8
  describe Bitcoin::Wallet::SimpleCoinSelector do
7
9
 
8
10
  def txout_mock(value, next_in = true, in_block = true)
9
- tx = Mock.new
10
- tx.expect(:get_block, in_block)
11
- txout = Mock.new
12
- txout.expect(:value, value)
13
- txout.expect(:get_next_in, next_in)
14
- txout.expect(:get_address, "addr")
15
- txout.expect(:get_tx, tx)
11
+ tx, txout = Mock.new, Mock.new
12
+ 2.times { tx.expect(:get_block, in_block) }
13
+ 5.times { txout.expect(:value, value) }
14
+ 2.times do
15
+ txout.expect(:get_next_in, next_in)
16
+ txout.expect(:get_address, "addr")
17
+ txout.expect(:get_tx, tx)
18
+ end
16
19
  txout
17
20
  end
18
21
 
@@ -1,3 +1,5 @@
1
+ # encoding: ascii-8bit
2
+
1
3
  require_relative '../spec_helper'
2
4
 
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: ascii-8bit
2
+
1
3
  require_relative '../spec_helper'
2
4
  require 'json'
3
5
  require 'fileutils'
@@ -1,3 +1,5 @@
1
+ # encoding: ascii-8bit
2
+
1
3
  require_relative '../spec_helper'
2
4
  include Bitcoin
3
5
  include Bitcoin::Wallet
@@ -1,3 +1,5 @@
1
+ # encoding: ascii-8bit
2
+
1
3
  require_relative '../spec_helper'
2
4
  require 'json'
3
5
  require 'fileutils'
@@ -6,12 +8,11 @@ include Bitcoin
6
8
  include Bitcoin::Wallet
7
9
 
8
10
  def txout_mock(value, next_in = true, in_block = true)
9
- tx = Mock.new
11
+ tx, txout = Mock.new, Mock.new
10
12
  tx.expect(:get_block, in_block)
11
- txout = Mock.new
12
- txout.expect(:value, value)
13
- txout.expect(:get_next_in, next_in)
14
- txout.expect(:hash, [value, next_in].hash)
13
+ 4.times { txout.expect(:value, value) }
14
+ 2.times { txout.expect(:get_next_in, next_in) }
15
+ 6.times { txout.expect(:hash, [value, next_in].hash) }
15
16
  txout.expect(:eql?, false, [1])
16
17
  txout.expect(:==, false, [1])
17
18
  txout.expect(:get_tx, tx)
@@ -22,11 +23,11 @@ describe Bitcoin::Wallet::Wallet do
22
23
  class DummyKeyStore
23
24
 
24
25
  def initialize keys
25
- @keys = keys.map{|k|{:key => k}}
26
+ @keys = keys.map{|k| { key: k, addr: k.addr } }
26
27
  end
27
28
 
28
29
  def key(addr)
29
- @keys.select{|k|k[:key].addr==addr}.first
30
+ @keys.select{|k| k[:key].addr == addr }.first
30
31
  end
31
32
 
32
33
  def keys
@@ -35,13 +36,11 @@ describe Bitcoin::Wallet::Wallet do
35
36
 
36
37
  def new_key
37
38
  k=Bitcoin::Key.generate
38
- @keys << {:key => k}
39
+ @keys << { key: k, addr: k.addr}
39
40
  @keys[-1]
40
41
  end
41
42
  end
42
43
 
43
-
44
-
45
44
  before do
46
45
  Bitcoin.network = :bitcoin
47
46
  @storage = Mock.new
@@ -51,6 +50,11 @@ describe Bitcoin::Wallet::Wallet do
51
50
  @addr2 = '134A4Bi8jN5V2KjkwmXUHjokDqdyqZ778J'
52
51
  @key3 = Key.from_base58('5JFcJByQvwYnWjQ2RHTTu6LLGiBj9oPQYsHqKWuKLDVAvv4cQ7E')
53
52
  @addr3 = '1EnrPVaRiRgrs1D7pujYZNN1N6iD9unZV6'
53
+
54
+ @storage.expect(:add_watched_address, [], [@addr])
55
+ @storage.expect(:add_watched_address, [], [@addr2])
56
+ @storage.expect(:add_watched_address, [], [@addr3])
57
+
54
58
  keystore_data = [{:addr => @key.addr, :priv => @key.priv, :pub => @key.pub}]
55
59
  file_stub = StringIO.new
56
60
  file_stub.write(keystore_data.to_json); file_stub.rewind
@@ -60,7 +64,9 @@ describe Bitcoin::Wallet::Wallet do
60
64
  end
61
65
 
62
66
  it "should get total balance" do
67
+ @storage.expect(:class, Bitcoin::Storage::Backends::SequelStore, [])
63
68
  @storage.expect(:get_txouts_for_address, [], [@addr])
69
+ 2.times { @storage.expect(:class, Bitcoin::Storage::Backends::SequelStore, []) }
64
70
  @wallet.get_balance.should == 0
65
71
 
66
72
  @storage.expect(:get_txouts_for_address, [txout_mock(5000, nil)], [@addr])
@@ -69,7 +75,6 @@ describe Bitcoin::Wallet::Wallet do
69
75
  @storage.expect(:get_txouts_for_address, [txout_mock(5000, true), txout_mock(1000, nil)],
70
76
  [@addr])
71
77
  @wallet.get_balance.should == 1000
72
- @storage.verify
73
78
  end
74
79
 
75
80
  it "should get all addrs" do
@@ -93,34 +98,32 @@ describe Bitcoin::Wallet::Wallet do
93
98
  list.size.should == 2
94
99
  list[0][:addr].should == @addr
95
100
  list[1].should == 5000
96
- @storage.verify
97
101
  end
98
102
 
99
- it "should create new addr" do
100
- @wallet.addrs.size.should == 1
103
+ # it "should create new addr" do
104
+ # @wallet.addrs.size.should == 1
101
105
 
102
- key = Key.generate
103
- a = @wallet.get_new_addr
104
- @wallet.addrs.size.should == 2
105
- @wallet.addrs[1].should == a
106
- end
106
+ # key = Key.generate
107
+ # a = @wallet.get_new_addr
108
+ # @wallet.addrs.size.should == 2
109
+ # @wallet.addrs[1].should == a
110
+ # end
107
111
 
108
112
  describe "Bitcoin::Wallet::Wallet#tx" do
109
113
 
110
114
  before do
111
115
  txout = txout_mock(5000, nil)
112
116
  tx = Mock.new
113
- tx.expect(:binary_hash, "foo")
114
- tx.expect(:out, [txout])
115
- tx.expect(:get_block, true)
116
- txout.expect(:get_tx, tx)
117
- txout.expect(:get_address, @addr)
118
- txout.expect(:pk_script,
119
- Script.to_address_script(@addr))
120
- @storage.expect(:get_txouts_for_address, [txout], [@addr])
121
- selector = Mock.new
122
- selector.expect(:select, [txout], [[txout]])
123
- @selector.expect(:new, selector, [[txout]])
117
+ 2.times { tx.expect(:binary_hash, "foo") }
118
+ 8.times { tx.expect(:out, [txout]) }
119
+ 3.times { tx.expect(:get_block, true) }
120
+ 5.times { txout.expect(:get_tx, tx) }
121
+ 6.times { txout.expect(:get_address, @addr) }
122
+ 8.times { txout.expect(:pk_script, Script.to_address_script(@addr)) }
123
+ 2.times { @storage.expect(:get_txouts_for_address, [txout], [@addr]) }
124
+ 2.times { @storage.expect(:class, Bitcoin::Storage::Backends::SequelStore, []) }
125
+ selector = Bitcoin::Wallet::SimpleCoinSelector.new([txout])
126
+ 2.times { @selector.expect(:new, selector, [[txout]]) }
124
127
  @tx = @wallet.new_tx([[:address, '1M2JjkX7KAgwMyyF5xc2sPSfE7mL1jqkE7', 1000]])
125
128
  end
126
129
 
@@ -166,42 +169,72 @@ describe Bitcoin::Wallet::Wallet do
166
169
  Script.new(@tx.out.last.pk_script).get_address.should == @wallet.addrs.last
167
170
  end
168
171
 
169
- it "should return nil if insufficient balance" do
170
- @tx = @wallet.new_tx([[:address, '1M2JjkX7KAgwMyyF5xc2sPSfE7mL1jqkE7', 7000]])
171
- @tx.should == nil
172
+ it "should raise exception if insufficient balance" do
173
+ -> {@tx = @wallet.new_tx([[:address, '1M2JjkX7KAgwMyyF5xc2sPSfE7mL1jqkE7', 7000]])}
174
+ .should.raise(RuntimeError).message.should == "Insufficient funds."
172
175
  end
173
176
 
174
- end
175
177
 
176
- describe "Bitcoin::Wallet::Wallet#tx (multisig)" do
178
+ it "should create unsigned tx" do
179
+ Bitcoin.network = :spec
180
+ @key = Bitcoin::Key.generate
181
+ @key2 = Bitcoin::Key.generate
182
+ @store = Storage.sequel(db: "sqlite:/")
183
+ @store.log.level = :debug
177
184
 
185
+ @keystore = SimpleKeyStore.new(file: StringIO.new("[]"))
186
+ @wallet = Wallet.new(@store, @keystore, SimpleCoinSelector)
178
187
 
179
- before do
180
- txout = txout_mock(5000, nil)
181
- tx = Mock.new
182
- tx.expect(:binary_hash, "foo")
183
- tx.expect(:out, [txout])
184
- tx.expect(:get_block, true)
185
- txout.expect(:get_tx, tx)
186
- txout.expect(:get_address, @addr)
187
- txout.expect(:pk_script, Script.to_address_script(@addr))
188
- @storage.expect(:get_txouts_for_address, [txout], [@addr])
189
- @keystore = DummyKeyStore.new([@key, @key2, @key3])
190
-
191
- selector = Mock.new
192
- selector.expect(:select, [txout], [1000])
193
- @selector.expect(:new, selector, [[txout]])
194
- @wallet = Wallet.new(@storage, @keystore, @selector)
195
- @tx = @wallet.new_tx([[:multisig, 1, @key2.pub, @key3.pub, 1000]])
196
- end
188
+ @wallet.keystore.add_key(addr: @key.addr)
197
189
 
198
- it "should have correct outputs" do
199
- @tx.out.size.should == 2
200
- @tx.out.first.value.should == 1000
201
- s = Script.new(@tx.out.first.pk_script)
202
- s.get_addresses.should == [@addr2, @addr3]
190
+ @genesis = Bitcoin::P::Block.new("0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4adae5494dffff001d1aa4ae180101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000".htb)
191
+
192
+ @store.new_block @genesis
193
+ create_block(@genesis.hash, true, [], @key, 50e8)
194
+
195
+ list = @wallet.list
196
+ list.size.should == 1
197
+ list[0][0].should == {addr: @key.addr}
198
+ list[0][1].should == 50e8
199
+
200
+ tx = @wallet.new_tx([[:address, @key2.addr, 10e8]])
201
+ tx.in[0].sig_hash.should != nil
203
202
  end
204
203
 
205
204
  end
206
205
 
206
+ # TODO
207
+ # describe "Bitcoin::Wallet::Wallet#tx (multisig)" do
208
+
209
+
210
+ # before do
211
+ # txout = txout_mock(5000, nil)
212
+ # tx = Mock.new
213
+ # tx.expect(:binary_hash, "foo")
214
+ # 4.times { tx.expect(:out, [txout]) }
215
+ # tx.expect(:get_block, true)
216
+ # txout.expect(:get_tx, tx)
217
+ # 2.times { txout.expect(:get_address, @addr) }
218
+ # 4.times { txout.expect(:pk_script, Script.to_address_script(@addr)) }
219
+ # @storage.expect(:get_txouts_for_address, [txout], [@key.addr])
220
+ # @storage.expect(:get_txouts_for_address, [txout], [@key2.addr])
221
+ # @storage.expect(:get_txouts_for_address, [txout], [@key3.addr])
222
+ # @storage.expect(:class, Bitcoin::Storage::Backends::SequelStore, [])
223
+ # @keystore = DummyKeyStore.new([@key, @key2, @key3])
224
+ # selector = Mock.new
225
+ # selector.expect(:select, [txout], [1000])
226
+ # @selector.expect(:new, selector, [[txout]])
227
+ # @wallet = Wallet.new(@storage, @keystore, @selector)
228
+ # @tx = @wallet.new_tx([[:multisig, 1, @key2.pub, @key3.pub, 1000]])
229
+ # end
230
+
231
+ # it "should have correct outputs" do
232
+ # @tx.out.size.should == 2
233
+ # @tx.out.first.value.should == 1000
234
+ # s = Script.new(@tx.out.first.pk_script)
235
+ # s.get_addresses.should == [@addr2, @addr3]
236
+ # end
237
+
238
+ # end
239
+
207
240
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitcoin-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,42 +9,9 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-14 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rake
16
- requirement: &70309726853100 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 0.8.0
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *70309726853100
25
- - !ruby/object:Gem::Dependency
26
- name: eventmachine
27
- requirement: &70309726850420 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: *70309726850420
36
- - !ruby/object:Gem::Dependency
37
- name: bacon
38
- requirement: &70309726849340 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
44
- type: :development
45
- prerelease: false
46
- version_requirements: *70309726849340
47
- description: Gem for working with Bitcoin network
12
+ date: 2013-11-04 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: This is a ruby library for interacting with the bitcoin protocol/network
48
15
  email:
49
16
  - meta.rb@gmail.com
50
17
  executables:
@@ -70,18 +37,23 @@ files:
70
37
  - concept-examples/blockchain-pow.rb
71
38
  - doc/CONFIG.rdoc
72
39
  - doc/EXAMPLES.rdoc
40
+ - doc/NAMECOIN.rdoc
73
41
  - doc/NODE.rdoc
74
42
  - doc/STORAGE.rdoc
75
43
  - doc/WALLET.rdoc
76
44
  - examples/balance.rb
77
45
  - examples/bbe_verify_tx.rb
78
46
  - examples/connect.rb
47
+ - examples/forwarder.rb
48
+ - examples/generate_tx.rb
79
49
  - examples/relay_tx.rb
50
+ - examples/simple_network_monitor_and_util.rb
80
51
  - examples/verify_tx.rb
81
52
  - lib/bitcoin.rb
82
53
  - lib/bitcoin/builder.rb
83
54
  - lib/bitcoin/config.rb
84
55
  - lib/bitcoin/connection.rb
56
+ - lib/bitcoin/electrum/mnemonic.rb
85
57
  - lib/bitcoin/ffi/openssl.rb
86
58
  - lib/bitcoin/gui/addr_view.rb
87
59
  - lib/bitcoin/gui/bitcoin-ruby.png
@@ -95,7 +67,9 @@ files:
95
67
  - lib/bitcoin/gui/tree_view.rb
96
68
  - lib/bitcoin/gui/tx_view.rb
97
69
  - lib/bitcoin/key.rb
70
+ - lib/bitcoin/litecoin.rb
98
71
  - lib/bitcoin/logger.rb
72
+ - lib/bitcoin/namecoin.rb
99
73
  - lib/bitcoin/network/command_client.rb
100
74
  - lib/bitcoin/network/command_handler.rb
101
75
  - lib/bitcoin/network/connection_handler.rb
@@ -103,6 +77,7 @@ files:
103
77
  - lib/bitcoin/protocol.rb
104
78
  - lib/bitcoin/protocol/address.rb
105
79
  - lib/bitcoin/protocol/alert.rb
80
+ - lib/bitcoin/protocol/aux_pow.rb
106
81
  - lib/bitcoin/protocol/block.rb
107
82
  - lib/bitcoin/protocol/handler.rb
108
83
  - lib/bitcoin/protocol/parser.rb
@@ -111,11 +86,18 @@ files:
111
86
  - lib/bitcoin/protocol/txout.rb
112
87
  - lib/bitcoin/protocol/version.rb
113
88
  - lib/bitcoin/script.rb
114
- - lib/bitcoin/storage/dummy.rb
89
+ - lib/bitcoin/storage/dummy/dummy_store.rb
115
90
  - lib/bitcoin/storage/models.rb
116
- - lib/bitcoin/storage/sequel.rb
117
- - lib/bitcoin/storage/sequel_store/sequel_migrations.rb
91
+ - lib/bitcoin/storage/sequel/migrations.rb
92
+ - lib/bitcoin/storage/sequel/migrations/001_base_schema.rb
93
+ - lib/bitcoin/storage/sequel/migrations/002_tx.rb
94
+ - lib/bitcoin/storage/sequel/migrations/003_change_txin_script_sig_to_blob.rb
95
+ - lib/bitcoin/storage/sequel/sequel_store.rb
118
96
  - lib/bitcoin/storage/storage.rb
97
+ - lib/bitcoin/storage/utxo/migrations/001_base_schema.rb
98
+ - lib/bitcoin/storage/utxo/migrations/002_utxo.rb
99
+ - lib/bitcoin/storage/utxo/utxo_store.rb
100
+ - lib/bitcoin/validation.rb
119
101
  - lib/bitcoin/version.rb
120
102
  - lib/bitcoin/wallet/coinselector.rb
121
103
  - lib/bitcoin/wallet/keygenerator.rb
@@ -124,11 +106,36 @@ files:
124
106
  - lib/bitcoin/wallet/wallet.rb
125
107
  - spec/bitcoin/bitcoin_spec.rb
126
108
  - spec/bitcoin/builder_spec.rb
127
- - spec/bitcoin/fixtures/0d0affb5964abe804ffe85e53f1dbb9f29e406aa3046e2db04fba240e63c7fdd.json
109
+ - spec/bitcoin/fixtures/000000000000056b1a3d84a1e2b33cde8915a4b61c0cae14fca6d3e1490b4f98.json
110
+ - spec/bitcoin/fixtures/03d7e1fa4d5fefa169431f24f7798552861b255cd55d377066fedcd088fb0e99.json
111
+ - spec/bitcoin/fixtures/0961c660358478829505e16a1f028757e54b5bbf9758341a7546573738f31429.json
112
+ - spec/bitcoin/fixtures/0f24294a1d23efbb49c1765cf443fba7930702752aba6d765870082fe4f13cae.json
128
113
  - spec/bitcoin/fixtures/23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63.json
129
- - spec/bitcoin/fixtures/477fff140b363ec2cc51f3a65c0c58eda38f4d41f04a295bbd62babf25e4c590.json
114
+ - spec/bitcoin/fixtures/315ac7d4c26d69668129cc352851d9389b4a6868f1509c6c8b66bead11e2619f.json
115
+ - spec/bitcoin/fixtures/35e2001b428891fefa0bfb73167c7360669d3cbd7b3aa78e7cad125ddfc51131.json
116
+ - spec/bitcoin/fixtures/3a17dace09ffb919ed627a93f1873220f4c975c1248558b18d16bce25d38c4b7.json
117
+ - spec/bitcoin/fixtures/3e58b7eed0fdb599019af08578effea25c8666bbe8e200845453cacce6314477.json
118
+ - spec/bitcoin/fixtures/514c46f0b61714092f15c8dfcb576c9f79b3f959989b98de3944b19d98832b58.json
119
+ - spec/bitcoin/fixtures/51bf528ecf3c161e7c021224197dbe84f9a8564212f6207baa014c01a1668e1e.json
130
120
  - spec/bitcoin/fixtures/60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1.json
121
+ - spec/bitcoin/fixtures/69216b8aaa35b76d6613e5f527f4858640d986e1046238583bdad79b35e938dc.json
122
+ - spec/bitcoin/fixtures/7208e5edf525f04e705fb3390194e316205b8f995c8c9fcd8c6093abe04fa27d.json
123
+ - spec/bitcoin/fixtures/761d8c5210fdfd505f6dff38f740ae3728eb93d7d0971fb433f685d40a4c04f6.json
124
+ - spec/bitcoin/fixtures/aea682d68a3ea5e3583e088dcbd699a5d44d4b083f02ad0aaf2598fe1fa4dfd4.json
131
125
  - spec/bitcoin/fixtures/bc179baab547b7d7c1d5d8d6f8b0cc6318eaa4b0dd0a093ad6ac7f5a1cb6b3ba.json
126
+ - spec/bitcoin/fixtures/bd1715f1abfdc62bea3f605bdb461b3ba1f2cca6ec0d73a18a548b7717ca8531.json
127
+ - spec/bitcoin/fixtures/block-testnet-0000000000ac85bb2530a05a4214a387e6be02b22d3348abc5e7a5d9c4ce8dab.bin
128
+ - spec/bitcoin/fixtures/cd874fa8cb0e2ec2d385735d5e1fd482c4fe648533efb4c50ee53bda58e15ae2.json
129
+ - spec/bitcoin/fixtures/ce5fad9b4ef094d8f4937b0707edaf0a6e6ceeaf67d5edbfd51f660eac8f398b.json
130
+ - spec/bitcoin/fixtures/f003f0c1193019db2497a675fd05d9f2edddf9b67c59e677c48d3dbd4ed5f00b.json
131
+ - spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.bin
132
+ - spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.json
133
+ - spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.bin
134
+ - spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.json
135
+ - spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.bin
136
+ - spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.json
137
+ - spec/bitcoin/fixtures/litecoin-genesis-block-12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2.bin
138
+ - spec/bitcoin/fixtures/litecoin-genesis-block-12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2.json
132
139
  - spec/bitcoin/fixtures/rawblock-0.bin
133
140
  - spec/bitcoin/fixtures/rawblock-0.json
134
141
  - spec/bitcoin/fixtures/rawblock-1.bin
@@ -139,6 +146,7 @@ files:
139
146
  - spec/bitcoin/fixtures/rawblock-170.json
140
147
  - spec/bitcoin/fixtures/rawblock-9.bin
141
148
  - spec/bitcoin/fixtures/rawblock-9.json
149
+ - spec/bitcoin/fixtures/rawblock-auxpow.bin
142
150
  - spec/bitcoin/fixtures/rawblock-testnet-26478.bin
143
151
  - spec/bitcoin/fixtures/rawblock-testnet-26478.json
144
152
  - spec/bitcoin/fixtures/rawtx-01.bin
@@ -173,29 +181,39 @@ files:
173
181
  - spec/bitcoin/fixtures/testnet/block_3.bin
174
182
  - spec/bitcoin/fixtures/testnet/block_4.bin
175
183
  - spec/bitcoin/fixtures/testnet/block_5.bin
184
+ - spec/bitcoin/fixtures/tx-313897799b1e37e9ecae15010e56156dddde4e683c96b0e713af95272c38aee0.json
185
+ - spec/bitcoin/fixtures/tx-3da75972766f0ad13319b0b461fd16823a731e44f6e9de4eb3c52d6a6fb6c8ae.json
186
+ - spec/bitcoin/fixtures/tx-44b833074e671120ba33106877b49e86ece510824b9af477a3853972bcd8d06a.json
187
+ - spec/bitcoin/fixtures/tx-d3d77d63709e47d9ef58f0b557800115a6b676c6a423012fbb96f45d8fcef830.json
176
188
  - spec/bitcoin/fixtures/txdp-1.txt
177
189
  - spec/bitcoin/fixtures/txdp-2-signed.txt
178
190
  - spec/bitcoin/fixtures/txdp-2-unsigned.txt
179
191
  - spec/bitcoin/key_spec.rb
192
+ - spec/bitcoin/namecoin_spec.rb
180
193
  - spec/bitcoin/network_spec.rb
194
+ - spec/bitcoin/node/command_api_spec.rb
181
195
  - spec/bitcoin/protocol/addr_spec.rb
182
196
  - spec/bitcoin/protocol/alert_spec.rb
197
+ - spec/bitcoin/protocol/aux_pow_spec.rb
183
198
  - spec/bitcoin/protocol/block_spec.rb
199
+ - spec/bitcoin/protocol/getblocks_spec.rb
184
200
  - spec/bitcoin/protocol/inv_spec.rb
201
+ - spec/bitcoin/protocol/notfound_spec.rb
185
202
  - spec/bitcoin/protocol/ping_spec.rb
186
203
  - spec/bitcoin/protocol/tx_spec.rb
187
204
  - spec/bitcoin/protocol/version_spec.rb
188
- - spec/bitcoin/reorg_spec.rb
189
205
  - spec/bitcoin/script/opcodes_spec.rb
190
206
  - spec/bitcoin/script/script_spec.rb
191
207
  - spec/bitcoin/spec_helper.rb
192
- - spec/bitcoin/storage_spec.rb
208
+ - spec/bitcoin/storage/reorg_spec.rb
209
+ - spec/bitcoin/storage/storage_spec.rb
210
+ - spec/bitcoin/storage/validation_spec.rb
193
211
  - spec/bitcoin/wallet/coinselector_spec.rb
194
212
  - spec/bitcoin/wallet/keygenerator_spec.rb
195
213
  - spec/bitcoin/wallet/keystore_spec.rb
196
214
  - spec/bitcoin/wallet/txdp_spec.rb
197
215
  - spec/bitcoin/wallet/wallet_spec.rb
198
- homepage: ''
216
+ homepage: https://github.com/lian/bitcoin-ruby
199
217
  licenses: []
200
218
  post_install_message:
201
219
  rdoc_options: []
@@ -215,18 +233,43 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
233
  version: 1.3.6
216
234
  requirements: []
217
235
  rubyforge_project: bitcoin-ruby
218
- rubygems_version: 1.8.10
236
+ rubygems_version: 1.8.23
219
237
  signing_key:
220
238
  specification_version: 3
221
- summary: Gem for working with Bitcoin network
239
+ summary: bitcoin utils and protocol in ruby
222
240
  test_files:
223
241
  - spec/bitcoin/bitcoin_spec.rb
224
242
  - spec/bitcoin/builder_spec.rb
225
- - spec/bitcoin/fixtures/0d0affb5964abe804ffe85e53f1dbb9f29e406aa3046e2db04fba240e63c7fdd.json
243
+ - spec/bitcoin/fixtures/000000000000056b1a3d84a1e2b33cde8915a4b61c0cae14fca6d3e1490b4f98.json
244
+ - spec/bitcoin/fixtures/03d7e1fa4d5fefa169431f24f7798552861b255cd55d377066fedcd088fb0e99.json
245
+ - spec/bitcoin/fixtures/0961c660358478829505e16a1f028757e54b5bbf9758341a7546573738f31429.json
246
+ - spec/bitcoin/fixtures/0f24294a1d23efbb49c1765cf443fba7930702752aba6d765870082fe4f13cae.json
226
247
  - spec/bitcoin/fixtures/23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63.json
227
- - spec/bitcoin/fixtures/477fff140b363ec2cc51f3a65c0c58eda38f4d41f04a295bbd62babf25e4c590.json
248
+ - spec/bitcoin/fixtures/315ac7d4c26d69668129cc352851d9389b4a6868f1509c6c8b66bead11e2619f.json
249
+ - spec/bitcoin/fixtures/35e2001b428891fefa0bfb73167c7360669d3cbd7b3aa78e7cad125ddfc51131.json
250
+ - spec/bitcoin/fixtures/3a17dace09ffb919ed627a93f1873220f4c975c1248558b18d16bce25d38c4b7.json
251
+ - spec/bitcoin/fixtures/3e58b7eed0fdb599019af08578effea25c8666bbe8e200845453cacce6314477.json
252
+ - spec/bitcoin/fixtures/514c46f0b61714092f15c8dfcb576c9f79b3f959989b98de3944b19d98832b58.json
253
+ - spec/bitcoin/fixtures/51bf528ecf3c161e7c021224197dbe84f9a8564212f6207baa014c01a1668e1e.json
228
254
  - spec/bitcoin/fixtures/60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1.json
255
+ - spec/bitcoin/fixtures/69216b8aaa35b76d6613e5f527f4858640d986e1046238583bdad79b35e938dc.json
256
+ - spec/bitcoin/fixtures/7208e5edf525f04e705fb3390194e316205b8f995c8c9fcd8c6093abe04fa27d.json
257
+ - spec/bitcoin/fixtures/761d8c5210fdfd505f6dff38f740ae3728eb93d7d0971fb433f685d40a4c04f6.json
258
+ - spec/bitcoin/fixtures/aea682d68a3ea5e3583e088dcbd699a5d44d4b083f02ad0aaf2598fe1fa4dfd4.json
229
259
  - spec/bitcoin/fixtures/bc179baab547b7d7c1d5d8d6f8b0cc6318eaa4b0dd0a093ad6ac7f5a1cb6b3ba.json
260
+ - spec/bitcoin/fixtures/bd1715f1abfdc62bea3f605bdb461b3ba1f2cca6ec0d73a18a548b7717ca8531.json
261
+ - spec/bitcoin/fixtures/block-testnet-0000000000ac85bb2530a05a4214a387e6be02b22d3348abc5e7a5d9c4ce8dab.bin
262
+ - spec/bitcoin/fixtures/cd874fa8cb0e2ec2d385735d5e1fd482c4fe648533efb4c50ee53bda58e15ae2.json
263
+ - spec/bitcoin/fixtures/ce5fad9b4ef094d8f4937b0707edaf0a6e6ceeaf67d5edbfd51f660eac8f398b.json
264
+ - spec/bitcoin/fixtures/f003f0c1193019db2497a675fd05d9f2edddf9b67c59e677c48d3dbd4ed5f00b.json
265
+ - spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.bin
266
+ - spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.json
267
+ - spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.bin
268
+ - spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.json
269
+ - spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.bin
270
+ - spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.json
271
+ - spec/bitcoin/fixtures/litecoin-genesis-block-12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2.bin
272
+ - spec/bitcoin/fixtures/litecoin-genesis-block-12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2.json
230
273
  - spec/bitcoin/fixtures/rawblock-0.bin
231
274
  - spec/bitcoin/fixtures/rawblock-0.json
232
275
  - spec/bitcoin/fixtures/rawblock-1.bin
@@ -237,6 +280,7 @@ test_files:
237
280
  - spec/bitcoin/fixtures/rawblock-170.json
238
281
  - spec/bitcoin/fixtures/rawblock-9.bin
239
282
  - spec/bitcoin/fixtures/rawblock-9.json
283
+ - spec/bitcoin/fixtures/rawblock-auxpow.bin
240
284
  - spec/bitcoin/fixtures/rawblock-testnet-26478.bin
241
285
  - spec/bitcoin/fixtures/rawblock-testnet-26478.json
242
286
  - spec/bitcoin/fixtures/rawtx-01.bin
@@ -271,23 +315,33 @@ test_files:
271
315
  - spec/bitcoin/fixtures/testnet/block_3.bin
272
316
  - spec/bitcoin/fixtures/testnet/block_4.bin
273
317
  - spec/bitcoin/fixtures/testnet/block_5.bin
318
+ - spec/bitcoin/fixtures/tx-313897799b1e37e9ecae15010e56156dddde4e683c96b0e713af95272c38aee0.json
319
+ - spec/bitcoin/fixtures/tx-3da75972766f0ad13319b0b461fd16823a731e44f6e9de4eb3c52d6a6fb6c8ae.json
320
+ - spec/bitcoin/fixtures/tx-44b833074e671120ba33106877b49e86ece510824b9af477a3853972bcd8d06a.json
321
+ - spec/bitcoin/fixtures/tx-d3d77d63709e47d9ef58f0b557800115a6b676c6a423012fbb96f45d8fcef830.json
274
322
  - spec/bitcoin/fixtures/txdp-1.txt
275
323
  - spec/bitcoin/fixtures/txdp-2-signed.txt
276
324
  - spec/bitcoin/fixtures/txdp-2-unsigned.txt
277
325
  - spec/bitcoin/key_spec.rb
326
+ - spec/bitcoin/namecoin_spec.rb
278
327
  - spec/bitcoin/network_spec.rb
328
+ - spec/bitcoin/node/command_api_spec.rb
279
329
  - spec/bitcoin/protocol/addr_spec.rb
280
330
  - spec/bitcoin/protocol/alert_spec.rb
331
+ - spec/bitcoin/protocol/aux_pow_spec.rb
281
332
  - spec/bitcoin/protocol/block_spec.rb
333
+ - spec/bitcoin/protocol/getblocks_spec.rb
282
334
  - spec/bitcoin/protocol/inv_spec.rb
335
+ - spec/bitcoin/protocol/notfound_spec.rb
283
336
  - spec/bitcoin/protocol/ping_spec.rb
284
337
  - spec/bitcoin/protocol/tx_spec.rb
285
338
  - spec/bitcoin/protocol/version_spec.rb
286
- - spec/bitcoin/reorg_spec.rb
287
339
  - spec/bitcoin/script/opcodes_spec.rb
288
340
  - spec/bitcoin/script/script_spec.rb
289
341
  - spec/bitcoin/spec_helper.rb
290
- - spec/bitcoin/storage_spec.rb
342
+ - spec/bitcoin/storage/reorg_spec.rb
343
+ - spec/bitcoin/storage/storage_spec.rb
344
+ - spec/bitcoin/storage/validation_spec.rb
291
345
  - spec/bitcoin/wallet/coinselector_spec.rb
292
346
  - spec/bitcoin/wallet/keygenerator_spec.rb
293
347
  - spec/bitcoin/wallet/keystore_spec.rb