Skip to content

Commit

Permalink
Fix compilation errors for the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dmidem committed Aug 20, 2023
1 parent e3ce7f9 commit 772cebd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ panic = 'abort'
codegen-units = 1

[patch.crates-io]
orchard = { version = "0.5", git = "https://github.com/QED-it/orchard", branch = "ivk-to-bytes-visibility-downgrade-with-burn-valid" }
#orchard = { version = "0.5", git = "https://github.com/QED-it/orchard", branch = "ivk-to-bytes-visibility-downgrade-with-burn-valid" }
orchard = { version = "0.5", path = "../orchard" }
zcash_note_encryption = { version = "0.4", git = "https://github.com/QED-it/librustzcash.git", branch = "zsa-bundle-in-v5-vector-serialization_with_burn_validation_new" }
zcash_address = { version = "0.3", git = "https://github.com/QED-it/librustzcash.git", branch = "zsa-bundle-in-v5-vector-serialization_with_burn_validation_new" }
zcash_primitives = { version = "0.12", git = "https://github.com/QED-it/librustzcash.git", branch = "zsa-bundle-in-v5-vector-serialization_with_burn_validation_new" }
Expand Down
4 changes: 0 additions & 4 deletions src/primitives/orchard.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ class OrchardBundle
bool CoinbaseOutputsAreValid() const {
return inner->coinbase_outputs_are_valid();
}

bool CoinbaseOutputsAreValid() const {
return inner->coinbase_outputs_are_valid();
}
};

#endif // ZCASH_PRIMITIVES_ORCHARD_H
Expand Down
2 changes: 1 addition & 1 deletion src/rust/src/bundlecache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub(crate) fn init(cache_bytes: usize) {
)));
ISSUE_BUNDLE_VALIDITY_CACHE = Some(RwLock::new(BundleValidityCache::new(
"Issue",
b"IssueVeriCache",
b"Issue__VeriCache",
cache_bytes,
)));
});
Expand Down
12 changes: 6 additions & 6 deletions src/rust/src/issue_ffi/batch_validator.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::convert::TryInto;

use rand_core::OsRng;
use tracing::{debug, error};

use crate::{
Expand All @@ -13,10 +12,10 @@ struct BatchValidatorInner {
queued_entries: CacheEntries,
}

pub(crate) struct BatchValidator(Option<BatchValidatorInner>);
pub struct BatchValidator(Option<BatchValidatorInner>);

/// Creates an Issue bundle batch validation context.
pub(crate) fn issue_batch_validation_init(cache_store: bool) -> Box<BatchValidator> {
pub fn issue_batch_validation_init(cache_store: bool) -> Box<BatchValidator> {
Box::new(BatchValidator(Some(BatchValidatorInner {
validator: orchard::issuance::BatchValidator::new(),
queued_entries: CacheEntries::new(cache_store),
Expand All @@ -25,7 +24,7 @@ pub(crate) fn issue_batch_validation_init(cache_store: bool) -> Box<BatchValidat

impl BatchValidator {
/// Adds an Issue bundle to this batch.
pub(crate) fn add_bundle(&mut self, bundle: Box<IsssueBundle>, sighash: [u8; 32]) {
pub(crate) fn add_bundle(&mut self, bundle: Box<IssueBundle>, sighash: [u8; 32]) {
let batch = self.0.as_mut();
let bundle = bundle.inner();

Expand Down Expand Up @@ -68,8 +67,9 @@ impl BatchValidator {
/// The batch validation context is freed by this function.
pub(crate) fn validate(&mut self) -> bool {
if let Some(inner) = self.0.take() {
let vk = unsafe { crate::ISSUE_VK.as_ref() }
.expect("Parameters not loaded: ISSUE_VK should have been initialized");
// FIXME: TODO: consider uncommenting this and adding ISSUE_VK
//let vk = unsafe { crate::ISSUE_VK.as_ref() }
// .expect("Parameters not loaded: ISSUE_VK should have been initialized");
if inner.validator.validate() {
// `BatchValidator::validate()` is only called if every
// `BatchValidator::check_bundle()` returned `true`, so at this point
Expand Down

0 comments on commit 772cebd

Please sign in to comment.