coin-op 0.4.1 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 163ba3e319097c3ef801ba1eab58674ee7b0639f
4
- data.tar.gz: f44670fc083600954042b19c021ebf3351844f07
3
+ metadata.gz: 4f45ce27e81850de8f674df80ec2f9e3ca0cf50b
4
+ data.tar.gz: 9a79c80c8d6b01b2fd384eee10fd017fe6229655
5
5
  SHA512:
6
- metadata.gz: b5403bd152292deb02970a20fd9e64d02a1bb3f0393dc92785e8994ab812a0c44a0e3f97bb078584e2b4c5a1a94a4889dbfe96d527b23f731f0f992c4a2b3c56
7
- data.tar.gz: 567314b251b942fcbed42fe501a4bd369023a4fb098f09564bb95c48049ad5f6188d209f0680e6cc38a4d3223cceca24777bb20f3348a3a9769fac2af62d3617
6
+ metadata.gz: 3086ad2a8d11b8f290c0077d070332fbf7901a49d6f29839e8fd279e0a120526c282e9ca3a73c63978b7a44677e463643c1e2809767b72c322e97d5797e2c626
7
+ data.tar.gz: a2e2e284c282cd2e61bd090e146be00794a89b2185f9449dfe8c80c48ccab9a890641ac3cb1fb90520d688645a9f9340bffd3bef1751ccc4736fe19f52681b48
checksums.yaml.gz.sig CHANGED
Binary file
@@ -251,13 +251,15 @@ module CoinOp::Bit
251
251
  end
252
252
 
253
253
  def address
254
- self.script.p2sh_address
254
+ script.address
255
255
  end
256
256
 
257
- alias_method :p2sh_address, :address
257
+ def p2sh_address
258
+ script.p2sh_address
259
+ end
258
260
 
259
261
  def p2sh_script
260
- Script.new(:address => self.script.p2sh_address, network: network)
262
+ Script.new(:address => self.script.address, network: network)
261
263
  end
262
264
 
263
265
  def signatures(value, names:)
@@ -104,27 +104,29 @@ module CoinOp::Bit
104
104
  self.to_hash.to_json(*a)
105
105
  end
106
106
 
107
- def hash160
108
- CoinOp.syncbit(@network[:name]) do
109
- @native.get_hash160 || Bitcoin.hash160(@hex)
110
- end
111
- end
112
-
113
107
  # Generate the script that uses a P2SH address.
114
108
  # Used for an Output's scriptPubKey value. Not much used, and
115
109
  # can probably be removed, as I think it is equivalent to
116
- # Script.new :address => some_p2sh_address
110
+ # Script.new :address => some.address
117
111
  def p2sh_script
118
- CoinOp.syncbit(@network[:name]) do |b|
119
- self.class.new Bitcoin::Script.to_p2sh_script(self.hash160)
112
+ CoinOp.syncbit(@network[:name]) do
113
+ self.class.new Bitcoin::Script.to_p2sh_script(@native.get_hash160)
120
114
  end
121
115
  end
122
116
 
117
+ def hash160
118
+ CoinOp.syncbit(@network[:name]) { Bitcoin.hash160(@hex) }
119
+ end
120
+
123
121
  def p2sh_address
124
122
  Bitcoin.encode_address(self.hash160, Bitcoin::NETWORKS[@network[:name]][:p2sh_version])
125
123
  end
126
124
 
127
- alias_method :address, :p2sh_address
125
+ def address
126
+ CoinOp.syncbit(@network[:name]) do
127
+ @native.get_address
128
+ end
129
+ end
128
130
 
129
131
  # Generate a P2SH script_sig for the current script, using the
130
132
  # supplied options, which will, in the case of a multisig input,
@@ -1,3 +1,3 @@
1
1
  module CoinOp
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coin-op
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew King
@@ -32,7 +32,7 @@ cert_chain:
32
32
  tdc4VS7IlSRxlZ3dBOgiigy9GXpJ+7F831AqjxL39EPwdr7RguTNz+pi//RKaT/U
33
33
  IlpVB+Xfk0vQdP7iYfjGxDzUf0FACMjsR95waJmadKW1Iy6STw2hwPhYIQz1Hu1A
34
34
  -----END CERTIFICATE-----
35
- date: 2015-05-19 00:00:00.000000000 Z
35
+ date: 2015-05-27 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bitcoin-ruby
metadata.gz.sig CHANGED
Binary file