Skip to content

Commit

Permalink
4. test(db): add large transaction tests (#3759)
Browse files Browse the repository at this point in the history
* refactor(test/block): rename large single transaction function

```sh
fastmod single_transaction_block single_transaction_block_many_inputs
```

* rustfmt

* test(block): add a test block with many transparent outputs

* doc(db): explain why we can't just get the UTXOs right before they are deleted

* refactor(db): split out a block data write method

* refactor(block): add a height argument to new_outputs

* test(db): add block and transaction round-trip tests

Including large blocks and transactions.

* test(db): fix large block serialization instability in the tests

* doc(block): add TODOs for generating correct blocks

* Make transparent output functions which take a height test-only

* make sure generated blocks are actually over/under-sized

* replace println!() with an error!() log
  • Loading branch information
teor2345 authored Mar 9, 2022
1 parent 3291db3 commit 7283b4b
Show file tree
Hide file tree
Showing 12 changed files with 541 additions and 101 deletions.
8 changes: 5 additions & 3 deletions zebra-chain/benches/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};

use zebra_chain::{
block::{
tests::generate::{large_multi_transaction_block, large_single_transaction_block},
tests::generate::{
large_multi_transaction_block, large_single_transaction_block_many_inputs,
},
Block,
},
serialization::{ZcashDeserialize, ZcashSerialize},
Expand All @@ -26,8 +28,8 @@ fn block_serialization(c: &mut Criterion) {
large_multi_transaction_block(),
),
(
"large_single_transaction_block",
large_single_transaction_block(),
"large_single_transaction_block_many_inputs",
large_single_transaction_block_many_inputs(),
),
];

Expand Down
Loading

0 comments on commit 7283b4b

Please sign in to comment.