Merge pull request #109 from defuse/checkpoints-tls

Make update_sapling_tree use TLS
This commit is contained in:
str4d 2020-02-27 03:35:39 +00:00 committed by GitHub
commit 531c44c4f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -19,6 +19,8 @@ jni = { version = "0.13", default-features = false }
log = "0.4" log = "0.4"
log-panics = "2.0.0" log-panics = "2.0.0"
protobuf = { version = "2", optional = true } protobuf = { version = "2", optional = true }
tls-api = { version = "0.1", optional = true }
tls-api-rustls = { version = "0.1", optional = true }
[dependencies.ff] [dependencies.ff]
git = "https://github.com/gmale/librustzcash.git" git = "https://github.com/gmale/librustzcash.git"
@ -54,7 +56,7 @@ branch = "feature/add-scan-limit"
[features] [features]
mainnet = ["zcash_client_sqlite/mainnet"] mainnet = ["zcash_client_sqlite/mainnet"]
updater = ["futures", "grpc", "protobuf"] updater = ["futures", "grpc", "protobuf", "tls-api", "tls-api-rustls"]
[lib] [lib]
name = "zcashwalletsdk" name = "zcashwalletsdk"

View File

@ -4,6 +4,8 @@ extern crate grpc;
extern crate hex; extern crate hex;
extern crate pairing; extern crate pairing;
extern crate protobuf; extern crate protobuf;
extern crate tls_api;
extern crate tls_api_rustls;
extern crate zcash_client_backend; extern crate zcash_client_backend;
extern crate zcash_primitives; extern crate zcash_primitives;
@ -14,6 +16,7 @@ use ff::{PrimeField, PrimeFieldRepr};
use futures::Stream; use futures::Stream;
use grpc::ClientStubExt; use grpc::ClientStubExt;
use pairing::bls12_381::{Fr, FrRepr}; use pairing::bls12_381::{Fr, FrRepr};
use tls_api::TlsConnector;
use zcash_client_backend::proto::compact_formats; use zcash_client_backend::proto::compact_formats;
use zcash_primitives::{merkle_tree::CommitmentTree, sapling::Node}; use zcash_primitives::{merkle_tree::CommitmentTree, sapling::Node};
@ -44,7 +47,7 @@ fn main() {
let mut tree = CommitmentTree::new(); let mut tree = CommitmentTree::new();
let client_conf = Default::default(); let client_conf = Default::default();
let client = service_grpc::CompactTxStreamerClient::new_plain( let client = service_grpc::CompactTxStreamerClient::new_tls::<tls_api_rustls::TlsConnector>(
LIGHTWALLETD_HOST, LIGHTWALLETD_HOST,
LIGHTWALLETD_PORT, LIGHTWALLETD_PORT,
client_conf, client_conf,