stellar_base-rails 4.1.0 → 4.2.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2b366798a82d6d67da3ecb8e3cfbb2988536054a1519e81e4fea5c55b062339
|
4
|
+
data.tar.gz: d872776ecabe5486c2bac8fba5f11c98926c8ee42d839a5e90329f27798dc866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89a59c7b1f4f2497b4862c5fd8f7124fd4d49164c79f7f91699ba809725862b63b5bc885b3841b48e72e07f9de0d928440abaeee1c71057911d4d62f50af6c47
|
7
|
+
data.tar.gz: ea8eac4609021b4b5c3bcbf920f0b312f273caa5b64456b21a169e62a1ec989fb219cd2e7b96f2dd4bfad3695c53e9053f7e778e4cce137c459b4f841426f7de
|
@@ -3,8 +3,6 @@ module StellarBase
|
|
3
3
|
module Operations
|
4
4
|
class Create < ApplicationOperation
|
5
5
|
|
6
|
-
DEFAULT_ETA = (10 * 60).freeze
|
7
|
-
|
8
6
|
step self::Policy::Pundit(DepositRequestPolicy, :create?)
|
9
7
|
step Model(DepositRequest, :new)
|
10
8
|
step :find_depositable_asset_details!
|
@@ -52,7 +50,8 @@ module StellarBase
|
|
52
50
|
def set_defaults!(options, params:, model:, asset_details:, **)
|
53
51
|
model.asset_type = asset_details[:type]
|
54
52
|
model.issuer = asset_details[:issuer]
|
55
|
-
model.eta =
|
53
|
+
model.eta =
|
54
|
+
DetermineEta.(asset_details[:eta_from], params[:deposit_request])
|
56
55
|
model.min_amount = 0.0
|
57
56
|
|
58
57
|
# Make Deposits free unless we want it configured
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module StellarBase
|
2
|
+
module DepositRequests
|
3
|
+
class DetermineEta
|
4
|
+
|
5
|
+
DEFAULT = nil
|
6
|
+
|
7
|
+
def self.call(class_name, params)
|
8
|
+
# TODO: how do we handle errors
|
9
|
+
if class_name.present?
|
10
|
+
callback = GetCallbackFrom.(class_name)
|
11
|
+
unless callback.method(:call).arity.zero?
|
12
|
+
return callback.send(:call, params)
|
13
|
+
end
|
14
|
+
|
15
|
+
return callback.send(:call)
|
16
|
+
end
|
17
|
+
DEFAULT
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/stellar_base/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stellar_base-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ace Subido
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: disposable
|
@@ -484,6 +484,7 @@ files:
|
|
484
484
|
- app/services/stellar_base/bridge_callbacks/verify_mac_payload.rb
|
485
485
|
- app/services/stellar_base/configured_class_runner.rb
|
486
486
|
- app/services/stellar_base/deposit_requests/create_deposit.rb
|
487
|
+
- app/services/stellar_base/deposit_requests/determine_eta.rb
|
487
488
|
- app/services/stellar_base/deposit_requests/determine_how.rb
|
488
489
|
- app/services/stellar_base/deposit_requests/find_config.rb
|
489
490
|
- app/services/stellar_base/deposit_requests/find_deposit_request.rb
|
@@ -562,7 +563,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
562
563
|
- !ruby/object:Gem::Version
|
563
564
|
version: '0'
|
564
565
|
requirements: []
|
565
|
-
rubygems_version: 3.0.
|
566
|
+
rubygems_version: 3.0.1
|
566
567
|
signing_key:
|
567
568
|
specification_version: 4
|
568
569
|
summary: Mountable Stellar API Endpoints for Rails
|