stellar_base-rails 0.6.0 → 0.6.1

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: fdcf37c86d71ffbb7830e3040033107afb8f31522425c8cc94e24d3c67097c8f
4
- data.tar.gz: 34b17e584937960171db869cd9d8660647e22d9689c5fd1d05864342a7afc85c
3
+ metadata.gz: 9f634660d3aa8e4f2c16dbde0657f5b5be1d23f881911e863350a8800f1e6b5e
4
+ data.tar.gz: e4d0e9d9ff41c4cdb82f195935b4423181ef3b3631f8238b96498839a1dc6f6c
5
5
  SHA512:
6
- metadata.gz: 4e5caa243016431428f00c29a14ed7437afab21e0e3560b366e8e64152596479e0394735e142669a7c6019c983d980cd6b9bec1b5ba09ae3c3a7c745a35ed287
7
- data.tar.gz: bc4d072cc0ea013fbcf828b2421111d387e26a3e11413d34db1a614388f325b4a585fda98920af36ee932fc76dac76871fbf177a073711d0b07310c526daa3e8
6
+ metadata.gz: 8104f50041913ea06f3ff64be43d1a0b428494077239899683c4a5f662641707c85e81099b3dc2e8f2354ab1cbe857ccb4a8664ab82a0706630fc4f6908a18bd
7
+ data.tar.gz: 3277b1888a740c362b9789daa9c2adc3835841c360c5f2e4fb87eae8b1e8a329a8c51105f536e185b75fded1f8044559625a627201c4aeaf863c6d524400e7ac
@@ -1,6 +1,4 @@
1
1
  module StellarBase
2
2
  class ApplicationOperation < Trailblazer::Operation
3
-
4
3
  end
5
-
6
4
  end
@@ -42,7 +42,7 @@ module StellarBase
42
42
  def determine_max_amount!(options, params:, **)
43
43
  details = params[:deposit_asset_details]
44
44
  options["model"].max_amount =
45
- ConfiguredClassRunner.(details[:max_amount_from])
45
+ ConfiguredClassRunner.(details[:max_amount_from]) || 0
46
46
  end
47
47
 
48
48
  def set_defaults!(options, params:, **)
@@ -26,7 +26,6 @@ module StellarBase
26
26
  def find_withdrawal_asset_details!(options, params:, **)
27
27
  details = FindWithdrawableAsset
28
28
  .(params[:withdrawal_request][:asset_code])
29
-
30
29
  params[:withdrawal_asset_details] = details.presence || {}
31
30
  end
32
31
 
@@ -2,7 +2,8 @@ module StellarBase
2
2
  class DepositController < ApplicationController
3
3
 
4
4
  def create
5
- op = DepositRequests::Operations::Create.(deposit_request: params)
5
+ op = DepositRequests::Operations::Create
6
+ .(deposit_request: deposit_params)
6
7
 
7
8
  respond_to do |f|
8
9
  f.json do
@@ -20,5 +21,18 @@ module StellarBase
20
21
  end
21
22
  end
22
23
 
24
+ private
25
+
26
+ def deposit_params
27
+ params.permit(
28
+ :account,
29
+ :asset_code,
30
+ :memo,
31
+ :memo_type,
32
+ :type,
33
+ :email_address,
34
+ ).to_hash.with_indifferent_access
35
+ end
36
+
23
37
  end
24
38
  end
@@ -2,7 +2,8 @@ module StellarBase
2
2
  class WithdrawController < ApplicationController
3
3
 
4
4
  def create
5
- op = WithdrawalRequests::Operations::Create.(withdrawal_request: params)
5
+ op = WithdrawalRequests::Operations::Create
6
+ .(withdrawal_request: withdraw_params)
6
7
 
7
8
  respond_to do |f|
8
9
  f.json do
@@ -20,5 +21,17 @@ module StellarBase
20
21
  end
21
22
  end
22
23
 
24
+ private
25
+
26
+ def withdraw_params
27
+ params.permit(
28
+ :asset_code,
29
+ :dest,
30
+ :dest_extra,
31
+ :fee_network,
32
+ :type,
33
+ ).to_hash.with_indifferent_access
34
+ end
35
+
23
36
  end
24
37
  end
@@ -1,3 +1,3 @@
1
1
  module StellarBase
2
- VERSION = "0.6.0".freeze
2
+ VERSION = "0.6.1".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: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Subido
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-27 00:00:00.000000000 Z
11
+ date: 2018-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: disposable