Skip to content

Commit

Permalink
Merge branch 'main' into fix-crates-list-in-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
upbqdn authored Jan 16, 2024
2 parents b7e3158 + e7e3970 commit e72b6a5
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 33 deletions.
60 changes: 47 additions & 13 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies = [
"arc-swap",
"backtrace",
"canonical-path",
"clap 4.4.14",
"clap 4.4.16",
"color-eyre",
"fs-err",
"once_cell",
Expand Down Expand Up @@ -137,9 +137,9 @@ dependencies = [

[[package]]
name = "anstream"
version = "0.6.5"
version = "0.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6"
checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba"
dependencies = [
"anstyle",
"anstyle-parse",
Expand Down Expand Up @@ -611,12 +611,44 @@ dependencies = [
"pkg-config",
]

[[package]]
name = "camino"
version = "1.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c"
dependencies = [
"serde",
]

[[package]]
name = "canonical-path"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f"

[[package]]
name = "cargo-platform"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d"
dependencies = [
"serde",
]

[[package]]
name = "cargo_metadata"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037"
dependencies = [
"camino",
"cargo-platform",
"semver 1.0.21",
"serde",
"serde_json",
"thiserror",
]

[[package]]
name = "cast"
version = "0.3.0"
Expand Down Expand Up @@ -766,19 +798,19 @@ dependencies = [

[[package]]
name = "clap"
version = "4.4.14"
version = "4.4.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33e92c5c1a78c62968ec57dbc2440366a2d6e5a23faf829970ff1585dc6b18e2"
checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445"
dependencies = [
"clap_builder",
"clap_derive",
]

[[package]]
name = "clap_builder"
version = "4.4.14"
version = "4.4.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4323769dc8a61e2c39ad7dc26f6f2800524691a44d74fe3d1071a5c24db6370"
checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb"
dependencies = [
"anstream",
"anstyle",
Expand Down Expand Up @@ -953,7 +985,7 @@ dependencies = [
"anes",
"cast",
"ciborium",
"clap 4.4.14",
"clap 4.4.16",
"criterion-plot",
"is-terminal",
"itertools 0.10.5",
Expand Down Expand Up @@ -5051,12 +5083,14 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"

[[package]]
name = "vergen"
version = "8.2.6"
version = "8.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939"
checksum = "1a78365c3f8ca9dc5428a9f5c6349558c3f9f3eeb65e3fc00b6a981379462947"
dependencies = [
"anyhow",
"cargo_metadata",
"git2",
"regex",
"rustc_version 0.4.0",
"rustversion",
"time",
Expand Down Expand Up @@ -5553,9 +5587,9 @@ dependencies = [

[[package]]
name = "zcash_address"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8944af5c206cf2e37020ad54618e1825501b98548d35a638b73e0ec5762df8d5"
checksum = "bce173f1d9ed4f806e310bc3a873301531e7a6dc209928584d6404e3f8228ef4"
dependencies = [
"bech32",
"bs58",
Expand Down Expand Up @@ -6062,7 +6096,7 @@ dependencies = [
"abscissa_core",
"atty",
"chrono",
"clap 4.4.14",
"clap 4.4.16",
"color-eyre",
"console-subscriber",
"dirs",
Expand Down
2 changes: 1 addition & 1 deletion zebra-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ serde_json = { version = "1.0.111", optional = true }
tokio = { version = "1.35.1", optional = true }

# Experimental feature getblocktemplate-rpcs
zcash_address = { version = "0.3.0", optional = true }
zcash_address = { version = "0.3.1", optional = true }

# Optional testing dependencies
proptest = { version = "1.4.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion zebra-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ serde = { version = "1.0.193", features = ["serde_derive"] }
# Experimental feature getblocktemplate-rpcs
rand = { version = "0.8.5", optional = true }
# ECC deps used by getblocktemplate-rpcs feature
zcash_address = { version = "0.3.0", optional = true }
zcash_address = { version = "0.3.1", optional = true }

# Test-only feature proptest-impl
proptest = { version = "1.4.0", optional = true }
Expand Down
27 changes: 11 additions & 16 deletions zebra-utils/src/bin/scanning-results-reader/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use hex::ToHex;
use itertools::Itertools;
use jsonrpc::simple_http::SimpleHttpTransport;
use jsonrpc::Client;
use serde_json::value::RawValue;

use zcash_client_backend::decrypt_transaction;
use zcash_client_backend::keys::UnifiedFullViewingKey;
Expand Down Expand Up @@ -65,7 +64,7 @@ pub fn main() {

for txid in txids.iter() {
let tx = Transaction::read(
&hex::decode(&get_tx_via_rpc(txid.encode_hex()))
&hex::decode(&fetch_tx_via_rpc(txid.encode_hex()))
.expect("RPC response should be decodable from hex string to bytes")[..],
BranchId::for_height(&network, height),
)
Expand Down Expand Up @@ -98,21 +97,17 @@ fn memo_bytes_to_string(memo: &[u8; 512]) -> String {
}

/// Uses the `getrawtransaction` RPC to retrieve a transaction by its TXID.
fn get_tx_via_rpc(txid: String) -> String {
// Wrap the TXID with `"` so that [`RawValue::from_string`] eats it.
let txid = format!("\"{}\"", txid);
let transport = SimpleHttpTransport::builder()
.url("127.0.0.1:8232")
.expect("URL should be valid")
.build();
let client = Client::with_transport(transport);
let params = RawValue::from_string(txid).expect("Provided TXID should be a valid JSON");
let request = client.build_request("getrawtransaction", Some(&params));
let response = client
.send_request(request)
.expect("Sending the `getrawtransaction` request should succeed");
fn fetch_tx_via_rpc(txid: String) -> String {
let client = Client::with_transport(
SimpleHttpTransport::builder()
.url("127.0.0.1:8232")
.expect("Zebra's URL should be valid")
.build(),
);

response
client
.send_request(client.build_request("getrawtransaction", Some(&jsonrpc::arg([txid]))))
.expect("Sending the `getrawtransaction` request should succeed")
.result()
.expect("Zebra's RPC response should contain a valid result")
}
4 changes: 2 additions & 2 deletions zebrad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ zebra-scan = { path = "../zebra-scan", version = "0.1.0-alpha.1", optional = tru
zebra-utils = { path = "../zebra-utils", version = "1.0.0-beta.32", optional = true }

abscissa_core = "0.7.0"
clap = { version = "4.4.14", features = ["cargo"] }
clap = { version = "4.4.16", features = ["cargo"] }
chrono = { version = "0.4.31", default-features = false, features = ["clock", "std"] }
humantime-serde = "1.1.1"
indexmap = "2.0.1"
Expand Down Expand Up @@ -246,7 +246,7 @@ proptest-derive = { version = "0.4.0", optional = true }
console-subscriber = { version = "0.2.0", optional = true }

[build-dependencies]
vergen = { version = "8.2.6", default-features = false, features = ["cargo", "git", "git2", "rustc"] }
vergen = { version = "8.2.10", default-features = false, features = ["cargo", "git", "git2", "rustc"] }

# test feature lightwalletd-grpc-tests
tonic-build = { version = "0.10.2", optional = true }
Expand Down

0 comments on commit e72b6a5

Please sign in to comment.