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: c3ba1fbf0fe9d7db7eed5889e238341a767f77970abd4e75ad2cb91581ff2ab7
4
- data.tar.gz: d83e78f1b44edc67dd8fa1d91abf63b9b7badae37935bef70177aa3925686f1b
3
+ metadata.gz: a2b366798a82d6d67da3ecb8e3cfbb2988536054a1519e81e4fea5c55b062339
4
+ data.tar.gz: d872776ecabe5486c2bac8fba5f11c98926c8ee42d839a5e90329f27798dc866
5
5
  SHA512:
6
- metadata.gz: bbfcaf41ebd418882dc75f878ad900a9ac39f8ab72566d0e41ca8fb2d4e7f9ec7c49d0624cb70df943be12b9a706c3558ce93eaa1f23e18e7826bd2c40028b08
7
- data.tar.gz: 141470c4f0642ffc5557f0fc945793a062ac7b35518511e6eb733a18224e90d0e57f75384406070ab1c112923670993115258d3d32f77feee16e165fa21eb43b
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 = DEFAULT_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
@@ -1,3 +1,3 @@
1
1
  module StellarBase
2
- VERSION = "4.1.0".freeze
2
+ VERSION = "4.2.0".freeze
3
3
  end
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.1.0
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-15 00:00:00.000000000 Z
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.4
566
+ rubygems_version: 3.0.1
566
567
  signing_key:
567
568
  specification_version: 4
568
569
  summary: Mountable Stellar API Endpoints for Rails