Skip to content

Commit 8409f43

Browse files
committed
Merge
Signed-off-by: Michael Lodder <[email protected]>
2 parents a3580fa + ac3a94e commit 8409f43

File tree

464 files changed

+20574
-15738
lines changed

Some content is hidden

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

464 files changed

+20574
-15738
lines changed

Jenkinsfile.cd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,13 @@ def linuxTesting(file, env_name, network_name, stashBuildResults) {
170170
echo "${env_name} Test: Test"
171171

172172
try {
173+
def libindyFeatures = "--features sodium_static"
174+
173175
echo "${env_name} Libindy Test: Build"
174-
sh "RUST_BACKTRACE=1 cargo test --release --no-run"
176+
sh "RUST_BACKTRACE=1 cargo test --release --no-run $libindyFeatures"
175177

176178
echo "${env_name} Libindy Test: Run tests"
177-
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release"
179+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release $libindyFeatures"
178180

179181
if (stashBuildResults) {
180182
stash includes: 'target/release/libindy.so,target/release/libindy.a', name: 'LibindyUbuntuBuildResult'
@@ -705,5 +707,5 @@ def downloadPackagingUtils() {
705707
}
706708

707709
def setupRust() {
708-
sh "rustup default 1.25.0"
710+
sh "rustup default 1.26.0"
709711
}

Jenkinsfile.ci

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,15 @@ def linuxTesting(file, env_name, network_name) {
220220
poolInst = openPool(env_name, network_name)
221221

222222
def testEnv
223+
def libindyFeatures = "--features sodium_static"
223224

224225
dir('libindy') {
225226
echo "${env_name} Libindy Test: Build docker image"
226227
testEnv = dockerBuild('libindy', file)
227228

228229
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
229230
echo "${env_name} Libindy Test: Build"
230-
sh "cargo build"
231+
sh "cargo build $libindyFeatures"
231232
}
232233
}
233234

@@ -259,10 +260,10 @@ def linuxTesting(file, env_name, network_name) {
259260
echo "${env_name} Libindy Test: Test"
260261

261262
echo "${env_name} Libindy Test: Build Test"
262-
sh "RUST_BACKTRACE=1 cargo test --no-run"
263+
sh "RUST_BACKTRACE=1 cargo test --no-run $libindyFeatures"
263264

264265
echo "${env_name} Libindy Test: Run tests"
265-
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test"
266+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test $libindyFeatures"
266267
}
267268
}
268269
},
@@ -422,7 +423,7 @@ def closePool(env_name, network_name, poolInst) {
422423
}
423424

424425
def setupRust() {
425-
sh "rustup default 1.25.0"
426+
sh "rustup default 1.26.0"
426427
}
427428

428429
def setupRustIOS() {
@@ -433,5 +434,4 @@ def setupBrewPackages() {
433434
sh "brew switch libsodium 1.0.12"
434435
sh "brew switch openssl 1.0.2l"
435436
sh "brew switch zeromq 4.2.3"
436-
}
437-
437+
}

ci/indy-pool.dockerfile

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

2121
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
22-
ARG indy_stream=rc
22+
ARG indy_stream=master
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.2.38
28-
ARG indy_anoncreds_ver=1.0.11
29-
ARG indy_node_ver=1.3.56
30-
ARG python3_indy_crypto_ver=0.2.0
31-
ARG indy_crypto_ver=0.1.6
27+
ARG indy_plenum_ver=1.2.369
28+
ARG indy_anoncreds_ver=1.0.32
29+
ARG indy_node_ver=1.3.425
30+
ARG python3_indy_crypto_ver=0.4.1
31+
ARG indy_crypto_ver=0.4.0
3232

3333
RUN apt-get update -y && apt-get install -y \
3434
indy-plenum=${indy_plenum_ver} \

cli/src/command_executor.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ impl CommandMetadataBuilder {
110110
self
111111
}
112112

113+
pub fn add_required_deferred_param(mut self,
114+
name: &'static str,
115+
help: &'static str) -> CommandMetadataBuilder {
116+
self.params.push(ParamMetadata::new(name, false, true, help));
117+
self
118+
}
119+
113120
pub fn add_optional_deferred_param(mut self,
114121
name: &'static str,
115122
help: &'static str) -> CommandMetadataBuilder {

cli/src/commands/common.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ pub mod exit_command {
148148
}
149149

150150
#[cfg(test)]
151+
#[cfg(feature = "nullpay_plugin")]
151152
pub mod tests {
152153
use super::*;
153154

@@ -164,7 +165,6 @@ pub mod tests {
164165
use utils::test::TestUtils;
165166

166167
#[test]
167-
#[cfg(feature = "nullpay_plugin")]
168168
pub fn load_works() {
169169
TestUtils::cleanup_storage();
170170
let ctx = CommandContext::new();
@@ -179,7 +179,6 @@ pub mod tests {
179179
}
180180

181181
#[test]
182-
#[cfg(feature = "nullpay_plugin")]
183182
pub fn load_works_for_unknown_plugin() {
184183
let ctx = CommandContext::new();
185184

@@ -191,7 +190,6 @@ pub mod tests {
191190
}
192191

193192
#[test]
194-
#[cfg(feature = "nullpay_plugin")]
195193
pub fn load_works_for_unknown_init_function() {
196194
let ctx = CommandContext::new();
197195

cli/src/commands/did.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub mod new_command {
6666
println_succ!("Did \"{}\" has been created with \"{}\" verkey", did, vk);
6767
Ok(did)
6868
}
69+
Err(ErrorCode::DidAlreadyExistsError) => Err(println_err!("Did already exists: {:?}", did.unwrap_or(""))),
6970
Err(ErrorCode::UnknownCryptoTypeError) => Err(println_err!("Unknown crypto type")),
7071
Err(ErrorCode::CommonInvalidStructure) => Err(println_err!("Invalid format of command params. Please check format of posted JSONs, Keys, DIDs and etc...")),
7172
Err(err) => Err(println_err!("Indy SDK error occurred {:?}", err)),
@@ -179,7 +180,7 @@ pub mod use_command {
179180
Ok(println_succ!("Did \"{}\" has been set as active", did))
180181
}
181182
Err(ErrorCode::CommonInvalidStructure) => Err(println_err!("Invalid DID format")),
182-
Err(ErrorCode::WalletNotFoundError) => Err(println_err!("Requested DID not found")),
183+
Err(ErrorCode::WalletItemNotFound) => Err(println_err!("Requested DID not found")),
183184
Err(err) => Err(println_err!("Indy SDK error occurred {:?}", err))
184185
};
185186

@@ -214,7 +215,7 @@ pub mod rotate_key_command {
214215

215216
let new_verkey = match Did::replace_keys_start(wallet_handle, &did, &identity_json) {
216217
Ok(request) => Ok(request),
217-
Err(ErrorCode::WalletNotFoundError) => Err(println_err!("Active DID: \"{}\" not found", did)),
218+
Err(ErrorCode::WalletItemNotFound) => Err(println_err!("Active DID: \"{}\" not found", did)),
218219
Err(_) => return Err(println_err!("Invalid format of command params. Please check format of posted JSONs, Keys, DIDs and etc...")),
219220
}?;
220221

@@ -236,7 +237,7 @@ pub mod rotate_key_command {
236237
match Did::replace_keys_apply(wallet_handle, &did)
237238
.and_then(|_| Did::abbreviate_verkey(&did, &new_verkey)) {
238239
Ok(vk) => Ok(println_succ!("Verkey for did \"{}\" has been updated. New verkey: \"{}\"", did, vk)),
239-
Err(ErrorCode::WalletNotFoundError) => Err(println_err!("Active DID: \"{}\" not found", did)),
240+
Err(ErrorCode::WalletItemNotFound) => Err(println_err!("Active DID: \"{}\" not found", did)),
240241
Err(_) => return Err(println_err!("Invalid format of command params. Please check format of posted JSONs, Keys, DIDs and etc...")),
241242
};
242243

@@ -346,9 +347,8 @@ pub mod tests {
346347
params.insert("did", DID_TRUSTEE.to_string());
347348
cmd.execute(&ctx, &params).unwrap();
348349
}
349-
let dids = get_dids(wallet_handle);
350-
assert_eq!(1, dids.len());
351-
assert_eq!(dids[0]["did"].as_str().unwrap(), DID_TRUSTEE);
350+
let did = get_did_info(wallet_handle, DID_TRUSTEE);
351+
assert_eq!(did["did"].as_str().unwrap(), DID_TRUSTEE);
352352

353353
close_and_delete_wallet(&ctx);
354354
TestUtils::cleanup_storage();
@@ -366,10 +366,9 @@ pub mod tests {
366366
params.insert("seed", SEED_TRUSTEE.to_string());
367367
cmd.execute(&ctx, &params).unwrap();
368368
}
369-
let dids = get_dids(wallet_handle);
370-
assert_eq!(1, dids.len());
371-
assert_eq!(dids[0]["did"].as_str().unwrap(), DID_TRUSTEE);
372-
assert_eq!(dids[0]["verkey"].as_str().unwrap(), VERKEY_TRUSTEE);
369+
let did = get_did_info(wallet_handle, DID_TRUSTEE);
370+
assert_eq!(did["did"].as_str().unwrap(), DID_TRUSTEE);
371+
assert_eq!(did["verkey"].as_str().unwrap(), VERKEY_TRUSTEE);
373372

374373
close_and_delete_wallet(&ctx);
375374
TestUtils::cleanup_storage();
@@ -549,15 +548,15 @@ pub mod tests {
549548
send_nym(&ctx, DID_MY2, VERKEY_MY2, None);
550549
use_did(&ctx, DID_MY2);
551550

552-
let dids = get_dids(wallet_handle);
553-
assert_eq!(dids[0]["verkey"].as_str().unwrap(), VERKEY_MY2);
551+
let did_info = get_did_info(wallet_handle,DID_MY2);
552+
assert_eq!(did_info["verkey"].as_str().unwrap(), VERKEY_MY2);
554553
{
555554
let cmd = rotate_key_command::new();
556555
let params = CommandParams::new();
557556
cmd.execute(&ctx, &params).unwrap();
558557
}
559-
let dids = get_dids(wallet_handle);
560-
assert_ne!(dids[0]["verkey"].as_str().unwrap(), VERKEY_MY2);
558+
let did_info = get_did_info(wallet_handle,DID_MY2);
559+
assert_ne!(did_info["verkey"].as_str().unwrap(), VERKEY_MY2);
561560

562561
close_and_delete_wallet(&ctx);
563562
disconnect_and_delete_pool(&ctx);
@@ -582,6 +581,11 @@ pub mod tests {
582581
}
583582
}
584583

584+
fn get_did_info(wallet_handle: i32, did: &str) -> serde_json::Value {
585+
let did_info = Did::get_did_with_meta(wallet_handle, did).unwrap();
586+
serde_json::from_str(&did_info).unwrap()
587+
}
588+
585589
fn get_dids(wallet_handle: i32) -> Vec<serde_json::Value> {
586590
let dids = Did::list_dids_with_meta(wallet_handle).unwrap();
587591
serde_json::from_str(&dids).unwrap()

0 commit comments

Comments
 (0)