stellar_base-rails 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecb3cdd428227714bb071c59f1ac3b40c85f131522f376363fc0722aa1272a71
4
- data.tar.gz: 023c9c4dcf96b9a0d87a7cfb81d6059b987bc81bb5d4f3f2d82361db201db183
3
+ metadata.gz: 41b8211660e2ba9849bf8f5a247fd388339864a234c564633b3d8c285060b3fb
4
+ data.tar.gz: 9c7acced470d828762a303873c9d22e6b14161320ccf09b09da1b14a51faeebb
5
5
  SHA512:
6
- metadata.gz: 9a205a0ec92f9c2b6de8bcddb9e02cff60122318039c537912844666ffdf4bd1cfe94f16343b63d2a45bf3215059d5af5daba40af2b2a72161c38e7099efe9d1
7
- data.tar.gz: 4aa5d187e3f65f1a77b6a643aed6ca9b8ce76bbe04666342c2093f9fad2a7a67eebe657bfa4c28f3b5527fae5455af717e68c07565a481d2938d79fc3ec9f574
6
+ metadata.gz: 064d30d29693383dc5a63a70a64ee2218ca58ddfd6f1965c9f3564e5784edd880b7d60e841c5048193d51b0f55edcfff22c5e06ea847fdb318984ed3ef1f6772
7
+ data.tar.gz: 76ab21c6ac5bc40dda0f2ded2a3e1cd5cf65398be344e41608df1856acea0f58cb575476e1dba5185b52f7ecae5b6063398925ad40430eb929691b93d325948f
@@ -3,7 +3,42 @@ module StellarBase
3
3
 
4
4
  include Virtus.model
5
5
 
6
- attribute :TRANSFER_SERVER, String, default: ""
6
+ attribute :ACCOUNTS, Array
7
+ attribute :AUTH_SERVER, String
8
+ attribute :CURRENCIES, Array
9
+ attribute :DESIRED_BASE_FEE, Integer
10
+ attribute :DESIRED_MAX_TX_PER_LEDGER, Integer
11
+ attribute :FEDERATION_SERVER, String
12
+ attribute :HISTORY, Array
13
+ attribute :KNOWN_PEERS, Array
14
+ attribute :NODE_NAMES, Array
15
+ attribute :OUR_VALIDATORS, Array
16
+ attribute :QUORUM_SET, Array
17
+ attribute :SIGNING_KEY, String
18
+ attribute :TRANSFER_SERVER, String
19
+
20
+ ATTRIBUTES = %w[
21
+ ACCOUNTS
22
+ AUTH_SERVER
23
+ CURRENCIES
24
+ DESIRED_BASE_FEE
25
+ DESIRED_MAX_TX_PER_LEDGER
26
+ FEDERATION_SERVER
27
+ HISTORY
28
+ KNOWN_PEERS
29
+ NODE_NAMES
30
+ OUR_VALIDATORS
31
+ QUORUM_SET
32
+ SIGNING_KEY
33
+ TRANSFER_SERVER
34
+ ].freeze
35
+
36
+ def to_hash
37
+ ATTRIBUTES.each_with_object({}) do |attr, hash|
38
+ value = send(attr)
39
+ hash[attr] = send(attr) if value.present?
40
+ end
41
+ end
7
42
 
8
43
  end
9
44
  end
@@ -24,15 +24,20 @@ module StellarBase
24
24
 
25
25
  Rails.logger.info(msg)
26
26
 
27
- # TODO: handle when this fails
28
- response = c.stellar_sdk_client.send_payment(
29
- from: c.distribution_account,
30
- to: c.recipient_account,
31
- amount: c.stellar_amount,
32
- memo: c.deposit_request.memo,
33
- )
27
+ begin
28
+ response = c.stellar_sdk_client.send_payment(
29
+ from: c.distribution_account,
30
+ to: c.recipient_account,
31
+ amount: c.stellar_amount,
32
+ memo: c.deposit_request.memo,
33
+ )
34
34
 
35
- c.stellar_tx_id = response.to_hash["hash"]
35
+ c.stellar_tx_id = response.to_hash["hash"]
36
+ rescue Faraday::ClientError => e
37
+ c.fail!
38
+ c.skip_remaining! "Error sending the asset. " \
39
+ "Faraday::ClientError: #{e.message}"
40
+ end
36
41
  end
37
42
 
38
43
  end
@@ -9,8 +9,9 @@ module StellarBase
9
9
  end
10
10
 
11
11
  initializer "register.mime_types" do
12
- return if Mime::Type.lookup_by_extension("toml").present?
13
- Mime::Type.register "application/toml", :toml
12
+ if Mime::Type.lookup_by_extension("toml").blank?
13
+ Mime::Type.register "application/toml", :toml
14
+ end
14
15
  end
15
16
 
16
17
  config.generators do |g|
@@ -1,3 +1,3 @@
1
1
  module StellarBase
2
- VERSION = "0.7.0".freeze
2
+ VERSION = "0.7.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stellar_base-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Subido