Skip to content

Commit

Permalink
[chore] rust dep updates (including indy-vdr) (#1296)
Browse files Browse the repository at this point in the history
* move to latest vdr

Signed-off-by: gmulhearn <gmulhearn@proton.me>

* move other common git deps to use workspace

Signed-off-by: gmulhearn <gmulhearn@proton.me>

* cargo update

Signed-off-by: gmulhearn <gmulhearn@proton.me>

---------

Signed-off-by: gmulhearn <gmulhearn@proton.me>
  • Loading branch information
gmulhearn authored Oct 5, 2024
1 parent 6887dc2 commit 4d57c79
Show file tree
Hide file tree
Showing 10 changed files with 571 additions and 533 deletions.
1,046 changes: 539 additions & 507 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,11 @@ unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_qualifications = "warn"
let_underscore_drop = "allow"

[workspace.dependencies]
indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git", tag = "v0.4.3", default-features = false, features = [
"log",
] }
indy-vdr-proxy-client = { git = "https://github.com/hyperledger/indy-vdr.git", tag = "v0.4.3" }
indy-credx = { git = "https://github.com/hyperledger/indy-shared-rs", tag = "v1.1.0" }
anoncreds = { git = "https://github.com/hyperledger/anoncreds-rs.git", tag = "v0.2.0" }
4 changes: 2 additions & 2 deletions aries/aries_vcx_anoncreds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ anoncreds = ["dep:anoncreds"]
legacy_proof = []

[dependencies]
indy-credx = { git = "https://github.com/hyperledger/indy-shared-rs", tag = "v1.1.0", optional = true }
anoncreds = { git = "https://github.com/hyperledger/anoncreds-rs.git", tag = "v0.2.0", optional = true }
indy-credx = { workspace = true, optional = true }
anoncreds = { workspace = true, optional = true }
aries_vcx_wallet = { path = "../aries_vcx_wallet" }
anoncreds_types = { path = "../misc/anoncreds_types" }
did_parser_nom = { path = "../../did_core/did_parser_nom" }
Expand Down
4 changes: 2 additions & 2 deletions aries/aries_vcx_ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ aries_vcx_wallet = { path = "../aries_vcx_wallet" }
anoncreds_types = { path = "../misc/anoncreds_types" }
did_parser_nom = { path = "../../did_core/did_parser_nom" }
thiserror = "1.0.40"
indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git", rev = "c143268", default-features = false, features = ["log"] }
indy-vdr-proxy-client = { git = "https://github.com/hyperledger/indy-vdr.git", rev = "c143268", optional = true }
indy-vdr.workspace = true
indy-vdr-proxy-client = { workspace = true, optional = true }
serde_json = "1.0.95"
public_key = { path = "../../did_core/public_key"}
async-trait = "0.1.68"
Expand Down
2 changes: 1 addition & 1 deletion aries/aries_vcx_ledger/src/errors/mapping_indyvdr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl From<VdrError> for VcxLedgerError {
match err.kind() {
VdrErrorKind::Config => Self::InvalidConfiguration(err),
VdrErrorKind::Connection => Self::PoolLedgerConnect(err),
VdrErrorKind::FileSystem(_) => Self::IOError(err),
VdrErrorKind::FileSystem => Self::IOError(err),
VdrErrorKind::Input => Self::InvalidInput(err.to_string()),
VdrErrorKind::Resource
| VdrErrorKind::Unavailable
Expand Down
25 changes: 9 additions & 16 deletions aries/aries_vcx_ledger/src/ledger/request_submitter/vdr_ledger.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::{
collections::{hash_map::RandomState, HashMap},
collections::HashMap,
fmt::{Debug, Formatter},
sync::Arc,
};
Expand All @@ -8,7 +8,10 @@ use async_trait::async_trait;
use indy_vdr::{
common::error::VdrError,
config::PoolConfig,
pool::{PoolBuilder, PoolRunner, PoolTransactions, PreparedRequest, RequestResult},
pool::{
PoolBuilder, PoolRunner, PoolTransactions, PreparedRequest, RequestResult,
RequestResultMeta,
},
};
use log::info;
use tokio::sync::oneshot;
Expand Down Expand Up @@ -45,13 +48,9 @@ impl IndyVdrLedgerPool {
{indy_vdr_config:?}"
);
let txns = PoolTransactions::from_json_file(genesis_file_path)?;
let runner = PoolBuilder::new(
indy_vdr_config,
None,
Some(Self::generate_exclusion_weights(exclude_nodes)),
)
.transactions(txns)?
.into_runner()?;
let runner = PoolBuilder::new(indy_vdr_config, txns)
.node_weights(Some(Self::generate_exclusion_weights(exclude_nodes)))
.into_runner(None)?;

Ok(IndyVdrLedgerPool {
runner: Arc::new(runner),
Expand Down Expand Up @@ -83,13 +82,7 @@ impl RequestSubmitter for IndyVdrSubmitter {
async fn submit(&self, request: PreparedRequest) -> VcxLedgerResult<String> {
// indyvdr send_request is Async via a callback.
// Use oneshot channel to send result from callback, converting the fn to future.
type VdrSendRequestResult = Result<
(
RequestResult<String>,
Option<HashMap<String, f32, RandomState>>,
),
VdrError,
>;
type VdrSendRequestResult = Result<(RequestResult<String>, RequestResultMeta), VdrError>;
let (sender, recv) = oneshot::channel::<VdrSendRequestResult>();
self.pool.runner.send_request(
request,
Expand Down
2 changes: 1 addition & 1 deletion aries/misc/indy_ledger_response_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
serde = { version = "1.0.163", features = ["derive"] }
serde_json = "1.0.96"
time = "0.3.20"
indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git", rev = "c143268", default-features = false, features = ["log"] }
indy-vdr.workspace = true
thiserror = "1.0.44"
anoncreds-clsignatures = "0.3.2"
9 changes: 7 additions & 2 deletions aries/misc/test_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ edition.workspace = true

[features]
vdrtools_wallet = ["aries_vcx_wallet/vdrtools_wallet"]
vdr_proxy_ledger = ["aries_vcx_ledger/vdr_proxy_ledger", "credx", "dep:indy-ledger-response-parser", "dep:indy-vdr-proxy-client"]
vdr_proxy_ledger = [
"aries_vcx_ledger/vdr_proxy_ledger",
"credx",
"dep:indy-ledger-response-parser",
"dep:indy-vdr-proxy-client",
]
credx = ["aries_vcx_anoncreds/credx"]
anoncreds = ["aries_vcx_anoncreds/anoncreds"]

Expand All @@ -22,7 +27,7 @@ aries_vcx_wallet = { path = "../../aries_vcx_wallet" }
aries_vcx_ledger = { path = "../../aries_vcx_ledger" }
public_key = { path = "../../../did_core/public_key" }
indy-ledger-response-parser = { path = "../indy_ledger_response_parser", optional = true }
indy-vdr-proxy-client = { git = "https://github.com/hyperledger/indy-vdr.git", rev = "c143268", optional = true }
indy-vdr-proxy-client = { workspace = true, optional = true }
lazy_static = "1"
serde_json = "1"
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion aries/misc/wallet_migrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ askar_wallet = ["aries_vcx_wallet/askar_wallet"]

[dependencies]
aries_vcx_wallet = { path = "../../aries_vcx_wallet" }
credx = { package = "indy-credx", git = "https://github.com/hyperledger/indy-shared-rs", tag = "v1.1.0" }
indy-credx.workspace = true
vdrtools = { package = "libvdrtools", path = "../legacy/libvdrtools" }
serde = { version = "1.0.159", features = ["derive"] }
serde_json = "1.0.96"
Expand Down
2 changes: 1 addition & 1 deletion aries/wrappers/uniffi-aries-vcx/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ aries_vcx = { path = "../../../aries_vcx", features = [
] }
aries_vcx_ledger = { path = "../../../aries_vcx_ledger" }
aries_vcx_anoncreds = { path = "../../../aries_vcx_anoncreds" }
indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git", rev = "c143268", default-features = false, features = ["log"] }
indy-vdr.workspace = true
tokio = { version = "1.38.0", features = ["rt-multi-thread"] }
once_cell = "1.17.0"
thiserror = "1.0.38"
Expand Down

0 comments on commit 4d57c79

Please sign in to comment.