tezos_client 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/tezos_client/operation_mgr.rb +16 -14
- data/lib/tezos_client/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: c7de27ae0b52ebd19a4fd74e3407aaa54fcdbcdc7b542039254618cf58c94baa
|
4
|
+
data.tar.gz: 6b4dae6eb590b8e3b54ef27086d873e2fbf83c7bf83406ed417e8f0fa9fcfb0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e94b9ab12a4616933d9ed59ad83d55087ee70e566972eb4153bf70f4b43ae6825bf790b8a5a890c2ea2969d51be481d89f09e501fbabed18eaa737648d07b6ee
|
7
|
+
data.tar.gz: bcf9bf6ee40167ea0be0064f5b5f0e526673309389505ef1b504070accb35d454d8eb03bb5c2e2a973f2cf1243c9f3d35679b22f73bd0799d321773984a0c092
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tezos_client (0.4.
|
4
|
+
tezos_client (0.4.4)
|
5
5
|
activesupport (~> 5.2.0)
|
6
6
|
base58 (~> 0.2.3)
|
7
7
|
bip_mnemonic (~> 0.0.2)
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
safe_yaml (~> 1.0.0)
|
43
43
|
crass (1.0.4)
|
44
44
|
diff-lcs (1.3)
|
45
|
-
domain_name (0.5.
|
45
|
+
domain_name (0.5.20190701)
|
46
46
|
unf (>= 0.0.5, < 1.0.0)
|
47
47
|
erubi (1.8.0)
|
48
48
|
ffi (1.11.1)
|
@@ -96,9 +96,10 @@ class TezosClient
|
|
96
96
|
consumed_storage = 0
|
97
97
|
consumed_gas = 0
|
98
98
|
|
99
|
+
ensure_applied!(rpc_responses)
|
100
|
+
|
99
101
|
operations_result = rpc_responses.map do |rpc_response|
|
100
102
|
metadata = rpc_response[:metadata]
|
101
|
-
ensure_applied!(metadata)
|
102
103
|
consumed_storage += compute_consumed_storage(metadata)
|
103
104
|
consumed_gas += compute_consumed_gas(metadata)
|
104
105
|
metadata[:operation_result]
|
@@ -135,9 +136,7 @@ class TezosClient
|
|
135
136
|
protocol: protocol,
|
136
137
|
branch: branch)
|
137
138
|
|
138
|
-
rpc_responses
|
139
|
-
ensure_applied!(rpc_response[:metadata])
|
140
|
-
end
|
139
|
+
ensure_applied!(rpc_responses)
|
141
140
|
end
|
142
141
|
|
143
142
|
def broadcast
|
@@ -146,25 +145,28 @@ class TezosClient
|
|
146
145
|
|
147
146
|
private
|
148
147
|
|
149
|
-
def ensure_applied!(
|
150
|
-
|
148
|
+
def ensure_applied!(rpc_responses)
|
149
|
+
operation_results = rpc_responses.map { |response| response[:metadata][:operation_result] }
|
151
150
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
151
|
+
failed = operation_results.detect do |operation_result|
|
152
|
+
operation_result != nil && operation_result[:status] != "applied"
|
153
|
+
end
|
154
|
+
|
155
|
+
return operation_results if failed.nil?
|
156
|
+
|
157
|
+
failed_operation_result = operation_results.detect do |operation_result|
|
158
|
+
operation_result[:status] == "failed"
|
157
159
|
end
|
158
160
|
|
159
|
-
|
161
|
+
failed!("failed", failed_operation_result[:errors], operation_results)
|
160
162
|
end
|
161
163
|
|
162
164
|
def exception_klass(errors)
|
163
165
|
error = errors[0]
|
164
166
|
case error[:id]
|
165
|
-
when
|
167
|
+
when /proto\.[^.]*\.contract\.balance_too_low/
|
166
168
|
TezBalanceTooLow
|
167
|
-
when
|
169
|
+
when /proto\.[^.]*\.scriptRuntimeError/
|
168
170
|
ScriptRuntimeError
|
169
171
|
else
|
170
172
|
OperationFailure
|
data/lib/tezos_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tezos_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Michard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|