bitcoin-ruby 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/COPYING +1 -1
- data/Gemfile.lock +1 -1
- data/README.rdoc +11 -29
- data/lib/bitcoin.rb +83 -11
- data/lib/bitcoin/bech32.rb +172 -0
- data/lib/bitcoin/builder.rb +25 -7
- data/lib/bitcoin/ffi/secp256k1.rb +12 -12
- data/lib/bitcoin/protocol/txout.rb +7 -1
- data/lib/bitcoin/script.rb +25 -8
- data/lib/bitcoin/version.rb +1 -1
- data/spec/bitcoin/bech32_spec.rb +160 -0
- data/spec/bitcoin/bitcoin_spec.rb +60 -0
- data/spec/bitcoin/builder_spec.rb +33 -0
- data/spec/bitcoin/fixtures/base58_keys_invalid.json +182 -0
- data/spec/bitcoin/fixtures/base58_keys_valid.json +488 -0
- data/spec/bitcoin/protocol/txout_spec.rb +6 -0
- data/spec/bitcoin/script/script_spec.rb +4 -0
- data/spec/bitcoin/secp256k1_spec.rb +1 -1
- metadata +9 -2
@@ -23,5 +23,11 @@ describe 'TxOut' do
|
|
23
23
|
(o1 == nil).should == false
|
24
24
|
end
|
25
25
|
|
26
|
+
it "should update parsed script cache on script change" do
|
27
|
+
out = TxOut.new(123, "abc")
|
28
|
+
parsed = out.parsed_script
|
29
|
+
out.pk_script = "def"
|
30
|
+
out.parsed_script.should != parsed
|
31
|
+
end
|
26
32
|
end
|
27
33
|
|
@@ -195,6 +195,10 @@ describe 'Bitcoin::Script' do
|
|
195
195
|
"1F2Nnyn7niMcheiYhkHrkc18aDxEkFowy5"
|
196
196
|
Script.new(SCRIPT[5]).get_address.should ==
|
197
197
|
"3FDuvkgzsW7LpzL9RBjtjvL7bFXCEeZ7xi"
|
198
|
+
Script.new(SCRIPT[7]).get_address.should ==
|
199
|
+
"bc1qrcs9z5wfpstyw5mr6ydhhrprtnmv0454y6laym"
|
200
|
+
Script.new(SCRIPT[8]).get_address.should ==
|
201
|
+
"bc1qt5d4dd3aw98whe2zxz2jtayykl5ada5xkdupkmmpa7f96ekk76sqvmrunq"
|
198
202
|
end
|
199
203
|
|
200
204
|
it "#get_addresses" do
|
@@ -27,7 +27,7 @@ describe 'libsecp256k1' do
|
|
27
27
|
priv, pub = Bitcoin::Secp256k1.generate_key_pair
|
28
28
|
signature = Bitcoin::Secp256k1.sign("derp", priv)
|
29
29
|
Bitcoin::Secp256k1.verify("derp", signature, pub).should == true
|
30
|
-
Bitcoin::Secp256k1.verify("DERP", signature, pub).should ==
|
30
|
+
Bitcoin::Secp256k1.verify("DERP", signature, pub).should == false
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'sign compact and recover' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitcoin-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This is a ruby library for interacting with the bitcoin protocol/network
|
14
14
|
email:
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- examples/generate_tx.rb
|
34
34
|
- examples/simple_network_monitor_and_util.rb
|
35
35
|
- lib/bitcoin.rb
|
36
|
+
- lib/bitcoin/bech32.rb
|
36
37
|
- lib/bitcoin/bloom_filter.rb
|
37
38
|
- lib/bitcoin/builder.rb
|
38
39
|
- lib/bitcoin/connection.rb
|
@@ -63,6 +64,7 @@ files:
|
|
63
64
|
- lib/bitcoin/script.rb
|
64
65
|
- lib/bitcoin/trezor/mnemonic.rb
|
65
66
|
- lib/bitcoin/version.rb
|
67
|
+
- spec/bitcoin/bech32_spec.rb
|
66
68
|
- spec/bitcoin/bitcoin_spec.rb
|
67
69
|
- spec/bitcoin/bloom_filter_spec.rb
|
68
70
|
- spec/bitcoin/builder_spec.rb
|
@@ -88,6 +90,8 @@ files:
|
|
88
90
|
- spec/bitcoin/fixtures/761d8c5210fdfd505f6dff38f740ae3728eb93d7d0971fb433f685d40a4c04f6.json
|
89
91
|
- spec/bitcoin/fixtures/8d0b238a06b5a70be75d543902d02d7a514d68d3252a949a513865ac3538874c.json
|
90
92
|
- spec/bitcoin/fixtures/aea682d68a3ea5e3583e088dcbd699a5d44d4b083f02ad0aaf2598fe1fa4dfd4.json
|
93
|
+
- spec/bitcoin/fixtures/base58_keys_invalid.json
|
94
|
+
- spec/bitcoin/fixtures/base58_keys_valid.json
|
91
95
|
- spec/bitcoin/fixtures/bc179baab547b7d7c1d5d8d6f8b0cc6318eaa4b0dd0a093ad6ac7f5a1cb6b3ba.json
|
92
96
|
- spec/bitcoin/fixtures/bd1715f1abfdc62bea3f605bdb461b3ba1f2cca6ec0d73a18a548b7717ca8531.json
|
93
97
|
- spec/bitcoin/fixtures/block-testnet-0000000000ac85bb2530a05a4214a387e6be02b22d3348abc5e7a5d9c4ce8dab.bin
|
@@ -266,6 +270,7 @@ signing_key:
|
|
266
270
|
specification_version: 4
|
267
271
|
summary: bitcoin utils and protocol in ruby
|
268
272
|
test_files:
|
273
|
+
- spec/bitcoin/bech32_spec.rb
|
269
274
|
- spec/bitcoin/bitcoin_spec.rb
|
270
275
|
- spec/bitcoin/bloom_filter_spec.rb
|
271
276
|
- spec/bitcoin/builder_spec.rb
|
@@ -291,6 +296,8 @@ test_files:
|
|
291
296
|
- spec/bitcoin/fixtures/761d8c5210fdfd505f6dff38f740ae3728eb93d7d0971fb433f685d40a4c04f6.json
|
292
297
|
- spec/bitcoin/fixtures/8d0b238a06b5a70be75d543902d02d7a514d68d3252a949a513865ac3538874c.json
|
293
298
|
- spec/bitcoin/fixtures/aea682d68a3ea5e3583e088dcbd699a5d44d4b083f02ad0aaf2598fe1fa4dfd4.json
|
299
|
+
- spec/bitcoin/fixtures/base58_keys_invalid.json
|
300
|
+
- spec/bitcoin/fixtures/base58_keys_valid.json
|
294
301
|
- spec/bitcoin/fixtures/bc179baab547b7d7c1d5d8d6f8b0cc6318eaa4b0dd0a093ad6ac7f5a1cb6b3ba.json
|
295
302
|
- spec/bitcoin/fixtures/bd1715f1abfdc62bea3f605bdb461b3ba1f2cca6ec0d73a18a548b7717ca8531.json
|
296
303
|
- spec/bitcoin/fixtures/block-testnet-0000000000ac85bb2530a05a4214a387e6be02b22d3348abc5e7a5d9c4ce8dab.bin
|