From 17e2e42f16563feec05d735e9ea5d277880711e3 Mon Sep 17 00:00:00 2001 From: aayux Date: Wed, 11 May 2022 00:24:06 -0500 Subject: [PATCH] Bug fix for `single_tx_validity_test` Test of transaction with the wrong signing key in `single_tx_validity_test` fails without a new `temp_state`. Seems pretty self-explanatory. --- rollup/src/rollup.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rollup/src/rollup.rs b/rollup/src/rollup.rs index 176048c..8b19beb 100644 --- a/rollup/src/rollup.rs +++ b/rollup/src/rollup.rs @@ -308,7 +308,8 @@ mod test { ) .unwrap(); assert!(test_cs(rollup)); - + + let mut temp_state = state.clone(); let bad_tx = Transaction::create(&pp, alice_id, bob_id, Amount(5), &bob_sk, &mut rng); assert!(!bad_tx.validate(&pp, &temp_state)); assert!(matches!(temp_state.apply_transaction(&pp, &bad_tx), None));