Unpredictable behaviour when using the `elrond-wasm-rs` framework
Closed this issue · 4 comments
See ctindogarus4f/elrond-smart-contracts#1 ctindogarus4f/elrond-smart-contracts#2 and for more context.
There are 3 branches involved:
- allow-premature-unstake-fail
- allow-premature-unstake-less-calls
- allow-premature-unstake-no-require
erdpy contract test
should pass on all the 3 branches, however it doesn't pass on the allow-premature-unstake-fail
. There is literally no difference between the branches in terms of logic, so the only possible explanation why the allow-premature-unstake-fail
branch fails is that what you see in the code it is not what's get compiled by erdpy. You write some logic in your function and it appears that other random logic gets executed...
It tooks me 2 full days to debug this and I still have no clue why allow-premature-unstake-fail
fails but the other 2 do not. It literally doesn't make any sense.
PS: There is nothing wrong with the mandos suite tests, because I manually test it as well, and indeed the logic is different on allow-premature-unstake-fail
for reasons that I cannot explain.
Did you try to to run the tests using the Rust infrastructure and do some debugging?
You're likely forgetting to build before running the tests. Mandos tests only use the wasm file from the output folder, so even if you change branches, the compiled code will be the same, regardless of what's in your source files.
TL;DR: erdpy contract build before erdpy contract test
Have you even tried to run the examples that I gave you? I build everything prior to each run of the tests, it has nothing to do with that.
I've also tried to debug it myself for 2 days already. It's something wrong within the framework and how the code gets translated to the wasm binary.
Please re-open the issue and look into it. This does seem like a serious issue to me and it really question the entire Elrond infrastructure.
If you write a + b = c
, but it gets translated to a + b = d
by the framework, what confidence do I have to write anything with Elrond?
any update on this? this should be further explored since it shows a major red flag within the framework