istox 0.1.157.9 → 0.1.157.11.t3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -9
- data/lib/istox/consumers/blockchain_status_handler.rb +6 -1
- data/lib/istox/helpers/grpc_client.rb +6 -1
- data/lib/istox/helpers/messaging.rb +19 -1
- data/lib/istox/helpers/sns_publisher.rb +3 -3
- data/lib/istox/helpers/xray/grpc_client_xray_interceptor.rb +1 -0
- data/lib/istox/helpers/xray/grpc_server_xray_interceptor.rb +1 -0
- data/lib/istox/helpers/xray/rabbitmq_consumer_interceptor.rb +1 -0
- data/lib/istox/helpers/xray/rabbitmq_publisher_interceptor.rb +1 -0
- data/lib/istox/version.rb +1 -1
- metadata +4 -12
- data/.idea/.rakeTasks +0 -7
- data/.idea/encodings.xml +0 -4
- data/.idea/inspectionProfiles/Project_Default.xml +0 -6
- data/.idea/istox-gem.iml +0 -12
- data/.idea/misc.xml +0 -7
- data/.idea/modules.xml +0 -8
- data/.idea/vcs.xml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4282ef0f35cbc41d434a4091c8d2290d07b7c02b9f0c1203e4bb353404661847
|
4
|
+
data.tar.gz: 7f4facd50bc4565d655bdb9992a75be5efd3f02352e8230dd6c46ace27990bea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9af15c57ca57403f096db70bb01ea88d110044611d51f73f40ee3c18fc5793e265b63295a5fbe7315976ed3a8e16327edcbd348c341d69c71fadf8ecea684151
|
7
|
+
data.tar.gz: 7167181aa5194f62989970c4a656928fd8de6532bd2002965c4c7e6a4172cdb577e6b66e240f19238a9a716300e59294dec74ad8687ef689feaa7e7d2e97af0b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
istox (0.1.157.
|
4
|
+
istox (0.1.157.9)
|
5
5
|
amazing_print
|
6
6
|
awesome_print
|
7
7
|
aws-sdk-sns (~> 1)
|
@@ -86,14 +86,13 @@ GEM
|
|
86
86
|
aws-xray-sdk (0.11.4)
|
87
87
|
aws-sdk-xray (~> 1.4.0)
|
88
88
|
multi_json (~> 1)
|
89
|
-
bigdecimal (2.0.0)
|
90
89
|
binding_of_caller (0.8.0)
|
91
90
|
debug_inspector (>= 0.0.1)
|
92
91
|
builder (3.2.4)
|
93
92
|
bullet (5.7.6)
|
94
93
|
activesupport (>= 3.0.0)
|
95
94
|
uniform_notifier (~> 1.11.0)
|
96
|
-
bunny (2.
|
95
|
+
bunny (2.17.0)
|
97
96
|
amq-protocol (~> 2.3, >= 2.3.1)
|
98
97
|
byebug (11.1.3)
|
99
98
|
coderay (1.1.2)
|
@@ -127,14 +126,14 @@ GEM
|
|
127
126
|
faraday (>= 1.0)
|
128
127
|
faraday_middleware
|
129
128
|
graphql-client
|
130
|
-
graphql (1.11.
|
129
|
+
graphql (1.11.4)
|
131
130
|
graphql-client (0.16.0)
|
132
131
|
activesupport (>= 3.0)
|
133
132
|
graphql (~> 1.8)
|
134
|
-
grpc (1.
|
135
|
-
google-protobuf (~> 3.
|
133
|
+
grpc (1.32.0-universal-darwin)
|
134
|
+
google-protobuf (~> 3.13)
|
136
135
|
googleapis-common-protos-types (~> 1.0)
|
137
|
-
grpc-tools (1.
|
136
|
+
grpc-tools (1.32.0)
|
138
137
|
gruf (2.8.1)
|
139
138
|
activesupport (> 4)
|
140
139
|
concurrent-ruby (> 1)
|
@@ -171,8 +170,7 @@ GEM
|
|
171
170
|
nio4r (2.3.1)
|
172
171
|
nokogiri (1.10.9)
|
173
172
|
mini_portile2 (~> 2.4.0)
|
174
|
-
oj (3.10.
|
175
|
-
bigdecimal (~> 2.0)
|
173
|
+
oj (3.10.14)
|
176
174
|
ougai (1.8.5)
|
177
175
|
oj (~> 3.10)
|
178
176
|
paranoia (2.4.2)
|
@@ -26,7 +26,12 @@ module Istox
|
|
26
26
|
txhash: transaction.txn_hashes.present? ? transaction.txn_hashes.join(',') : nil)
|
27
27
|
|
28
28
|
resource = begin
|
29
|
-
class_eval("::#{receipt.resource_name}", __FILE__, __LINE__)
|
29
|
+
cls = class_eval("::#{receipt.resource_name}", __FILE__, __LINE__)
|
30
|
+
if cls.respond_to?('with_deleted')
|
31
|
+
cls.with_deleted.find(receipt.resource_id)
|
32
|
+
else
|
33
|
+
cls.find(receipt.resource_id)
|
34
|
+
end
|
30
35
|
rescue NameError
|
31
36
|
log.warn "Transaction bind to #{receipt.resource_name} with id #{receipt.resource_id} class not found, skipping..."
|
32
37
|
return
|
@@ -82,7 +82,12 @@ module Istox
|
|
82
82
|
|
83
83
|
log.info 'Reinitiating to grpc host at ' + host_url
|
84
84
|
t1 = Time.now
|
85
|
-
|
85
|
+
grpc_options = { hostname: host_url }
|
86
|
+
if ENV.fetch('GRPC_SSL_CERTIFICATE', false)
|
87
|
+
log.info '[INFO] Using SSL connection...'
|
88
|
+
grpc_options[:ssl_certificate] = ENV['GRPC_SSL_CERTIFICATE']
|
89
|
+
end
|
90
|
+
@@services[get_key(host_type, service)] = ::Gruf::Client.new(service: service, options: grpc_options, client_options: client_options)
|
86
91
|
log.info "Time taken for reinitiating grpc host: #{Time.now - t1} seconds"
|
87
92
|
end
|
88
93
|
|
@@ -130,7 +130,25 @@ module Istox
|
|
130
130
|
next unless ce.present?
|
131
131
|
|
132
132
|
copy_email_data = email_data.clone
|
133
|
-
|
133
|
+
|
134
|
+
# if it is just email to cc
|
135
|
+
if ce.is_a? String
|
136
|
+
copy_email_data[:email] = ce
|
137
|
+
else
|
138
|
+
# if it is a object hash
|
139
|
+
# {
|
140
|
+
# email: xxxx
|
141
|
+
# params: {
|
142
|
+
# istoxP1: xxxx,
|
143
|
+
# istoxP2: xxxx
|
144
|
+
# }
|
145
|
+
# }
|
146
|
+
next unless ce[:email].present?
|
147
|
+
|
148
|
+
copy_email_data[:email] = ce[:email]
|
149
|
+
copy_email_data = copy_email_data.merge(ce[:params])
|
150
|
+
end
|
151
|
+
|
134
152
|
copy_email_data.delete(:copy_emails)
|
135
153
|
copy_email_data_arr << copy_email_data
|
136
154
|
end
|
@@ -14,7 +14,7 @@ module Istox
|
|
14
14
|
|
15
15
|
message = JSON.generate(message) unless message.is_a? String
|
16
16
|
|
17
|
-
sns_client.publish(
|
17
|
+
sns_client.publish(topic_arn: topic_arn || ENV.fetch('SNS_CLIENT_TOPIC', ''), message: message)
|
18
18
|
|
19
19
|
log.info('Publish to SNS successfully.')
|
20
20
|
rescue StandardError => e
|
@@ -28,8 +28,8 @@ module Istox
|
|
28
28
|
def sns_client
|
29
29
|
return @sns_client if @sns_client.present?
|
30
30
|
|
31
|
-
Aws.config.update(
|
32
|
-
|
31
|
+
Aws.config.update(region: ENV.fetch('AWS_REGION', 'ap-southeast-1'),
|
32
|
+
credentials: Aws::Credentials.new(ENV.fetch('AWS_STS_ACCESS_KEY_ID'), ENV.fetch('AWS_STS_SECRET_ACCESS_KEY')))
|
33
33
|
|
34
34
|
@sns_client = Aws::SNS::Client.new(region: ENV.fetch('AWS_REGION', 'ap-southeast-1'))
|
35
35
|
end
|
@@ -22,6 +22,7 @@ module Istox
|
|
22
22
|
|
23
23
|
request_context.metadata[:xray_trace_id] = XRay.recorder.current_segment.trace_id
|
24
24
|
request_context.metadata[:xray_parent_id] = XRay.recorder.current_segment.id
|
25
|
+
Thread.current[:tracer_id] = XRay.recorder.current_segment.trace_id
|
25
26
|
|
26
27
|
result = yield
|
27
28
|
|
@@ -7,6 +7,7 @@ module Istox
|
|
7
7
|
meta = request.active_call.metadata
|
8
8
|
trace_id = (meta['xray_trace_id'] if meta.present? && meta.key?('xray_trace_id'))
|
9
9
|
parent_id = (meta['xray_parent_id'] if meta.present? && meta.key?('xray_parent_id'))
|
10
|
+
Thread.current[:tracer_id] = trace_id
|
10
11
|
|
11
12
|
XRay.recorder.begin_segment("#{::Istox::Xray::XrayInitializer.service_name}.grpc.#{request.method_key}",
|
12
13
|
trace_id: trace_id, parent_id: parent_id)
|
@@ -8,6 +8,7 @@ module Istox
|
|
8
8
|
|
9
9
|
trace_id = (payload_hash[:xray_trace_id] if payload_hash.key?(:xray_trace_id))
|
10
10
|
parent_id = (payload_hash[:xray_parent_id] if payload_hash.key?(:xray_parent_id))
|
11
|
+
Thread.current[:tracer_id] = trace_id
|
11
12
|
|
12
13
|
arr = [delivery_info[:exchange]&.downcase, delivery_info[:routing_key]&.downcase, payload_hash[:type]&.downcase].compact
|
13
14
|
|
data/lib/istox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: istox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.157.
|
4
|
+
version: 0.1.157.11.t3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|
@@ -480,14 +480,6 @@ extensions: []
|
|
480
480
|
extra_rdoc_files: []
|
481
481
|
files:
|
482
482
|
- ".gitignore"
|
483
|
-
- ".idea/.rakeTasks"
|
484
|
-
- ".idea/encodings.xml"
|
485
|
-
- ".idea/inspectionProfiles/Project_Default.xml"
|
486
|
-
- ".idea/istox-gem.iml"
|
487
|
-
- ".idea/misc.xml"
|
488
|
-
- ".idea/modules.xml"
|
489
|
-
- ".idea/vcs.xml"
|
490
|
-
- ".idea/workspace.xml"
|
491
483
|
- ".rubocop.yml"
|
492
484
|
- ".solargraph.yml"
|
493
485
|
- CODE_OF_CONDUCT.md
|
@@ -550,9 +542,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
550
542
|
version: '0'
|
551
543
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
552
544
|
requirements:
|
553
|
-
- - "
|
545
|
+
- - ">"
|
554
546
|
- !ruby/object:Gem::Version
|
555
|
-
version:
|
547
|
+
version: 1.3.1
|
556
548
|
requirements: []
|
557
549
|
rubygems_version: 3.0.6
|
558
550
|
signing_key:
|
data/.idea/.rakeTasks
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
-
You are allowed to:
|
4
|
-
1. Remove rake task
|
5
|
-
2. Add existing rake tasks
|
6
|
-
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
-
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
data/.idea/encodings.xml
DELETED
data/.idea/istox-gem.iml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
3
|
-
<component name="ModuleRunConfigurationManager">
|
4
|
-
<shared />
|
5
|
-
</component>
|
6
|
-
<component name="NewModuleRootManager">
|
7
|
-
<content url="file://$MODULE_DIR$" />
|
8
|
-
<orderEntry type="inheritedJdk" />
|
9
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
10
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.16.6, RVM: ruby-2.5.3 [global]) [gem]" level="application" />
|
11
|
-
</component>
|
12
|
-
</module>
|
data/.idea/misc.xml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="JavaScriptSettings">
|
4
|
-
<option name="languageLevel" value="ES6" />
|
5
|
-
</component>
|
6
|
-
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.5.3 [global]" project-jdk-type="RUBY_SDK" />
|
7
|
-
</project>
|
data/.idea/modules.xml
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ProjectModuleManager">
|
4
|
-
<modules>
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/istox-gem.iml" filepath="$PROJECT_DIR$/.idea/istox-gem.iml" />
|
6
|
-
</modules>
|
7
|
-
</component>
|
8
|
-
</project>
|