Change assert(is_err()) to assert_noop to check state consistency on errors#8587
Change assert(is_err()) to assert_noop to check state consistency on errors#85878 commits merged intoparitytech:masterfrom
Conversation
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
|
I think I need some help here with the failing test. When I change the expected error type to a wrong value e.g. When I change the type to the correct value: |
|
@hirschenberger this means you caught a bug :) |
|
Yippie ;-) Any hints where it goes wrong? The lists are no UTF-8 strings and I assume also no SCALE encoded data. Do you think it's a substrate or rust issue? |
|
@hirschenberger it means that in the test, there is some extrinic which is being called, and returning an error. But it is also changing the state of the chain. This is ultimately what the You need to look into the extrinsic to see if you can catch where it can fail after already changing state. I will look into this now, it can be a little complex and sensitive to solve these issues. BTW can you please include your DOT / KSM address? Have you done that already in another PR? |
|
I see, excited to see what the reason for the state change is. I'll also look in the code and try to help with the analysis. Yes I already got a tip from you in another PR: #8541 (comment) I was confused about the two binary lists and thought it was due to a wrong error type that was returned. How about changing |
|
There is no bug here. The function in question ( In this case, just revert the test to how it was before (or, if you like, use |
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
dd1b2af to
584d401
Compare
584d401 to
0d28137
Compare
|
@hirschenberger no force push please :) If you need help with git, happy to do so. |
|
I think I'm done. CI got stuck. |
|
bot merge |
|
Trying merge. |
…errors (paritytech#8587) * Change is_err() asserts in tests to assert_noop to check state consistency fixes paritytech#8545 * Update frame/transaction-payment/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/contracts/src/exec.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/democracy/src/benchmarking.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/transaction-payment/src/lib.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Don't assert no-changing state. see: paritytech#8587 (comment) * fix expected error * Fix non-extrinsic-call asserts Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
fixes #8545