istox 0.2.8 → 0.2.9
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/lib/istox/helpers/blockchain_service.rb +7 -5
- data/lib/istox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b906e9dbba05e70feaf86f32baac44406b99092e766673c68b6ea264db7a9ddc
|
|
4
|
+
data.tar.gz: 1170ef8daccda9dceb671598f3ebb74e9071fc6e142ba4c0aa90c35aa21fc22f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a1f9dc10064f5527c503564078a02a7a6a219e57a03f6c152653f66e79050005cc0404bd639b8f18f870184811e3c0c2e874b45e73723e89b19c9f1fc0bfa10c
|
|
7
|
+
data.tar.gz: 6a604074785ecbcb31e10bbc37230f1ad7290aa7315c6b02b1c5ab14c4d0c8a572c441ae291c53e61ca31a87939fa12b4bfceb472f8bb08b38921d4c9aa15c66
|
|
@@ -8,18 +8,18 @@ module Istox
|
|
|
8
8
|
@@blockchain_receipt_klass
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.request(sid:, action:, before:,
|
|
12
|
-
start(sid: sid, action: action, before: before, execute: execute, is_request: true, request_reason: request_reason)
|
|
11
|
+
def self.request(sid:, action:, before:, execute:, before_start: nil, request_reason: nil)
|
|
12
|
+
start(sid: sid, action: action, before: before, before_start: before_start, execute: execute, is_request: true, request_reason: request_reason)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.run(sid:, action:, before:, execute:)
|
|
16
|
-
start(sid: sid, action: action, before: before, execute: execute)
|
|
15
|
+
def self.run(sid:, action:, before:, execute:, before_start: nil)
|
|
16
|
+
start(sid: sid, action: action, before: before, before_start: before_start, execute: execute)
|
|
17
17
|
end
|
|
18
18
|
class << self
|
|
19
19
|
private
|
|
20
20
|
|
|
21
21
|
# before is the proc that will be executed before, must return the main model blockchain receipt will bind to
|
|
22
|
-
def start(sid:, action:, before:, execute:, is_request: false, request_reason: nil)
|
|
22
|
+
def start(sid:, action:, before:, execute:, before_start: nil, is_request: false, request_reason: nil)
|
|
23
23
|
# create blockchain receipt first
|
|
24
24
|
klass = blockchain_receipt_class
|
|
25
25
|
uuid = ::SecureRandom.uuid
|
|
@@ -33,6 +33,8 @@ module Istox
|
|
|
33
33
|
|
|
34
34
|
chainhub_processing = true
|
|
35
35
|
|
|
36
|
+
before_start.call(uuid) if before_start.present?
|
|
37
|
+
|
|
36
38
|
::ActiveRecord::Base.transaction do
|
|
37
39
|
# execute before proc, and get the model that blockchain receipt should bind to
|
|
38
40
|
model = before.call(uuid)
|
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.2.
|
|
4
|
+
version: 0.2.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Siong Leng
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-06-
|
|
11
|
+
date: 2021-06-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: amazing_print
|