bitid 0.0.3 → 0.0.4
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.
- data/lib/bitid.rb +6 -2
- data/lib/bitid/version.rb +2 -2
- data/test/test_bitid.rb +11 -2
- metadata +3 -9
data/lib/bitid.rb
CHANGED
@@ -26,7 +26,7 @@ class Bitid
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def signature_valid?
|
29
|
-
BitcoinCigs.verify_message(@address, @signature, uri)
|
29
|
+
BitcoinCigs.verify_message(@address, @signature, uri, { :network => get_network })
|
30
30
|
end
|
31
31
|
|
32
32
|
def qrcode
|
@@ -57,4 +57,8 @@ class Bitid
|
|
57
57
|
uri.query = URI.encode_www_form(params)
|
58
58
|
uri
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
|
+
def get_network
|
62
|
+
@address[0] == "1" ? :mainnet : :testnet
|
63
|
+
end
|
64
|
+
end
|
data/lib/bitid/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Bitid
|
2
|
-
VERSION = "0.0.
|
3
|
-
end
|
2
|
+
VERSION = "0.0.4"
|
3
|
+
end
|
data/test/test_bitid.rb
CHANGED
@@ -81,5 +81,14 @@ class TestBitid < Test::Unit::TestCase
|
|
81
81
|
def test_extract_nonce
|
82
82
|
bitid = Bitid.new(address:@address, uri:@uri, signature:@signature, callback:@callback)
|
83
83
|
assert_equal "fe32e61882a71074", bitid.nonce
|
84
|
-
end
|
85
|
-
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_testnet
|
87
|
+
bitid = Bitid.new(
|
88
|
+
address:"mpsaRD2ugdCY1iFrQdsDYRT4qeZzCnvGHW",
|
89
|
+
uri:"bitid://bitid.bitcoin.blue/callback?x=3893a2a881dd4a1e&u=1",
|
90
|
+
signature:"ID5heI0WOeWoryGhZHaxoOH5vkmmcwDsfc4nDQ5vPcXSWh2jyETDGkSNO5zk4nbESGD6k0tgFxYA3HzlEGOf5Uc=",
|
91
|
+
callback:"http://bitid.bitcoin.blue/callback")
|
92
|
+
assert bitid.signature_valid?
|
93
|
+
end
|
94
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bitcoin-cigs
|
@@ -88,21 +88,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
88
|
- - ! '>='
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
|
-
segments:
|
92
|
-
- 0
|
93
|
-
hash: 690211457
|
94
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
92
|
none: false
|
96
93
|
requirements:
|
97
94
|
- - ! '>='
|
98
95
|
- !ruby/object:Gem::Version
|
99
96
|
version: '0'
|
100
|
-
segments:
|
101
|
-
- 0
|
102
|
-
hash: 690211457
|
103
97
|
requirements: []
|
104
98
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.8.
|
99
|
+
rubygems_version: 1.8.23
|
106
100
|
signing_key:
|
107
101
|
specification_version: 3
|
108
102
|
summary: BitID
|