Skip to content

Commit 40fd666

Browse files
committed
non crashing benchmark
1 parent 96c01b4 commit 40fd666

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tools/generate_chain.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import click
1515
import zstd
1616
from chia_rs import SpendBundle
17-
from chia_rs.chia_rs import FullBlock
17+
from chia_rs.chia_rs import FullBlock, G2Element
1818
from chia_rs.sized_bytes import bytes32
1919
from chia_rs.sized_ints import uint8, uint32, uint64
2020

@@ -217,9 +217,15 @@ async def main(length: int, fill_rate: int, profile: bool, block_refs: bool, out
217217
pool_puzzlehash = wallet.get_new_puzzlehash()
218218
prev_num_blocks = len(blocks)
219219
# Get next spend bundle from mempool
220-
res_bundle = mempool_manager.create_bundle_from_mempool(prev_tx_block.header_hash)
221-
assert res_bundle is not None
222-
spend_bundle, _ = res_bundle
220+
spend_bundle: SpendBundle
221+
if spends != 0:
222+
res_bundle = mempool_manager.create_bundle_from_mempool(prev_tx_block.header_hash)
223+
assert res_bundle is not None
224+
spend_bundle, _ = res_bundle
225+
else:
226+
# no spends to make
227+
spend_bundle = SpendBundle([], G2Element())
228+
223229
blocks = bt.get_consecutive_blocks(
224230
1,
225231
blocks,

0 commit comments

Comments
 (0)