Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/chia-consensus/src/test_generators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ pub(crate) fn print_diff(output: &str, expected: &str) {
// in CI we run with the clvmr/debug-allocator feature enabled, which makes this
// test use too much RAM (about 6.8 GB)
//#[case("aa-million-messages")]
// #[case("aa-million-message-spends")]
#[case("new-agg-sigs")]
#[case("infinity-g1")]
#[case("block-1ee588dc")]
Expand Down Expand Up @@ -249,7 +250,7 @@ fn run_generator(#[case] name: &str) {

for (flags, expected) in zip(&[0, MEMPOOL_MODE], expected) {
let mut flags = *flags;
if name == "aa-million-messages" {
if name == "aa-million-messages" || name == "aa-million-message-spends" {
// this test requires running after hard fork 2, where the COST_CONDITIONS
// flag is set
flags |= COST_CONDITIONS;
Expand Down
25 changes: 25 additions & 0 deletions generator-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,28 @@ This is an example of a generator that _generates_ the puzzles programmatically:
(list (list (list (q . 0x0101010101010101010101010101010101010101010101010101010101010101) (c 1 (loop condition condition_two amount)) 123 (list 0 (list 1)))))
)
```

Though it would need to be curried as generators are not run with solutions.

Here's another programmatic generator which generates multiple spends:

```
(mod (amount)

(defun generate_conds (id pair_count)
(if pair_count
(c (list 66 36 "hello" id) (c (list 67 36 "hello" id) (generate_conds id (- pair_count 1))))
0
)
)

(defun loop_coins (id amount)
(if amount
(c (list id (c 1 (generate_conds id 50)) 123 (list 0 (list 1))) (loop_coins (+ id 1) (- amount 1)))
()
)
)
; main
(list (loop_coins 0x0101010101010101010101010101010101010101010101010101010101010101 amount))
)
```
Loading
Loading