mirror of https://github.com/zcash/orchard.git
Merge pull request #323 from defuse/nu5-consensus-labeled
Label Consensus Rules
This commit is contained in:
commit
4bb65b9330
|
@ -111,6 +111,7 @@ impl Flags {
|
||||||
///
|
///
|
||||||
/// [txencoding]: https://zips.z.cash/protocol/protocol.pdf#txnencoding
|
/// [txencoding]: https://zips.z.cash/protocol/protocol.pdf#txnencoding
|
||||||
pub fn from_byte(value: u8) -> Option<Self> {
|
pub fn from_byte(value: u8) -> Option<Self> {
|
||||||
|
// https://p.z.cash/TCR:bad-txns-v5-reserved-bits-nonzero
|
||||||
if value & FLAGS_EXPECTED_UNSET == 0 {
|
if value & FLAGS_EXPECTED_UNSET == 0 {
|
||||||
Some(Self::from_parts(
|
Some(Self::from_parts(
|
||||||
value & FLAG_SPENDS_ENABLED != 0,
|
value & FLAG_SPENDS_ENABLED != 0,
|
||||||
|
@ -376,6 +377,7 @@ impl<T: Authorization, V: Copy + Into<i64>> Bundle<T, V> {
|
||||||
/// This can be used to validate the [`Authorized::binding_signature`] returned from
|
/// This can be used to validate the [`Authorized::binding_signature`] returned from
|
||||||
/// [`Bundle::authorization`].
|
/// [`Bundle::authorization`].
|
||||||
pub fn binding_validating_key(&self) -> redpallas::VerificationKey<Binding> {
|
pub fn binding_validating_key(&self) -> redpallas::VerificationKey<Binding> {
|
||||||
|
// https://p.z.cash/TCR:bad-txns-orchard-binding-signature-invalid?partial
|
||||||
(self
|
(self
|
||||||
.actions
|
.actions
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
@ -67,6 +67,8 @@ impl BatchValidator {
|
||||||
/// figure out which of the accumulated bundles might be invalid; if that information
|
/// figure out which of the accumulated bundles might be invalid; if that information
|
||||||
/// is desired, construct separate [`BatchValidator`]s for sub-batches of the bundles.
|
/// is desired, construct separate [`BatchValidator`]s for sub-batches of the bundles.
|
||||||
pub fn validate<R: RngCore + CryptoRng>(self, vk: &VerifyingKey, rng: R) -> bool {
|
pub fn validate<R: RngCore + CryptoRng>(self, vk: &VerifyingKey, rng: R) -> bool {
|
||||||
|
// https://p.z.cash/TCR:bad-txns-orchard-binding-signature-invalid?partial
|
||||||
|
|
||||||
if self.signatures.is_empty() {
|
if self.signatures.is_empty() {
|
||||||
// An empty batch is always valid, but is not free to run; skip it.
|
// An empty batch is always valid, but is not free to run; skip it.
|
||||||
// Note that a transaction has at least a binding signature, so if
|
// Note that a transaction has at least a binding signature, so if
|
||||||
|
|
Loading…
Reference in New Issue