Zebra/zebra-chain/src
Janito Vaqueiro Ferreira Filho 2e0318878a
Further test new transaction consensus rules (#2246)
* Add a `at_least_one!` macro for testing

Similar to the `vec!` macro, but doesn't allow creating an empty list.

* Test if `has_inputs_and_outputs` considers actions

Create a dummy transaction with no inputs and no outputs, and add a
dummy Orchard action to it. The `check::has_inputs_and_outputs`
should succeed, because the consensus rule considers having Orchard
actions as having inputs and/or outputs.

* Refactor to create helper function

Move the code to create a fake Orchard shielded data instance to a
helper function in `zebra_chain::transaction::arbitrary`, so that other
tests can also use it.

* Test coinbase V5 transaction with enable spends

A V5 coinbase transaction that has Orchard shielded data MUST NOT have
the enable spends flag set.

* Test if coinbase without enable spends is valid

A coinbase transaction with Orchard shielded data and without the enable
spends flag set should be valid.

* Add a security comment about the `at_least_one!` macro

This macro must not be used outside tests, because it allows memory denial
of service.

Co-authored-by: teor <teor@riseup.net>
2021-06-07 12:02:18 +10:00
..
block Add final sapling root test vectors (#2243) 2021-06-04 10:31:47 -03:00
orchard Standardise clippy lints and require docs (#2238) 2021-06-04 08:48:40 +10:00
parameters Cleanup a few arbitrary impls (#2222) 2021-05-28 09:49:28 -03:00
primitives Standardise clippy lints and require docs (#2238) 2021-06-04 08:48:40 +10:00
sapling Add final sapling root test vectors (#2243) 2021-06-04 10:31:47 -03:00
serialization Further test new transaction consensus rules (#2246) 2021-06-07 12:02:18 +10:00
sprout Derive Arbitrary impls for a bunch of chain and network types (#2179) 2021-05-24 11:10:07 -04:00
transaction Further test new transaction consensus rules (#2246) 2021-06-07 12:02:18 +10:00
transparent Make debugging easier on proptests with large vectors (#2232) 2021-06-02 10:18:04 -03:00
work Standardise clippy lints and require docs (#2238) 2021-06-04 08:48:40 +10:00
amount.rs Move the check in `transaction::check::sapling_balances_match` to `V4` deserialization (#2234) 2021-06-04 08:53:00 +10:00
block.rs Standardise clippy lints and require docs (#2238) 2021-06-04 08:48:40 +10:00
fmt.rs Make debugging easier on proptests with large vectors (#2232) 2021-06-02 10:18:04 -03:00
lib.rs Standardise clippy lints and require docs (#2238) 2021-06-04 08:48:40 +10:00
orchard.rs Orchard data in V5 parsing (#2116) 2021-05-21 00:42:06 +00:00
parameters.rs Cleanup a few arbitrary impls (#2222) 2021-05-28 09:49:28 -03:00
primitives.rs Add link to redpallas follow-up 2021-04-30 00:48:23 -04:00
sapling.rs Rebase tidies 2021-04-30 00:48:23 -04:00
serialization.rs Add a DateTime32 type for 32-bit serialized times (#2210) 2021-05-31 12:52:34 +10:00
shutdown.rs Fix shutdown panics (#1637) 2021-02-03 19:03:28 +10:00
sprout.rs Move the preallocate tests into their own files (#1977) 2021-04-07 12:32:27 +10:00
transaction.rs Update `transaction::check::coinbase_tx_no_joinsplit_or_spend` to validate V5 coinbase transactions with Orchard shielded data (#2236) 2021-06-03 01:54:08 +00:00
transparent.rs chain: add custom Debug for CoinbaseData 2020-11-21 14:09:15 -05:00
work.rs export proptest impls for use in downstream crates (#1092) 2020-09-23 18:52:52 -07:00