sibit 0.7.1 → 0.7.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 +4 -4
- data/lib/sibit/version.rb +1 -1
- data/lib/sibit.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b9718bc8fe630a39247c01b3c9d4a5e631709c48f06fccc9b63c7fa10e67f2d
|
|
4
|
+
data.tar.gz: b960f89f169ccb01d87017f546bd818bd559e8d28924d9eb044ba7afb14e443f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bcdc3c1e028aecc3ddfceeb2cce3fab667f75bff6dfd65a6fae0aa15a6dc97024b3018a5eb76ad8da7e19942c10910c38339ea49752c6c85d851475c7d82343
|
|
7
|
+
data.tar.gz: 32da3065c371cfda7bcf6374dd0592f74d602fe434d50f2107ac5fd6a0bc41bd2cbe618c870466d3dca5a288b7a73d3f8acef94df934d579559683aa3aa87878
|
data/lib/sibit/version.rb
CHANGED
data/lib/sibit.rb
CHANGED
|
@@ -173,12 +173,15 @@ class Sibit
|
|
|
173
173
|
|
|
174
174
|
# Convert text to amount.
|
|
175
175
|
def satoshi(amount)
|
|
176
|
+
return amount if amount.is_a?(Integer)
|
|
177
|
+
raise Error, 'Amount should either be a String or Integer' unless amount.is_a?(String)
|
|
176
178
|
return (amount.gsub(/BTC$/, '').to_f * 100_000_000).to_i if amount.end_with?('BTC')
|
|
177
|
-
amount.
|
|
179
|
+
raise Error, "Can't understand the amount #{amount.inspect}"
|
|
178
180
|
end
|
|
179
181
|
|
|
180
182
|
def mfee(fee, size)
|
|
181
|
-
return fee.to_i if fee.is_a?(Integer)
|
|
183
|
+
return fee.to_i if fee.is_a?(Integer)
|
|
184
|
+
raise Error, 'Fee should either be a String or Integer' unless fee.is_a?(String)
|
|
182
185
|
case fee
|
|
183
186
|
when 'S'
|
|
184
187
|
return 10 * size
|