bitcoin-ruby 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db1b92d6514cc112f7141841b658fe16fc23cdad
4
- data.tar.gz: 2a4a5e0e7215cc7739d8208322ac361ef1beb988
3
+ metadata.gz: ac6c9d01c48a263a569a401541007093dbd82e33
4
+ data.tar.gz: a27f352d83e4a7958004d8d6ff1eee46d12656b2
5
5
  SHA512:
6
- metadata.gz: 63c618a352af13e722f280e84ef6801ded898c65db7f346eb410fa417c310c89c643d74e66474a975281326bae0d9e4b70316a6c2fb4b4e9a8f54c8462ce241c
7
- data.tar.gz: 421b29bcb069e3f6de8d3c8484aece5d6bd09a9f0695866f47baa6308e02ef6fa5b267a350aea9741aaea19b5395fce35456111e24f787ec6819498df199b02a
6
+ metadata.gz: dfcdaf331ed1a47de70e8557c7de2acdd04e255da1fb5ffbd787f83c4f84ba7963b122924e4a7c61f9e36a407dbcc57294ebf122a614afc9134f118b388811f0
7
+ data.tar.gz: c7909f9e27da531aa015701342559ec39a742c73171e3f8c8bc5de82f699d57c3be1318bce9f0b71caae24b5226d6f48d002cddcc32ed37bc33d5b430d98029e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitcoin-ruby (0.0.8)
4
+ bitcoin-ruby (0.0.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -323,7 +323,7 @@ module Bitcoin
323
323
  def bitcoin_signed_message_hash(message)
324
324
  message = message.dup.force_encoding('binary')
325
325
 
326
- magic = "Bitcoin Signed Message:\n"
326
+ magic = Bitcoin.network[:message_magic]
327
327
  buf = Protocol.pack_var_int(magic.bytesize) + magic
328
328
  buf << Protocol.pack_var_int(message.bytesize) + message
329
329
 
@@ -548,6 +548,7 @@ module Bitcoin
548
548
  bitcoin: {
549
549
  project: :bitcoin,
550
550
  magic_head: "\xF9\xBE\xB4\xD9",
551
+ message_magic: "Bitcoin Signed Message:\n",
551
552
  address_version: "00",
552
553
  p2sh_version: "05",
553
554
  privkey_version: "80",
@@ -652,6 +653,7 @@ module Bitcoin
652
653
  NETWORKS[:litecoin] = NETWORKS[:bitcoin].merge({
653
654
  project: :litecoin,
654
655
  magic_head: "\xfb\xc0\xb6\xdb",
656
+ message_magic: "Litecoin Signed Message:\n",
655
657
  address_version: "30",
656
658
  p2sh_version: "05",
657
659
  privkey_version: "b0",
@@ -724,6 +726,7 @@ module Bitcoin
724
726
  NETWORKS[:dogecoin] = NETWORKS[:litecoin].merge({
725
727
  project: :dogecoin,
726
728
  magic_head: "\xc0\xc0\xc0\xc0",
729
+ message_magic: "Dogecoin Signed Message:\n",
727
730
  address_version: "1e",
728
731
  p2sh_version: "16",
729
732
  privkey_version: "9e",
@@ -261,7 +261,7 @@ module Bitcoin
261
261
  ins .each{|input| tx.add_in TxIn.from_hash(input) }
262
262
  outs.each{|output| tx.add_out TxOut.from_hash(output) }
263
263
  tx.instance_eval{ @hash = hash_from_payload(@payload = to_payload) }
264
- unless h['hash'] == tx.hash
264
+ if h['hash'] && (h['hash'] != tx.hash)
265
265
  raise "Tx hash mismatch! Claimed: #{h['hash']}, Actual: #{tx.hash}" if do_raise
266
266
  end
267
267
  tx
@@ -1,3 +1,3 @@
1
1
  module Bitcoin
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - lian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-21 00:00:00.000000000 Z
11
+ date: 2016-07-13 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:
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  version: 1.3.6
246
246
  requirements: []
247
247
  rubyforge_project: bitcoin-ruby
248
- rubygems_version: 2.4.5.1
248
+ rubygems_version: 2.5.1
249
249
  signing_key:
250
250
  specification_version: 4
251
251
  summary: bitcoin utils and protocol in ruby