Merge pull request #232 from str4d/lint-fixes

Lint fixes
This commit is contained in:
str4d 2020-05-23 08:03:03 +12:00 committed by GitHub
commit 8831150825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 24 deletions

View File

@ -340,7 +340,7 @@ impl fmt::Display for SynthesisError {
write!(f, "I/O error: ")?;
e.fmt(f)
} else {
write!(f, "{}", self.description())
write!(f, "{}", self)
}
}
}

View File

@ -18,7 +18,7 @@
//!
//! This can be derived using the following sage script:
//!
//! ```norun
//! ```text
//! param = -0xd201000000010000
//! def r(x):
//! return (x**4) - (x**2) + 1

View File

@ -899,7 +899,7 @@ impl fmt::Display for GroupDecodingError {
GroupDecodingError::CoordinateDecodingError(description) => {
write!(f, "{} decoding error", description)
}
_ => write!(f, "{}", self.description()),
_ => write!(f, "{}", self),
}
}
}

View File

@ -21,7 +21,7 @@ subtle = "2"
zcash_primitives = { version = "0.2", path = "../zcash_primitives" }
[build-dependencies]
protobuf-codegen-pure = "2"
protobuf-codegen-pure = "2.14"
[dev-dependencies]
rand_core = "0.5"

View File

@ -1,11 +1,10 @@
use protobuf_codegen_pure;
fn main() {
protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
out_dir: "src/proto",
input: &["proto/compact_formats.proto"],
includes: &["proto"],
customize: Default::default(),
})
.expect("protoc");
protobuf_codegen_pure::Codegen::new()
.out_dir("src/proto")
.inputs(&["proto/compact_formats.proto"])
.includes(&["proto"])
.run()
.expect("Protobuf codegen failed");
}

View File

@ -33,5 +33,5 @@ mod test_vectors;
use crate::jubjub::JubjubBls12;
lazy_static! {
pub static ref JUBJUB: JubjubBls12 = { JubjubBls12::new() };
pub static ref JUBJUB: JubjubBls12 = JubjubBls12::new();
}

View File

@ -23,19 +23,13 @@ use crate::{keys::OutgoingViewingKey, JUBJUB};
pub const KDF_SAPLING_PERSONALIZATION: &[u8; 16] = b"Zcash_SaplingKDF";
pub const PRF_OCK_PERSONALIZATION: &[u8; 16] = b"Zcash_Derive_ock";
const COMPACT_NOTE_SIZE: usize = (
1 + // version
const COMPACT_NOTE_SIZE: usize = 1 + // version
11 + // diversifier
8 + // value
32
// rcv
);
32; // rcv
const NOTE_PLAINTEXT_SIZE: usize = COMPACT_NOTE_SIZE + 512;
const OUT_PLAINTEXT_SIZE: usize = (
32 + // pk_d
32
// esk
);
const OUT_PLAINTEXT_SIZE: usize = 32 + // pk_d
32; // esk
const ENC_CIPHERTEXT_SIZE: usize = NOTE_PLAINTEXT_SIZE + 16;
const OUT_CIPHERTEXT_SIZE: usize = OUT_PLAINTEXT_SIZE + 16;

View File

@ -14,9 +14,9 @@ pub mod amount;
pub use self::amount::Amount;
// π_A + π_B + π_C
pub const GROTH_PROOF_SIZE: usize = (48 + 96 + 48);
pub const GROTH_PROOF_SIZE: usize = 48 + 96 + 48;
// π_A + π_A' + π_B + π_B' + π_C + π_C' + π_K + π_H
const PHGR_PROOF_SIZE: usize = (33 + 33 + 65 + 33 + 33 + 33 + 33 + 33);
const PHGR_PROOF_SIZE: usize = 33 + 33 + 65 + 33 + 33 + 33 + 33 + 33;
const ZC_NUM_JS_INPUTS: usize = 2;
const ZC_NUM_JS_OUTPUTS: usize = 2;