From e8ff03b689dbe8105405d36fb56dfff0d11c37eb Mon Sep 17 00:00:00 2001 From: Nikita Khateev Date: Mon, 29 Apr 2019 11:55:19 +0300 Subject: [PATCH 1/5] ST-549 Fix libsovtoken identifier Signed-off-by: Nikita Khateev --- libsovtoken/src/logic/request.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libsovtoken/src/logic/request.rs b/libsovtoken/src/logic/request.rs index e761fd713..07caa59b6 100644 --- a/libsovtoken/src/logic/request.rs +++ b/libsovtoken/src/logic/request.rs @@ -24,7 +24,8 @@ pub struct Request pub operation: T, pub req_id: ReqId, pub protocol_version: ProtocolVersion, - pub identifier: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub identifier : Option, } impl Request @@ -36,7 +37,7 @@ impl Request operation, protocol_version: PROTOCOL_VERSION, req_id, - identifier: identifier.unwrap_or(DEFAULT_LIBSOVTOKEN_DID.to_string()) + identifier }; } From 6ea3bb0a430c9be7857e60dee39ba7fcbde2b24f Mon Sep 17 00:00:00 2001 From: Nikita Khateev Date: Mon, 29 Apr 2019 12:14:51 +0300 Subject: [PATCH 2/5] ST-549 fix tests Signed-off-by: Nikita Khateev --- libsovtoken/src/logic/build_payment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsovtoken/src/logic/build_payment.rs b/libsovtoken/src/logic/build_payment.rs index 8186a1f69..6ff253d26 100644 --- a/libsovtoken/src/logic/build_payment.rs +++ b/libsovtoken/src/logic/build_payment.rs @@ -207,6 +207,6 @@ mod test_handle_signing { .get(0).unwrap().as_object().unwrap() .get("address").unwrap().as_str().unwrap() ); - assert_eq!("7LSfLv2S6K7zMPrgmJDkZoJNhWvWRzpU7qt9uMR5yz8G".to_string(), request.identifier); + assert_eq!(Some("7LSfLv2S6K7zMPrgmJDkZoJNhWvWRzpU7qt9uMR5yz8G".to_string()), request.identifier); } } \ No newline at end of file From bcdabfe5b60bf9dc8495529173fb39acec2d76ba Mon Sep 17 00:00:00 2001 From: Nikita Khateev Date: Tue, 7 May 2019 11:48:41 +0300 Subject: [PATCH 3/5] Update onto new identifier logic Signed-off-by: Nikita Khateev --- devops/indy-pool/Dockerfile | 8 ++++---- libsovtoken/src/api/mod.rs | 6 ++++-- libsovtoken/tests/utils/mint.rs | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/devops/indy-pool/Dockerfile b/devops/indy-pool/Dockerfile index 426d883e6..82f34a10d 100644 --- a/devops/indy-pool/Dockerfile +++ b/devops/indy-pool/Dockerfile @@ -22,13 +22,13 @@ ARG uid=1000 ARG indy_stream=master -ARG indy_plenum_ver=1.6.735 -ARG indy_node_ver=1.6.874 +ARG indy_plenum_ver=1.8.0~dev780 +ARG indy_node_ver=1.8.0~dev920 ARG indy_anoncreds_ver=1.0.32 ARG python3_indy_crypto_ver=0.4.5 ARG indy_crypto_ver=0.4.5 -ARG token_ver=0.9.6~2 -ARG fees_ver=0.9.6~2 +ARG token_ver=0.9.6~18 +ARG fees_ver=0.9.6~18 # Install environment RUN apt-get update -y && apt-get install -y \ diff --git a/libsovtoken/src/api/mod.rs b/libsovtoken/src/api/mod.rs index 0a5313283..d6e12e632 100644 --- a/libsovtoken/src/api/mod.rs +++ b/libsovtoken/src/api/mod.rs @@ -660,11 +660,13 @@ pub extern "C" fn build_get_txn_fees_handler( let did = match opt_res_to_res_opt!(did) { Ok(did) => did, - Err(e) => { return e as i32; } + Err(e) => None }; + let did = Some(did.unwrap_or(Did::new("LibsovtokenDid11111111"))); + let get_txn_request = GetFeesRequest::new().as_request(did); - info!("Built GET_TXN_FEES request: {:?}", get_txn_request); + print!("Built GET_TXN_FEES request: {:?}", get_txn_request); let request_pointer = match get_txn_request.serialize_to_pointer() { Ok(p) => p, diff --git a/libsovtoken/tests/utils/mint.rs b/libsovtoken/tests/utils/mint.rs index 2cf69171a..2bac40837 100644 --- a/libsovtoken/tests/utils/mint.rs +++ b/libsovtoken/tests/utils/mint.rs @@ -29,7 +29,7 @@ pub fn mint_tokens(cfg: HashMap, pool_handle: i32, wallet_handle: i let mint_req = Request::::multi_sign_request(wallet_handle, &mint_req, trustee_dids.to_vec()).unwrap(); - let result = indy::ledger::sign_and_submit_request(pool_handle, wallet_handle, did, &mint_req).wait().unwrap(); + let result = indy::ledger::submit_request(pool_handle, &mint_req).wait().unwrap(); utils::parse_mint_response::ParseMintResponse::from_json(&result).map_err(|_| ErrorCode::CommonInvalidStructure) } From 1781632ff6799e78b775e83751162ad3ba066174 Mon Sep 17 00:00:00 2001 From: Nikita Khateev Date: Tue, 7 May 2019 11:51:22 +0300 Subject: [PATCH 4/5] Update CI Signed-off-by: Nikita Khateev --- devops/docker/ci/xenial/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/devops/docker/ci/xenial/Dockerfile b/devops/docker/ci/xenial/Dockerfile index 0bebb4f64..5cd1d00f2 100644 --- a/devops/docker/ci/xenial/Dockerfile +++ b/devops/docker/ci/xenial/Dockerfile @@ -36,12 +36,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # or python3-rocksdb are not specified here) ENV LIBINDY_CRYPTO_VERSION ${LIBINDY_CRYPTO_VERSION:-0.4.5} ENV PYTHON3_INDY_CRYPTO_VERSION ${PYTHON3_INDY_CRYPTO_VERSION:-0.4.5} -ENV INDY_PLENUM_VERSION ${INDY_PLENUM_VERSION:-1.6.53} +ENV INDY_PLENUM_VERSION ${INDY_PLENUM_VERSION:-1.8.0~dev780} ENV INDY_ANONCREDS_VERSION ${INDY_ANONCREDS_VERSION:-1.0.11} -ENV INDY_NODE_VERSION ${INDY_NODE_VERSION:-1.6.78} -ENV TOKEN_VER ${TOKEN_VER:-0.9.5} -RUN echo "deb https://repo.sovrin.org/sdk/deb xenial stable" >> /etc/apt/sources.list -RUN echo "deb https://repo.sovrin.org/deb xenial stable" >> /etc/apt/sources.list \ +ENV INDY_NODE_VERSION ${INDY_NODE_VERSION:-1.8.0~dev920} +ENV TOKEN_VER ${TOKEN_VER:-0.9.6~18} +RUN echo "deb https://repo.sovrin.org/sdk/deb xenial master" >> /etc/apt/sources.list +RUN echo "deb https://repo.sovrin.org/deb xenial master" >> /etc/apt/sources.list \ && apt-get update && apt-get install -y --no-install-recommends \ libindy-crypto=${LIBINDY_CRYPTO_VERSION} \ python3-indy-crypto=${PYTHON3_INDY_CRYPTO_VERSION} \ @@ -69,4 +69,4 @@ COPY libsovtoken-ci-entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/libsovtoken-ci-entrypoint.sh ENTRYPOINT ["libsovtoken-ci-entrypoint.sh"] -ENV LIBSOVTOKEN_CI_ENV_VERSION=0.55.0 +ENV LIBSOVTOKEN_CI_ENV_VERSION=0.56.0 From 8c342748297c800e472c006015bc51916fbf928d Mon Sep 17 00:00:00 2001 From: Nikita Khateev Date: Tue, 7 May 2019 12:04:26 +0300 Subject: [PATCH 5/5] update anoncreds ver Signed-off-by: Nikita Khateev --- devops/docker/ci/xenial/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devops/docker/ci/xenial/Dockerfile b/devops/docker/ci/xenial/Dockerfile index 5cd1d00f2..4da427a47 100644 --- a/devops/docker/ci/xenial/Dockerfile +++ b/devops/docker/ci/xenial/Dockerfile @@ -37,7 +37,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ENV LIBINDY_CRYPTO_VERSION ${LIBINDY_CRYPTO_VERSION:-0.4.5} ENV PYTHON3_INDY_CRYPTO_VERSION ${PYTHON3_INDY_CRYPTO_VERSION:-0.4.5} ENV INDY_PLENUM_VERSION ${INDY_PLENUM_VERSION:-1.8.0~dev780} -ENV INDY_ANONCREDS_VERSION ${INDY_ANONCREDS_VERSION:-1.0.11} +ENV INDY_ANONCREDS_VERSION ${INDY_ANONCREDS_VERSION:-1.0.32} ENV INDY_NODE_VERSION ${INDY_NODE_VERSION:-1.8.0~dev920} ENV TOKEN_VER ${TOKEN_VER:-0.9.6~18} RUN echo "deb https://repo.sovrin.org/sdk/deb xenial master" >> /etc/apt/sources.list