Zebra/zebra-chain
Henry de Valence 56d7391f6d Add convenience methods to Transaction.
Because we represent each transaction version as a different variant of the
Transaction enum, we end up in a situation where fields that are common to
different transaction versions are awkward to access, requiring a match
statement with identical match arms.

To fix this, this commit adds the following convenience methods:

* `Transaction::inputs() -> impl Iterator<Item=&TransparentInput>`;
* `Transaction::outputs() -> impl Iterator<Item=&TransparentOutput>`;
* `Transaction::lock_time() -> LockTime`;
* `Transaction::expiry_height() -> Option<ExpiryHeight>`;

The last returns an `Option` because the field is only present in V3 and V4
transactions.

There are some remaining fields that do not get common accessors, because it
probably doesn't make sense to access independently of knowing the transaction
version: `joinsplit_data`, `shielded_data`, `value_balance`.
2020-02-14 18:23:41 -05:00
..
proptest-regressions Add proptests-regressions/block/tests.txt 2020-02-04 18:04:53 -05:00
src Add convenience methods to Transaction. 2020-02-14 18:23:41 -05:00
Cargo.toml Add BLOCK_MAINNET_415000_BYTES test vector and a test to deserialize it 2020-02-07 13:42:21 -08:00