Sorry for the title but I don't know how to explain it better.
I have this simple custom pallet and I try to test the
create_random_number dispatchable function with a simple
assert_ok! but I get this error from the terminal:
running 2 tests test mock::__construct_runtime_integrity_test::runtime_integrity_tests ... ok test tests::crate_random_number ... FAILED failures: ---- tests::crate_random_number stdout ---- thread 'tests::crate_random_number' panicked at 'attempt to subtract with overflow', /rustc/263edd43c5255084292329423c61a9d69715ebfa/library/core/src/ops/arith.rs:240:1
The test panic at this line but I don't understand why because if I try to
cargo build --release and call this function on the polkadot app it works fine.