Skip to content

Commit 856ae24

Browse files
authored
Merge branch 'master' into android_arm_fix
2 parents 7c5d071 + f58e5fd commit 856ae24

File tree

174 files changed

+13629
-14471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+13629
-14471
lines changed

Jenkinsfile.cd

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,12 @@ def linuxTesting(file, env_name, network_name, stashBuildResults) {
171171

172172
try {
173173
def libindyFeatures = "--features sodium_static"
174+
def libindyBuildFeatures = "--features \"fatal_warnings sodium_static\""
174175

175176
echo "${env_name} Libindy Test: Build"
177+
sh "RUST_BACKTRACE=1 cargo build --release $libindyBuildFeatures"
178+
179+
echo "${env_name} Libindy Test: Build tests"
176180
sh "RUST_BACKTRACE=1 cargo test --release --no-run $libindyFeatures"
177181

178182
echo "${env_name} Libindy Test: Run tests"
@@ -235,7 +239,7 @@ def linuxTesting(file, env_name, network_name, stashBuildResults) {
235239
dir('cli') {
236240
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
237241
echo "${env_name} Indy Cli Test: Build"
238-
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo build --release"
242+
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo build --release --features fatal_warnings"
239243

240244
echo "${env_name} Indy Cli Test: Build Tests"
241245
sh 'LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --release --features "nullpay_plugin" --no-run'
@@ -286,7 +290,7 @@ def windowsTesting() {
286290
"PATH=$WORKSPACE\\libindy\\prebuilt\\lib;$PATH",
287291
"RUST_BACKTRACE=1"
288292
]) {
289-
bat "cargo build --release"
293+
bat "cargo build --release --features fatal_warnings"
290294
bat "cargo test --release --no-run"
291295

292296
echo "Windows Libindy Test: Run tests"
@@ -306,7 +310,7 @@ def windowsTesting() {
306310
withEnv([
307311
"RUST_BACKTRACE=1"
308312
]) {
309-
bat "cargo build --release"
313+
bat "cargo build --release --features fatal_warnings"
310314
bat "cargo test --release --no-run"
311315

312316
echo "Windows Libnullpay Test: Run tests"
@@ -334,7 +338,7 @@ def windowsTesting() {
334338
withEnv([
335339
"RUST_BACKTRACE=1"
336340
]) {
337-
bat "cargo build --release"
341+
bat "cargo build --release --features fatal_warnings"
338342

339343
echo "Windows Indy Cli Test: Build tests"
340344
bat "cargo test --release $featuresArgs --no-run"

Jenkinsfile.ci

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def windowsTesting() {
4545
"PATH=$WORKSPACE\\libindy\\prebuilt\\lib;$PATH",
4646
"RUST_BACKTRACE=1"
4747
]) {
48-
bat "cargo build"
48+
bat "cargo build --features fatal_warnings"
4949
bat "cargo test --no-run"
5050

5151
echo "Windows Libindy Test: Run tests"
@@ -64,7 +64,7 @@ def windowsTesting() {
6464
withEnv([
6565
"RUST_BACKTRACE=1"
6666
]) {
67-
bat "cargo build"
67+
bat "cargo build --features fatal_warnings"
6868
bat "cargo test --no-run"
6969

7070
echo "Windows Libnullpay Test: Run tests"
@@ -133,7 +133,7 @@ def macosTesting() {
133133
echo "MacOS Test: Build"
134134
setupRust()
135135
setupBrewPackages()
136-
sh "cargo build"
136+
sh "cargo build --features fatal_warnings"
137137
sh "cargo test --no-run"
138138
// TODO testing
139139
}
@@ -226,15 +226,15 @@ def linuxTesting(file, env_name, network_name) {
226226
poolInst = openPool(env_name, network_name)
227227

228228
def testEnv
229-
def libindyFeatures = "--features sodium_static"
229+
def additionalFeatures = "sodium_static"
230230

231231
dir('libindy') {
232232
echo "${env_name} Libindy Test: Build docker image"
233233
testEnv = dockerBuild('libindy', file)
234234

235235
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
236236
echo "${env_name} Libindy Test: Build"
237-
sh "cargo build $libindyFeatures"
237+
sh "cargo build --features \"fatal_warnings $additionalFeatures\""
238238
}
239239
}
240240

@@ -249,7 +249,7 @@ def linuxTesting(file, env_name, network_name) {
249249

250250
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
251251
echo "${env_name} Libnullpay Test: Build"
252-
sh "LIBRARY_PATH=./ cargo build"
252+
sh "LIBRARY_PATH=./ cargo build --features fatal_warnings"
253253
}
254254
}
255255

@@ -268,10 +268,10 @@ def linuxTesting(file, env_name, network_name) {
268268
echo "${env_name} Libindy Test: Test"
269269

270270
echo "${env_name} Libindy Test: Build Test"
271-
sh "RUST_BACKTRACE=1 cargo test --no-run $libindyFeatures"
271+
sh "RUST_BACKTRACE=1 cargo test --no-run --features $additionalFeatures"
272272

273273
echo "${env_name} Libindy Test: Run tests"
274-
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test $libindyFeatures"
274+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --features $additionalFeatures"
275275
}
276276
}
277277
},

ci/indy-pool.dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ RUN pip3 install -U \
1919
setuptools
2020

2121
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
22-
ARG indy_stream=master
22+
ARG indy_stream=stable
2323
RUN echo "deb https://repo.sovrin.org/deb xenial $indy_stream" >> /etc/apt/sources.list
2424

2525
RUN useradd -ms /bin/bash -u $uid indy
2626

27-
ARG indy_plenum_ver=1.4.419
28-
ARG indy_anoncreds_ver=1.0.32
29-
ARG indy_node_ver=1.4.480
27+
ARG indy_plenum_ver=1.4.45
28+
ARG indy_anoncreds_ver=1.0.11
29+
ARG indy_node_ver=1.4.66
3030
ARG python3_indy_crypto_ver=0.4.1
3131
ARG indy_crypto_ver=0.4.0
3232

cli/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ authors = ["Vyacheslav Gudkov <[email protected]>"]
66
[features]
77
nullpay_plugin = []
88

9+
# Causes the build to fail on all warnings
10+
fatal_warnings = []
11+
912
[dependencies]
1013
ansi_term = "0.10"
1114
chrono = "0.4"
@@ -22,4 +25,4 @@ serde = "1.0"
2225
serde_json = "1.0"
2326
serde_derive = "1.0"
2427
term = "0.4.6"
25-
rpassword = "1.0.0"
28+
rpassword = "1.0.0"

cli/src/commands/ledger.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ pub mod get_validator_info_command {
357357
};
358358

359359
for (node, response) in responses {
360+
if response.eq("timeout") {
361+
println_err!("Restart pool node {} timeout.", node);
362+
continue
363+
}
360364
let response = serde_json::from_str::<Response<serde_json::Value>>(&response)
361365
.map_err(|err| println_err!("Invalid data has been received: {:?}", err))?;
362366
println_succ!("Get validator info response for node {}:", node);
@@ -687,6 +691,11 @@ pub mod pool_restart_command {
687691
};
688692

689693
for (node, response) in responses {
694+
if response.eq("timeout") {
695+
println_err!("Restart pool node {} timeout.", node);
696+
continue
697+
}
698+
690699
let response = serde_json::from_str::<Response<serde_json::Value>>(&response)
691700
.map_err(|err| println_err!("Invalid data has been received: {:?}", err))?;
692701

cli/src/commands/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ pub fn get_object_param<'a>(name: &'a str, params: &'a CommandParams) -> Result<
117117
}
118118
}
119119

120+
pub fn get_opt_object_param<'a>(name: &'a str, params: &'a CommandParams) -> Result<Option<serde_json::Value>, ()> {
121+
match params.get(name) {
122+
Some(_) => Ok(Some(get_object_param(name, params)?)),
123+
None => Ok(None)
124+
}
125+
}
126+
120127
fn extract_array_tuples<'a>(param: &'a str) -> Vec<String> {
121128
let re = Regex::new(r#"\(([^\(\)]+)\),?"#).unwrap();
122129
re.captures_iter(param).map(|c| c[1].to_string()).collect::<Vec<String>>()

cli/src/commands/pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub mod connect_command {
121121
match Pool::close(handle) {
122122
Ok(()) => {
123123
set_connected_pool(ctx, Some((handle, name.to_owned())));
124-
println_succ!("Pool \"{}\" has been connected", name)
124+
println_succ!("Pool \"{}\" has been disconnected", name)
125125
}
126126
Err(err) => println_err!("Indy SDK error occurred {:?}", err),
127127
}
@@ -576,4 +576,4 @@ pub mod tests {
576576
let pools = Pool::list().unwrap();
577577
serde_json::from_str(&pools).unwrap()
578578
}
579-
}
579+
}

0 commit comments

Comments
 (0)