keep-starknet-strange / raito

Bitcoin ZK client written in Cairo.
https://raito.wtf
MIT License
40 stars 34 forks source link

test cases for invalid input sequence (relative locktime) #184

Closed mubarak23 closed 1 month ago

mubarak23 commented 1 month ago
vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
raito ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 15, 2024 8:57pm
mubarak23 commented 1 month ago

should_panic

we can't use should_panic

we are returning a ByteArray containing the error message not panic

maciejka commented 1 month ago

should_panic

we can't use should_panic

we are returning a ByteArray containing the error message not panic

Use unwrap(), on the result it will panic. Or you can destruct the error to get the error message.

mubarak23 commented 1 month ago

(expected: ("...",))

am getting the following error

Result::unwrap failed.

am setting this

#[should_panic(expected: ("Relative block-based lock time is not respected: current height 603019, outpoint height 603018, lock time 144 blocks",))]

and when i try using

result.unwrap_err()

i get the following error

consensus::validation::locktime::tests::test_relative_locktime_enabled_lt_relative_locktime - expected panic but finished successfully.