sibit 0.12.4 → 0.12.5

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sibit/version.rb +1 -1
  3. data/lib/sibit.rb +6 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce8e0305c4ab80483d15d3067af9e6f14098b9374b5bf52952e90ba4c21e5fe5
4
- data.tar.gz: 3de5750cc4144b1d68dd2241bf8d0153cc34c99a91015a3cefc16c8b3c468e32
3
+ metadata.gz: a60738f08eff40722e87f46d4d8e16c7f59f2d2488bdb95bfee6625057bf38f3
4
+ data.tar.gz: a62597ee21efd55bb466316f21960df713d7ab7fc5063eb4ad721524f8a87279
5
5
  SHA512:
6
- metadata.gz: 5116ed2893173b83379f9f040d55aca1182d9253b0c6beacd99c4b89cb45d7fb20cd85db01c68815ca5bfad6446a0ef2e74a9dc04f9d4e77f443c184a7bac587
7
- data.tar.gz: 544d308336b5616e72c3f3058dabb79efb94b05eba2b8f90825cd421c23afba475c79bcf3d282d42e00bdffb2f06df68590a295e35787d2f80e998b5f043c664
6
+ metadata.gz: 2e9a89b805345c0a8c07ccbb8325340e73d15cf518d11d2fb5bcc11796e8ba47652d05ebcb31210b497f830fcbcc7212c2ce301cbdcca2d78acc4de260fc292f
7
+ data.tar.gz: 174ea54310174a0f8732510e1acc9e1aae389f87fa32e31e28b2df9ca687753641ceeb91d469156913dfafeb2e49c6be87cf30705e7bb5669934f6e46f99c0f5
data/lib/sibit/version.rb CHANGED
@@ -26,5 +26,5 @@
26
26
  # License:: MIT
27
27
  class Sibit
28
28
  # Current version of the library.
29
- VERSION = '0.12.4'
29
+ VERSION = '0.12.5'
30
30
  end
data/lib/sibit.rb CHANGED
@@ -200,7 +200,7 @@ class Sibit
200
200
  tx = builder.tx(
201
201
  input_value: unspent,
202
202
  leave_fee: true,
203
- extra_fee: [f.abs - Bitcoin.network[:min_tx_fee], 0].max,
203
+ extra_fee: [f, Bitcoin.network[:min_tx_fee]].max,
204
204
  change_address: change
205
205
  )
206
206
  left = unspent - tx.outputs.map(&:value).inject(&:+)
@@ -267,6 +267,11 @@ class Sibit
267
267
  raise Error, "Can't understand the amount #{amount.inspect}"
268
268
  end
269
269
 
270
+ # Calculates a fee in satoshi for the transaction of the specified size.
271
+ # The +fee+ argument could be a number in satoshi, in which case it will
272
+ # be returned as is, or a string like "XL" or "S", in which case the
273
+ # fee will be calculated using the +size+ argument (which is the size
274
+ # of the transaction in bytes).
270
275
  def mfee(fee, size)
271
276
  return fee.to_i if fee.is_a?(Integer)
272
277
  raise Error, 'Fee should either be a String or Integer' unless fee.is_a?(String)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.4
4
+ version: 0.12.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko