pub fn shielded_balances_match<AnchorV>(
    shielded_data: &ShieldedData<AnchorV>,
) -> Result<(), TransactionError>
where
    AnchorV: AnchorVariant + Clone,
{
    if (shielded_data.spends().count() + shielded_data.outputs().count() != 0)
        || i64::from(shielded_data.value_balance) == 0
    {
        Ok(())
    } else {
        Err(TransactionError::BadBalance)
    }
}
/// Check that if there are no Spends or Outputs, that valueBalance is also 0.
///
/// https://zips.z.cash/protocol/protocol.pdf#consensusfrombitcoin
Check that if there are no Spends or Outputs, that valueBalance is also 0.
Check that if there are no Spends or Outputs that valueBalance is also 0 .
pub fn shielded_balances_match<AnchorV>(
    shielded_data: &ShieldedData<AnchorV>,
) -> Result<(), TransactionError>
where
    AnchorV: AnchorVariant + Clone,
{
    if (shielded_data.spends().count() + shielded_data.outputs().count() != 0)
        || i64::from(shielded_data.value_balance) == 0
    {
        Ok(())
    } else {
        Err(TransactionError::BadBalance)
    }
}
pub fn shielded_balances_match < AnchorV > ( shielded_data : & ShieldedData < AnchorV > , ) -> Result < ( ) , TransactionError > where AnchorV : AnchorVariant + Clone , { if ( shielded_data . spends ( ) . count ( ) + shielded_data . outputs ( ) . count ( ) != 0 ) || i64 :: from ( shielded_data . value_balance ) == 0 { Ok ( ( ) ) } else { Err ( TransactionError :: BadBalance ) } }
Check that if there are no Spends or Outputs, that valueBalance is also 0.
https://zips.z.cash/protocol/protocol.pdf#consensusfrombitcoin
Check that if there are no Spends or Outputs that valueBalance is also 0 . https : // zips . z . cash / protocol / protocol . pdf#consensusfrombitcoin
shielded_data
&ShieldedData<AnchorV>