gear
gear copied to clipboard
Fix tests which use plain WAT as a tested program
Problem
Some tests, like gasfull_after_gasless use a plain WAT. A written in WAT program expects gr_reply_wgas import func with 6 params, but actually 5 are given. The execution ends up with an error, but the test is still green.
This is an error:
[2023-06-27T12:47:36Z DEBUG gear_core_processor::processing] Wasm execution error: Environment error: function type mismatch for import env::gr_reply_wgas: expected FuncType { len_params: 6, params_results: [I32, I32, I64, I32, I32, I32] } but found FuncType { len_params: 5, params_results: [I32, I32, I64, I32, I32] }
Running test:
> cargo test gasfull_after_gasless
Compiling pallet-gear v2.0.0 (/gear/pallets/gear)
Finished test [unoptimized + debuginfo] target(s) in 31.45s
Running unittests src/lib.rs (/gear/target/debug/deps/pallet_gear-7c5ba2d368cbfd21)
running 1 test
test tests::gasfull_after_gasless ... ok
I think it's just one or some tests problem, which does not the must do https://github.com/gear-tech/gear/blob/cc05842c1549c2428db06aab86d7de7edb06418a/pallets/gear/src/tests.rs#L800-L801
No checks after run to next block
There must not be any false tests, or tests which test nothing and etc.