bitsy-bitcoin 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/bitsy/payment_depot.rb +8 -0
- data/app/services/bitsy/check_for_payments.rb +1 -1
- data/app/services/bitsy/check_payment_depot_transactions.rb +7 -4
- data/app/services/bitsy/check_payment_depots_transactions.rb +17 -0
- data/lib/bitsy/version.rb +1 -1
- metadata +3 -3
- data/app/services/bitsy/check_payment_depot_transaction.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d5b039fc91c6f09e4a500db7a110f4741d68aaa
|
4
|
+
data.tar.gz: 16c38e374670e1bed10d219391779b2a7d604297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f9c83f0c335597e422ef0ee6bcd817167a0b911979d5063f63ec44099dcc7a38b2a60e510636634555a5bd4b0b781a383eba81b9c6c7b0df306ccac5a8ebe2e
|
7
|
+
data.tar.gz: ae93a6e7e89cea9c91f90d123474226660ae81d08113f37c16e7398bfe62843397bccb010a83b72c920bd7e23b230bd28de900c77e252657e1aea78096e24a92
|
@@ -9,6 +9,14 @@ module Bitsy
|
|
9
9
|
after_initialize :set_uuid
|
10
10
|
scope :with_balance, -> { where('balance_cache > 0.0') }
|
11
11
|
scope :checked_at_is_past, -> { where(arel_table[:checked_at].lt(Time.now)) }
|
12
|
+
scope :received_at_least_minimum, -> do
|
13
|
+
min_payment = arel_table[:min_payment]
|
14
|
+
total_received_amount_cache = arel_table[:total_received_amount_cache]
|
15
|
+
where(min_payment.lteq(total_received_amount_cache))
|
16
|
+
end
|
17
|
+
scope :for_manual_checking, -> do
|
18
|
+
checked_at_is_past.received_at_least_minimum
|
19
|
+
end
|
12
20
|
validates(
|
13
21
|
:initial_tax_rate,
|
14
22
|
inclusion: {
|
@@ -2,15 +2,18 @@ module Bitsy
|
|
2
2
|
class CheckPaymentDepotTransactions
|
3
3
|
|
4
4
|
include LightService::Action
|
5
|
-
expects :latest_block, :
|
5
|
+
expects :latest_block, :payment_depot
|
6
6
|
|
7
7
|
executed do |ctx|
|
8
|
-
ctx.
|
9
|
-
|
10
|
-
|
8
|
+
blockchain_address = Blockchain.get_address(ctx.payment_depot.address)
|
9
|
+
blockchain_address.txs.each do |tx|
|
10
|
+
ProcessBlockchainBlockexplorerTransaction.execute(
|
11
|
+
payment_depot: ctx.payment_depot,
|
11
12
|
latest_block: ctx.latest_block,
|
13
|
+
blockchain_transaction: tx,
|
12
14
|
)
|
13
15
|
end
|
16
|
+
ctx.payment_depot.reset_checked_at!
|
14
17
|
end
|
15
18
|
|
16
19
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Bitsy
|
2
|
+
class CheckPaymentDepotsTransactions
|
3
|
+
|
4
|
+
include LightService::Action
|
5
|
+
expects :latest_block
|
6
|
+
|
7
|
+
executed do |ctx|
|
8
|
+
PaymentDepot.for_manual_checking.find_each do |payment_depot|
|
9
|
+
CheckPaymentDepotTransactions.execute(
|
10
|
+
payment_depot: payment_depot,
|
11
|
+
latest_block: ctx.latest_block,
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
data/lib/bitsy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitsy-bitcoin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -328,8 +328,8 @@ files:
|
|
328
328
|
- app/services/bitsy/build_send_many_hash_for_transaction.rb
|
329
329
|
- app/services/bitsy/build_send_many_hash_with_transaction_fee.rb
|
330
330
|
- app/services/bitsy/check_for_payments.rb
|
331
|
-
- app/services/bitsy/check_payment_depot_transaction.rb
|
332
331
|
- app/services/bitsy/check_payment_depot_transactions.rb
|
332
|
+
- app/services/bitsy/check_payment_depots_transactions.rb
|
333
333
|
- app/services/bitsy/compute_amount_for_splitting.rb
|
334
334
|
- app/services/bitsy/create_payment_depot.rb
|
335
335
|
- app/services/bitsy/forward_payments.rb
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Bitsy
|
2
|
-
class CheckPaymentDepotTransaction
|
3
|
-
|
4
|
-
include LightService::Action
|
5
|
-
expects :latest_block, :payment_depot
|
6
|
-
|
7
|
-
executed do |ctx|
|
8
|
-
blockchain_address = Blockchain.get_address(ctx.payment_depot.address)
|
9
|
-
blockchain_address.txs.each do |tx|
|
10
|
-
ProcessBlockchainBlockexplorerTransaction.execute(
|
11
|
-
payment_depot: ctx.payment_depot,
|
12
|
-
latest_block: ctx.latest_block,
|
13
|
-
blockchain_transaction: tx,
|
14
|
-
)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|