You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be missing something here, but adding a panic in the guest does not make any of the tests fail:
diff --git a/methods/guest/src/bin/is_even.rs b/methods/guest/src/bin/is_even.rs
index 9d834b6..0dba652 100644
--- a/methods/guest/src/bin/is_even.rs+++ b/methods/guest/src/bin/is_even.rs@@ -19,17 +19,18 @@ use alloy_sol_types::SolValue;
use risc0_zkvm::guest::env;
fn main() {
diff --git a/methods/guest/src/bin/is_even.rs b/methods/guest/src/bin/is_even.rs
index 9d834b6..19b1163 100644
--- a/methods/guest/src/bin/is_even.rs+++ b/methods/guest/src/bin/is_even.rs@@ -19,17 +19,5 @@ use alloy_sol_types::SolValue;
use risc0_zkvm::guest::env;
fn main() {
- // Read the input data for this application.- let mut input_bytes = Vec::<u8>::new();- env::stdin().read_to_end(&mut input_bytes).unwrap();- // Decode and parse the input- let number = <U256>::abi_decode(&input_bytes, true).unwrap();-- // Run the computation.- // In this case, asserting that the provided number is even.- assert!(!number.bit(0), "number is not even");-- // Commit the journal that will be received by the application contract.- // Journal is encoded using Solidity ABI for easy decoding in the app contract.- env::commit_slice(number.abi_encode().as_slice());+ panic!("test");
}
output:
~/dev/ris/risc0-foundry-template (main|✚1) 🌲 forge test -vvv
[⠊] Compiling...
No files changed, compilation skipped
Ran 2 tests for tests/EvenNumber.t.sol:EvenNumberTest
[PASS] test_SetEven() (gas: 294609)
Logs:
Deployed RiscZeroGroth16Verifier to 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
[PASS] test_SetZero() (gas: 274756)
Logs:
Deployed RiscZeroGroth16Verifier to 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 92.60s (148.42s CPU time)
Ran 1 test suite in 92.61s (92.60s CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests)
The text was updated successfully, but these errors were encountered:
So, I'm guessing this is because you are not running cargo build after making that change. We don't have any mechanism in place to build the guest when someone runs forge build and forge test right now. This is a good issue to raise though, because I am sure other folks will trip over this.
I might be missing something here, but adding a panic in the guest does not make any of the tests fail:
output:
The text was updated successfully, but these errors were encountered: