Skip to content

Commit 79c7229

Browse files
committed
Reverted indy_pool dockerfile. Simplified getting reqId
Signed-off-by: artem.ivanov <[email protected]>
1 parent 1555af7 commit 79c7229

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

Jenkinsfile.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def iosTesting() {
155155

156156
echo "iOS Test: Running pool"
157157
sh "docker rm -f indy_pool || true"
158-
sh "docker build --build-arg client_ip=0.0.0.0 -f ci/indy-pool.dockerfile -t indy_pool ci"
158+
sh "docker build -f ci/indy-pool.dockerfile -t indy_pool ci"
159159
sh "docker run -d --name indy_pool -p 9701-9708:9701-9708 indy_pool"
160160

161161
setupRust()

ci/indy-pool.dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ RUN apt-get update -y && apt-get install -y \
3838
libindy-crypto=${indy_crypto_ver} \
3939
vim
4040

41-
ARG pool_ip=127.0.0.1
42-
ARG client_ip=$pool_ip
43-
44-
ENV CLIENT_IP=$client_ip
45-
4641
RUN echo "[supervisord]\n\
4742
logfile = /tmp/supervisord.log\n\
4843
logfile_maxbytes = 50MB\n\
@@ -61,25 +56,25 @@ childlogdir = /tmp\n\
6156
strip_ansi = false\n\
6257
\n\
6358
[program:node1]\n\
64-
command=start_indy_node Node1 %(ENV_CLIENT_IP)s 9701 %(ENV_CLIENT_IP)s 9702\n\
59+
command=start_indy_node Node1 0.0.0.0 9701 0.0.0.0 9702\n\
6560
directory=/home/indy\n\
6661
stdout_logfile=/tmp/node1.log\n\
6762
stderr_logfile=/tmp/node1.log\n\
6863
\n\
6964
[program:node2]\n\
70-
command=start_indy_node Node2 %(ENV_CLIENT_IP)s 9703 %(ENV_CLIENT_IP)s 9704\n\
65+
command=start_indy_node Node2 0.0.0.0 9703 0.0.0.0 9704\n\
7166
directory=/home/indy\n\
7267
stdout_logfile=/tmp/node2.log\n\
7368
stderr_logfile=/tmp/node2.log\n\
7469
\n\
7570
[program:node3]\n\
76-
command=start_indy_node Node3 %(ENV_CLIENT_IP)s 9705 %(ENV_CLIENT_IP)s 9706\n\
71+
command=start_indy_node Node3 0.0.0.0 9705 0.0.0.0 9706\n\
7772
directory=/home/indy\n\
7873
stdout_logfile=/tmp/node3.log\n\
7974
stderr_logfile=/tmp/node3.log\n\
8075
\n\
8176
[program:node4]\n\
82-
command=start_indy_node Node4 %(ENV_CLIENT_IP)s 9707 %(ENV_CLIENT_IP)s 9708\n\
77+
command=start_indy_node Node4 0.0.0.0 9707 0.0.0.0 9708\n\
8378
directory=/home/indy\n\
8479
stdout_logfile=/tmp/node4.log\n\
8580
stderr_logfile=/tmp/node4.log\n"\
@@ -90,6 +85,8 @@ USER indy
9085
RUN awk '{if (index($1, "NETWORK_NAME") != 0) {print("NETWORK_NAME = \"sandbox\"")} else print($0)}' /etc/indy/indy_config.py> /tmp/indy_config.py
9186
RUN mv /tmp/indy_config.py /etc/indy/indy_config.py
9287

88+
ARG pool_ip=127.0.0.1
89+
9390
RUN generate_indy_pool_transactions --nodes 4 --clients 5 --nodeNum 1 2 3 4 --ips="$pool_ip,$pool_ip,$pool_ip,$pool_ip"
9491

9592
EXPOSE 9701 9702 9703 9704 9705 9706 9707 9708

libnullpay/src/services/response_storage.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,8 @@ pub fn get_response(response: &str) -> Result<String, ErrorCode> {
2525
let val = str_to_val(response)?;
2626

2727
let req_id = match val["result"]["ver"].as_str() {
28-
Some("1") =>
29-
val.get("result")
30-
.and_then(|result| result.as_object())
31-
.and_then(|result| result.get("txn"))
32-
.and_then(|txn| txn.as_object())
33-
.and_then(|txn| txn.get("metadata"))
34-
.and_then(|metadata| metadata.as_object())
35-
.and_then(|metadata| metadata.get("reqId"))
36-
.and_then(|req_id| req_id.as_i64()),
37-
None =>
38-
val.get("result")
39-
.and_then(|result| result.as_object())
40-
.and_then(|result| result.get("reqId"))
41-
.and_then(|req_id| req_id.as_i64()),
28+
Some("1") => val["result"]["txn"]["metadata"]["reqId"].as_i64(),
29+
None => val["result"]["reqId"].as_i64(),
4230
_ => return Err(ErrorCode::CommonInvalidState)
4331
};
4432

0 commit comments

Comments
 (0)