stellar_base-rails 0.9.3 → 0.9.4

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: 758197b73291b263eee2ec794d64e1a50c4e458c8a1c91eac7821086e47b519e
4
- data.tar.gz: d4abc71798b5e3c895666ac311cce6c527f45e3df4a616f20f02c98f220e3e14
3
+ metadata.gz: daf57d4638bce982bb6b23643076ff41a55736075cc25f2d63aaa017734aee75
4
+ data.tar.gz: 109f46abe1d4ad4d67eed41da9f9aea91fe58dd4ef304f7766c752173c2b48eb
5
5
  SHA512:
6
- metadata.gz: 6b6f3ab80f269c9856a2395b4b3955b1fa20ac5d799fc47a0b9d376c000fcc0d93cc45c7c0f37ff2b10c4402b22f8334fb359067eb28d94b849baef330200b52
7
- data.tar.gz: fa633c03daf388626dadc073fc911d60bf26106dbaf77beacfe2edd0a96e98c927c5c6b688e4fcc9c54a3a1fd93c375070a34bc25d8614e762c4793406a1cabc
6
+ metadata.gz: 4d5e0a3825cb8d458d3a3c0809c2bb2fcc1cef1d5b8f57d02c00e563bc8c6888c715679a36d7742877f4622567031335537d39148fff9a59e74816db79954c1e
7
+ data.tar.gz: 2270ff9426d82c80d32e6fcffefde2c120cffc63b3fa849d8387eaccad177fb149be300471015d568f5377b3159bf0ed69daf51f15e0f189dccc2b3a1e80aa19
@@ -13,12 +13,13 @@ module StellarBase
13
13
 
14
14
  address = c.account_subscription.address
15
15
 
16
- c.cursor = c.stellar_sdk_client.horizon.
17
- account(account_id: address).
18
- operations(order: "desc", limit: 1).records.first.id
16
+ c.cursor = c.stellar_sdk_client.horizon
17
+ .account(account_id: address)
18
+ .operations(order: "desc", limit: 1).records.first.id
19
19
 
20
20
  rescue Faraday::ClientError => e
21
- c.fail_and_return! "Skipping fetching cursor of #{address} due to #{e.inspect}"
21
+ c.fail_and_return! "Skipping fetching cursor of #{address} " \
22
+ "due to #{e.inspect}"
22
23
  end
23
24
 
24
25
  end
@@ -12,9 +12,17 @@ module StellarBase
12
12
  promises :operations
13
13
 
14
14
  executed do |c|
15
- c.operations = c.stellar_sdk_client.horizon.
16
- account(account_id: c.account_subscription.address).
17
- operations(order: "asc", limit: c.operation_limit).records
15
+ c.operations = c.stellar_sdk_client.horizon
16
+ .account(account_id: c.account_subscription.address)
17
+ .operations(order: "asc", limit: c.operation_limit).records
18
+
19
+ if c.operations.empty?
20
+ c.fail_and_return! "No operations found " \
21
+ "for #{c.account_subscription.address}"
22
+ end
23
+ rescue Faraday::ClientError => e
24
+ c.fail_and_return! "Skipping fetching operations of #{address} " \
25
+ "due to #{e.inspect}"
18
26
  end
19
27
 
20
28
  end
@@ -5,10 +5,13 @@ module StellarBase
5
5
  OPERATION_LIMIT = 200
6
6
 
7
7
  def self.call(account_subscription, operation_limit: OPERATION_LIMIT)
8
- with(
8
+ result = with(
9
9
  account_subscription: account_subscription,
10
10
  operation_limit: operation_limit,
11
11
  ).reduce(actions)
12
+
13
+ Rails.logger.warn result.message if result.failure?
14
+ result
12
15
  end
13
16
 
14
17
  def self.actions
@@ -19,8 +22,8 @@ module StellarBase
19
22
  iterate(:operations, [
20
23
  AccountSubscriptions::GetTx,
21
24
  AccountSubscriptions::ExecuteCallback,
22
- AccountSubscriptions::SaveCursor,
23
25
  ]),
26
+ AccountSubscriptions::SaveCursor,
24
27
  ]
25
28
  end
26
29
 
@@ -1,3 +1,3 @@
1
1
  module StellarBase
2
- VERSION = "0.9.3".freeze
2
+ VERSION = "0.9.4".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.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Subido
@@ -463,7 +463,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
463
463
  version: '0'
464
464
  requirements: []
465
465
  rubyforge_project:
466
- rubygems_version: 2.7.7
466
+ rubygems_version: 2.7.6
467
467
  signing_key:
468
468
  specification_version: 4
469
469
  summary: Mountable Stellar API Endpoints for Rails